MeshLib
 
Loading...
Searching...
No Matches
MR::DirectionWidget Class Reference

Widget for visualizing the direction. More...

#include <MRDirectionWidget.h>

+ Inheritance diagram for MR::DirectionWidget:

Classes

class  ChangeDirAction
 history action for changing the direction. 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 (const Vector3f &dir, const Vector3f &base, float length, OnDirectionChangedCallback onDirectionChanged, VisualObject *parent=nullptr)
 
MRVIEWER_API void reset ()
 
MRVIEWER_API void setOnDirectionChangedCallback (OnDirectionChangedCallback cb)
 Manually set callback function.
 
MRVIEWER_API void updateDirection (const Vector3f &dir)
 Updates the direction of the arrow.
 
MRVIEWER_API void updateBase (const Vector3f &base)
 Updates the base of the arrow.
 
MRVIEWER_API void updateLength (float length)
 Updates the length of the arrow.
 
MRVIEWER_API void updateArrow (const Vector3f &base, float length)
 Updates the base and the length of the arrow.
 
MRVIEWER_API void setVisible (bool visible)
 Sets the visibility of the widget.
 
MRVIEWER_API void setColor (const Color &color)
 Sets the color of the widget.
 
MRVIEWER_API const ColorgetColor () const
 Returns the color of the widget.
 
MRVIEWER_API const Vector3fgetBase () const
 Returns the base of the widget.
 
MRVIEWER_API const Vector3fgetDirection () const
 Returns the direction of the widget.
 
MRVIEWER_API const VisualObjectgetParentPtr () const
 Returns pointer to parent object.
 
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.

Member Typedef Documentation

◆ OnDirectionChangedCallback

using MR::DirectionWidget::OnDirectionChangedCallback = std::function<void( const Vector3f&, bool )>

This callback is invoked every time when the direction is changed by mouse.

Member Function Documentation

◆ create()

MRVIEWER_API void MR::DirectionWidget::create ( const Vector3f & dir,
const Vector3f & base,
float length,
OnDirectionChangedCallback onDirectionChanged,
VisualObject * parent = nullptr )

Creates a new widget for visualizing the direction and adds it to scene subscribes to viewer events

Parameters
dirinitial direction
baseinitial base of the arrow
lengthlength of the arrow
onDirectionChangedcallback for the direction change

◆ getBase()

MRVIEWER_API const Vector3f & MR::DirectionWidget::getBase ( ) const

Returns the base of the widget.

◆ getColor()

MRVIEWER_API const Color & MR::DirectionWidget::getColor ( ) const

Returns the color of the widget.

◆ getDirection()

MRVIEWER_API const Vector3f & MR::DirectionWidget::getDirection ( ) const

Returns the direction of the widget.

◆ getParentPtr()

MRVIEWER_API const VisualObject * MR::DirectionWidget::getParentPtr ( ) const

Returns pointer to parent object.

◆ isMouseBlocked()

bool MR::DirectionWidget::isMouseBlocked ( ) const
inline

Block or allow mouse editing (allowed by default)

◆ reset()

MRVIEWER_API void MR::DirectionWidget::reset ( )

Removes the widget from the scene unsubscribes from viewer events

◆ setColor()

MRVIEWER_API void MR::DirectionWidget::setColor ( const Color & color)

Sets the color of the widget.

◆ setMouseBlocked()

void MR::DirectionWidget::setMouseBlocked ( bool blocked)
inline

◆ setOnDirectionChangedCallback()

MRVIEWER_API void MR::DirectionWidget::setOnDirectionChangedCallback ( OnDirectionChangedCallback cb)

Manually set callback function.

◆ setVisible()

MRVIEWER_API void MR::DirectionWidget::setVisible ( bool visible)

Sets the visibility of the widget.

◆ updateArrow()

MRVIEWER_API void MR::DirectionWidget::updateArrow ( const Vector3f & base,
float length )

Updates the base and the length of the arrow.

◆ updateBase()

MRVIEWER_API void MR::DirectionWidget::updateBase ( const Vector3f & base)

Updates the base of the arrow.

◆ updateDirection()

MRVIEWER_API void MR::DirectionWidget::updateDirection ( const Vector3f & dir)

Updates the direction of the arrow.

◆ updateLength()

MRVIEWER_API void MR::DirectionWidget::updateLength ( float length)

Updates the length of the arrow.


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