#include <MRSurfacePointPicker.h>
Classes | |
struct | Parameters |
Public Types | |
enum class | PositionType { Faces , FaceCenters , Edges , EdgeCenters , 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 () |
const std::shared_ptr< SphereObject > & | getPickSphere () const |
const Parameters & | getParameters () const |
MRVIEWER_API void | setParameters (const Parameters ¶ms) |
MRVIEWER_API void | setBaseColor (const Color &color) |
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 |
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 | setStartMoveCallback (std::function< void(SurfacePointWidget &, const PickedPoint &)> startMove) |
void | setOnMoveCallback (std::function< void(SurfacePointWidget &, const PickedPoint &)> onMove) |
void | setEndMoveCallback (std::function< void(SurfacePointWidget &, const PickedPoint &)> endMove) |
std::shared_ptr< VisualObject > & | getBaseSurface () |
bool | isOnMove () const |
void | startDragging () |
![]() | |
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) |
|
strong |
MRVIEWER_API MR::SurfacePointWidget::~SurfacePointWidget | ( | ) |
MRVIEWER_API const PickedPoint & MR::SurfacePointWidget::create | ( | const std::shared_ptr< VisualObject > & | surface, |
const PickedPoint & | startPos ) |
MRVIEWER_API const PickedPoint & MR::SurfacePointWidget::create | ( | const std::shared_ptr< VisualObject > & | surface, |
const PointOnObject & | startPos ) |
|
inline |
return local object's coordinates at the current position, or std::nullopt if it is invalid
|
inline |
return the normal in local object's coordinates at the current position, or std::nullopt if it is invalid or normal is not defined
|
inline |
|
inline |
MRVIEWER_API Vector3f MR::SurfacePointWidget::getCoords | ( | ) | const |
return local object's coordinates at the current position where the center of sphere is located
|
inline |
|
inline |
returns stored position as MeshTriPoint, otherwise returns invalid (default) MeshTriPoint
|
inline |
|
inline |
|
inlinenodiscard |
|
staticnodiscard |
MRVIEWER_API void MR::SurfacePointWidget::reset | ( | ) |
|
inline |
MRVIEWER_API void MR::SurfacePointWidget::setBaseColor | ( | const Color & | color | ) |
MRVIEWER_API void MR::SurfacePointWidget::setCurrentPosition | ( | const PickedPoint & | pos | ) |
sets new position for the widget
MRVIEWER_API void MR::SurfacePointWidget::setCurrentPosition | ( | const PointOnObject & | pos | ) |
sets new position for the widget
|
inline |
MRVIEWER_API void MR::SurfacePointWidget::setHovered | ( | bool | on | ) |
|
inline |
MRVIEWER_API void MR::SurfacePointWidget::setParameters | ( | const Parameters & | params | ) |
|
inline |
void MR::SurfacePointWidget::startDragging | ( | ) |
activates dragging of this widget; this method is called automatically on mouse down, but it can also be called manually, please be sure that mouse is over this widget and is down
MRVIEWER_API void MR::SurfacePointWidget::swapCurrentPosition | ( | PickedPoint & | pos | ) |
sets new position for the widget and returns previous position in the argument
|
inline |
MRVIEWER_API void MR::SurfacePointWidget::updateParameters | ( | const std::function< void(Parameters &)> & | visitor | ) |
Update the widget parameters.
visitor | - the function that takes the widget parameters and modifies them. Then the parameters are applied by setParameters. |