Widget for visualizing the direction. More...
#include <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 | |
| MRVIEWER_API void | create (Object *parent=nullptr) |
| MRVIEWER_API void | create (const Vector3f &worldDir, const Vector3f &worldBase, float worldLength, OnDirectionChangedCallback onDirectionChanged, Object *parent=nullptr) |
| MRVIEWER_API void | reset () |
| MRVIEWER_API void | setOnDirectionChangedCallback (OnDirectionChangedCallback cb) |
| Manually set callback function. | |
| MRVIEWER_API void | updateArrow (const Arrow &arrow) |
| Updates the arrow, in world space. | |
| MRVIEWER_API void | updateLocalArrow (const Arrow &arrow) |
| Updates the arrow in parent's space. | |
| MRVIEWER_API void | updateDirection (const Vector3f &dir) |
| Updates the direction of the arrow, in world space. | |
| MRVIEWER_API void | updateLocalDirection (const Vector3f &dir) |
| Updates the direction of the arrow in parent's space. | |
| MRVIEWER_API void | updateBase (const Vector3f &base) |
| Updates the base of the arrow, in world space. | |
| MRVIEWER_API void | updateLocalBase (const Vector3f &base) |
| Updates the base of the arrow in parent's space. | |
| MRVIEWER_API void | updateLength (float length) |
| Updates the length of the arrow, in world space. | |
| MRVIEWER_API 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. | |
| MRVIEWER_API void | setVisible (bool visible) |
| Sets the visibility of the widget. | |
| MRVIEWER_API bool | isVisible () const |
| MRVIEWER_API void | setColor (const Color &color) |
| Sets the color of the widget. | |
| MRVIEWER_API const Color & | getColor () const |
| Returns the color of the widget. | |
| MRVIEWER_API Arrow | getArrow () const |
| Returns the arrow's properties, in world space. | |
| MRVIEWER_API Arrow | getLocalArrow () const |
| Returns the arrow's properties in parent's space. | |
| MRVIEWER_API Vector3f | getBase () const |
| Returns the base of the widget, in world space. | |
| MRVIEWER_API Vector3f | getLocalBase () const |
| Returns the base of the widget in parent's space. | |
| MRVIEWER_API Vector3f | getDirection () const |
| Returns the direction of the widget, in world space. | |
| MRVIEWER_API Vector3f | getLocalDirection () const |
| Returns the direction of the widget in parent's space. | |
| MRVIEWER_API float | getLength () const |
| Returns the length of the arrow in world space. | |
| MRVIEWER_API float | getLocalLength () const |
| Returns the length of the arrow in parent's space. | |
| MRVIEWER_API Object * | getParentPtr () 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 () |
Widget for visualizing the direction.