Widget for controlling point on surface with mouse. More...
#include <MRSurfacePointPicker.h>
Inheritance diagram for MR::SurfacePointWidget:Classes | |
| struct | Parameters |
Public Types | |
| enum class | PositionType { PositionType::Faces , PositionType::FaceCenters , PositionType::Edges , PositionType::EdgeCenters , PositionType::Verts } |
Public Member Functions | |
| MRVIEWER_API | ~SurfacePointWidget () |
| MRVIEWER_API const PickedPoint & | create (const std::shared_ptr< VisualObject > &surface, const PointOnObject &startPos) |
| MRVIEWER_API const PickedPoint & | create (const std::shared_ptr< VisualObject > &surface, const PickedPoint &startPos) |
| MRVIEWER_API void | reset () |
| resets whole widget | |
| const std::shared_ptr< SphereObject > & | getPickSphere () const |
| returns object of control sphere | |
| const Parameters & | getParameters () const |
| get current setup of this widget | |
| MRVIEWER_API void | setParameters (const Parameters ¶ms) |
| set parameters for this widget | |
| MRVIEWER_API void | setBaseColor (const Color &color) |
| set baseColor parameter for this widget | |
| MRVIEWER_API void | updateParameters (const std::function< void(Parameters &)> &visitor) |
| bool | getAutoHover () const |
| void | setAutoHover (bool on) |
| MRVIEWER_API void | setHovered (bool on) |
| const PickedPoint & | getCurrentPosition () const |
| returns stored position of this widget | |
| MRVIEWER_API Vector3f | getCoords () const |
| return local object's coordinates at the current position where the center of sphere is located | |
| Vector3f | toVector3f () const |
| std::optional< Vector3f > | findCoords () const |
| return local object's coordinates at the current position, or std::nullopt if it is invalid | |
| std::optional< Vector3f > | findNormal () const |
| return the normal in local object's coordinates at the current position, or std::nullopt if it is invalid or normal is not defined | |
| MeshTriPoint | getCurrentPositionMeshTriPoint () const |
| returns stored position as MeshTriPoint, otherwise returns invalid (default) MeshTriPoint | |
| MRVIEWER_API void | setCurrentPosition (const PointOnObject &pos) |
| sets new position for the widget | |
| MRVIEWER_API void | setCurrentPosition (const PickedPoint &pos) |
| sets new position for the widget | |
| MRVIEWER_API void | swapCurrentPosition (PickedPoint &pos) |
| sets new position for the widget and returns previous position in the argument | |
| void | setCanMoveCallback (std::function< bool(SurfacePointWidget &, const PickedPoint &)> canMove) |
| this callback is called before modification starts if it is set, and can cancel it by returning false | |
| void | setStartMoveCallback (std::function< void(SurfacePointWidget &, const PickedPoint &)> startMove) |
| this callback is called when modification starts if it is set | |
| void | setOnMoveCallback (std::function< void(SurfacePointWidget &, const PickedPoint &)> onMove) |
| this callback is called on modification if it is set | |
| void | setEndMoveCallback (std::function< void(SurfacePointWidget &, const PickedPoint &)> endMove) |
| this callback is called when modification ends if it is set | |
| std::shared_ptr< VisualObject > & | getBaseSurface () |
| bool | isOnMove () const |
| returns whether is the widget moving | |
| bool | startDragging () |
Public Member Functions inherited from MR::MultiListener< PreDrawListener, MouseDownListener, MouseMoveListener, MouseUpListener > | |
| virtual | ~MultiListener ()=default |
| virtual void | connect (Viewer *viewer, int group=0, boost::signals2::connect_position pos=boost::signals2::connect_position::at_back) |
| virtual void | disconnect () |
Static Public Member Functions | |
| static bool | isPickIntoBackFace (const std::shared_ptr< MR::VisualObject > &obj, const MR::PointOnObject &pick, const Vector3f &cameraEye) |
| Checks whether the current peak is a peak in the invisible (reverse) side of the mesh or cloud point. | |
Widget for controlling point on surface with mouse.