MeshLib C++ Docs
Loading...
Searching...
No Matches

Widget for controlling point on surface with mouse. More...

#include <MRViewer/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

 ~SurfacePointWidget ()
const PickedPointcreate (const std::shared_ptr< VisualObject > &surface, const PointOnObject &startPos)
const PickedPointcreate (const std::shared_ptr< VisualObject > &surface, const PickedPoint &startPos)
void reset ()
 resets whole widget
const std::shared_ptr< SphereObject > & getPickSphere () const
 returns object of control sphere
const ParametersgetParameters () const
 get current setup of this widget
void setParameters (const Parameters &params)
 set parameters for this widget
void setBaseColor (const Color &color)
 set baseColor parameter for this widget
void updateParameters (const std::function< void(Parameters &)> &visitor)
bool getAutoHover () const
void setAutoHover (bool on)
void setHovered (bool on)
const PickedPointgetCurrentPosition () const
 returns stored position of this widget
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
void setCurrentPosition (const PointOnObject &pos)
 sets new position for the widget
void setCurrentPosition (const PickedPoint &pos)
 sets new position for the widget
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.

Detailed Description

Widget for controlling point on surface with mouse.


The documentation for this class was generated from the following file: