OpenWalnut  1.5.0dev
Public Member Functions | Private Member Functions | Private Attributes | List of all members
WGEAdvancedManipulator Class Reference

TrackballManipulator with added mouse wheel zoom. More...

#include <WGEAdvancedManipulator.h>

+ Inheritance diagram for WGEAdvancedManipulator:
+ Collaboration diagram for WGEAdvancedManipulator:

Public Member Functions

 WGEAdvancedManipulator ()
 Default constructor. More...
 
virtual void setByMatrix (const osg::Matrixd &matrix)
 Set the position of the manipulator using a 4x4 matrix. More...
 
virtual osg::Matrixd getMatrix () const
 Get the position of the manipulator as 4x4 matrix. More...
 
virtual osg::Matrixd getMatrixWithoutZoom () const
 Get the manipulator only containing rotation and translation. More...
 
virtual osg::Matrixd getInverseMatrix () const
 Get the position of the manipulator as a inverse matrix of the manipulator, typically used as a model view matrix. More...
 
virtual void home (double currentTime)
 Move the camera to the default position. More...
 
virtual bool handle (const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &us)
 Handle events, return true if handled, false otherwise. More...
 
double getZoom () const
 Get zoom factor. More...
 
void setZoom (double zoom)
 Set zoom factor. More...
 
void setPaintMode (int mode)
 setter for paint mode when set to something different from 0, a left drag should move the scene More...
 
void setThrow (bool allowThrow=true)
 En-/Disables throwing. More...
 
bool getThrow () const
 Checks whether throwing is active. More...
 

Private Member Functions

bool zoom (const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &us)
 Handles events related to zooming. More...
 

Private Attributes

double m_zoom
 Zoom factor. More...
 
bool m_allowThrow
 Do we want the auto-rotation thingy? More...
 
int m_paintMode
 paint mode More...
 

Detailed Description

TrackballManipulator with added mouse wheel zoom.

Home function will also choose appropriate zoom for ALL nodes in the scene graph. This means also for the deactivated ones.

Definition at line 35 of file WGEAdvancedManipulator.h.

Constructor & Destructor Documentation

◆ WGEAdvancedManipulator()

WGEAdvancedManipulator::WGEAdvancedManipulator ( )

Default constructor.

Definition at line 28 of file WGEAdvancedManipulator.cpp.

Member Function Documentation

◆ getInverseMatrix()

osg::Matrixd WGEAdvancedManipulator::getInverseMatrix ( ) const
virtual

Get the position of the manipulator as a inverse matrix of the manipulator, typically used as a model view matrix.

Returns
the inverse matrix

Definition at line 55 of file WGEAdvancedManipulator.cpp.

References m_zoom.

◆ getMatrix()

osg::Matrixd WGEAdvancedManipulator::getMatrix ( ) const
virtual

Get the position of the manipulator as 4x4 matrix.

Returns
the matrix representing the transformation

Definition at line 45 of file WGEAdvancedManipulator.cpp.

References m_zoom.

◆ getMatrixWithoutZoom()

osg::Matrixd WGEAdvancedManipulator::getMatrixWithoutZoom ( ) const
virtual

Get the manipulator only containing rotation and translation.

Returns
the matrix with translation and rotation.

Definition at line 50 of file WGEAdvancedManipulator.cpp.

◆ getThrow()

bool WGEAdvancedManipulator::getThrow ( ) const

Checks whether throwing is active.

Returns
true if active

Definition at line 183 of file WGEAdvancedManipulator.cpp.

References m_allowThrow.

◆ getZoom()

double WGEAdvancedManipulator::getZoom ( ) const
inline

Get zoom factor.

Returns
the current zoom factor

Definition at line 138 of file WGEAdvancedManipulator.h.

References m_zoom.

◆ handle()

bool WGEAdvancedManipulator::handle ( const osgGA::GUIEventAdapter &  ea,
osgGA::GUIActionAdapter &  us 
)
virtual

Handle events, return true if handled, false otherwise.

Parameters
eaEvent class for storing Keyboard, mouse and window events.
usInterface by which GUIEventHandlers may request actions of the GUI system
Returns
true if event was handled

Definition at line 129 of file WGEAdvancedManipulator.cpp.

References WGraphicsEngine::getGraphicsEngine(), home(), m_allowThrow, m_paintMode, and zoom().

+ Here is the call graph for this function:

◆ home()

void WGEAdvancedManipulator::home ( double  currentTime)
virtual

Move the camera to the default position.

Parameters
currentTimeVariable specified in osg class but not used.

Definition at line 60 of file WGEAdvancedManipulator.cpp.

References m_zoom.

Referenced by handle().

+ Here is the caller graph for this function:

◆ setByMatrix()

void WGEAdvancedManipulator::setByMatrix ( const osg::Matrixd &  matrix)
virtual

Set the position of the manipulator using a 4x4 matrix.

Parameters
matrixposition of the manipulator

Definition at line 37 of file WGEAdvancedManipulator.cpp.

References m_zoom.

◆ setPaintMode()

void WGEAdvancedManipulator::setPaintMode ( int  mode)

setter for paint mode when set to something different from 0, a left drag should move the scene

Parameters
modethe mode

Definition at line 173 of file WGEAdvancedManipulator.cpp.

References m_paintMode.

◆ setThrow()

void WGEAdvancedManipulator::setThrow ( bool  allowThrow = true)

En-/Disables throwing.

Parameters
allowThrowif true, throwing is enabled.

Definition at line 178 of file WGEAdvancedManipulator.cpp.

References m_allowThrow.

◆ setZoom()

void WGEAdvancedManipulator::setZoom ( double  zoom)
inline

Set zoom factor.

Parameters
zoomthe zoom factor to be set.

Definition at line 143 of file WGEAdvancedManipulator.h.

References m_zoom, and zoom().

+ Here is the call graph for this function:

◆ zoom()

bool WGEAdvancedManipulator::zoom ( const osgGA::GUIEventAdapter &  ea,
osgGA::GUIActionAdapter &  us 
)
private

Handles events related to zooming.

Parameters
eaEvent class for storing Keyboard, mouse and window events.
usInterface by which GUIEventHandlers may request actions of the GUI system
Returns
true if event was handled

Definition at line 71 of file WGEAdvancedManipulator.cpp.

References m_zoom.

Referenced by handle(), and setZoom().

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_allowThrow

bool WGEAdvancedManipulator::m_allowThrow
private

Do we want the auto-rotation thingy?

Definition at line 133 of file WGEAdvancedManipulator.h.

Referenced by getThrow(), handle(), and setThrow().

◆ m_paintMode

int WGEAdvancedManipulator::m_paintMode
private

paint mode

Definition at line 135 of file WGEAdvancedManipulator.h.

Referenced by handle(), and setPaintMode().

◆ m_zoom

double WGEAdvancedManipulator::m_zoom
private

Zoom factor.

Definition at line 132 of file WGEAdvancedManipulator.h.

Referenced by getInverseMatrix(), getMatrix(), getZoom(), home(), setByMatrix(), setZoom(), and zoom().


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