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

Widget for visualizing the direction. More...

#include <MRViewer/MRDirectionWidget.h>

Inheritance diagram for MR::DirectionWidget:

Classes

struct  Arrow
class  ChangeDirAction
 This history action must be created before the change in widget's direction, base or length to make them undo-able. More...
class  ChangeVisibleAction
 history action for changing the visible. It should be added to the history stack by user code More...

Public Types

using OnDirectionChangedCallback = std::function<void( const Vector3f&, bool )>
 This callback is invoked every time when the direction is changed by mouse.

Public Member Functions

void create (Object *parent=nullptr)
void create (const Vector3f &worldDir, const Vector3f &worldBase, float worldLength, OnDirectionChangedCallback onDirectionChanged, Object *parent=nullptr)
void reset ()
void setOnDirectionChangedCallback (OnDirectionChangedCallback cb)
 Manually set callback function.
void updateArrow (const Arrow &arrow)
 Updates the arrow, in world space.
void updateLocalArrow (const Arrow &arrow)
 Updates the arrow in parent's space.
void updateDirection (const Vector3f &dir)
 Updates the direction of the arrow, in world space.
void updateLocalDirection (const Vector3f &dir)
 Updates the direction of the arrow in parent's space.
void updateBase (const Vector3f &base)
 Updates the base of the arrow, in world space.
void updateLocalBase (const Vector3f &base)
 Updates the base of the arrow in parent's space.
void updateLength (float length)
 Updates the length of the arrow, in world space.
void updateLocalLength (float length)
 Updates the length of the arrow in parent's space.
const std::shared_ptr< ObjectMesh > & obj () const
 Returns internal data model object of this widget.
void setVisible (bool visible)
 Sets the visibility of the widget.
bool isVisible () const
void setColor (const Color &color)
 Sets the color of the widget.
const ColorgetColor () const
 Returns the color of the widget.
Arrow getArrow () const
 Returns the arrow's properties, in world space.
Arrow getLocalArrow () const
 Returns the arrow's properties in parent's space.
Vector3f getBase () const
 Returns the base of the widget, in world space.
Vector3f getLocalBase () const
 Returns the base of the widget in parent's space.
Vector3f getDirection () const
 Returns the direction of the widget, in world space.
Vector3f getLocalDirection () const
 Returns the direction of the widget in parent's space.
float getLength () const
 Returns the length of the arrow in world space.
float getLocalLength () const
 Returns the length of the arrow in parent's space.
ObjectgetParentPtr () const
 Returns pointer to parent object, always not-null after create() and before reset()
bool isMouseBlocked () const
 Block or allow mouse editing (allowed by default)
void setMouseBlocked (bool blocked)
Public Member Functions inherited from MR::MultiListener< 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 ()

Detailed Description

Widget for visualizing the direction.


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