OpenWalnut
1.4.0
|
New OSG manipulator: TrackballManipulator with added mouse wheel zoom. More...
#include <WGEZoomTrackballManipulator.h>
Public Member Functions | |
WGEZoomTrackballManipulator () | |
Default constructor. | |
virtual void | setByMatrix (const osg::Matrixd &matrix) |
Set the position of the manipulator using a 4x4 matrix. | |
virtual osg::Matrixd | getMatrix () const |
Get the position of the manipulator as 4x4 matrix. | |
virtual osg::Matrixd | getMatrixWithoutZoom () const |
Get the manipulator only containing rotation and translation. | |
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. | |
virtual void | home (double currentTime) |
Move the camera to the default position. | |
virtual bool | handle (const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &us) |
Handle events, return true if handled, false otherwise. | |
double | getZoom () const |
Get zoom factor. | |
void | setZoom (double zoom) |
Set zoom factor. | |
void | setPaintMode (int mode) |
setter for paint mode when set to something different from 0, a left drag should move the scene | |
void | setThrow (bool allowThrow=true) |
En-/Disables throwing. | |
bool | getThrow () const |
Checks whether throwing is active. | |
Private Member Functions | |
bool | zoom (const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &us) |
Handles events related to zooming. | |
Private Attributes | |
double | m_zoom |
Zoom factor. | |
bool | m_allowThrow |
Do we want the auto-rotation thingy? | |
int | m_paintMode |
paint mode |
New OSG manipulator: TrackballManipulator with added mouse wheel zoom.
Definition at line 34 of file WGEZoomTrackballManipulator.h.
Default constructor.
Definition at line 28 of file WGEZoomTrackballManipulator.cpp.
osg::Matrixd WGEZoomTrackballManipulator::getInverseMatrix | ( | ) | const [virtual] |
Get the position of the manipulator as a inverse matrix of the manipulator, typically used as a model view matrix.
Definition at line 55 of file WGEZoomTrackballManipulator.cpp.
References m_zoom.
osg::Matrixd WGEZoomTrackballManipulator::getMatrix | ( | ) | const [virtual] |
Get the position of the manipulator as 4x4 matrix.
Definition at line 45 of file WGEZoomTrackballManipulator.cpp.
References m_zoom.
Referenced by getMatrixWithoutZoom().
osg::Matrixd WGEZoomTrackballManipulator::getMatrixWithoutZoom | ( | ) | const [virtual] |
Get the manipulator only containing rotation and translation.
Definition at line 50 of file WGEZoomTrackballManipulator.cpp.
References getMatrix().
bool WGEZoomTrackballManipulator::getThrow | ( | ) | const |
Checks whether throwing is active.
Definition at line 172 of file WGEZoomTrackballManipulator.cpp.
References m_allowThrow.
double WGEZoomTrackballManipulator::getZoom | ( | ) | const [inline] |
Get zoom factor.
Definition at line 138 of file WGEZoomTrackballManipulator.h.
References m_zoom.
bool WGEZoomTrackballManipulator::handle | ( | const osgGA::GUIEventAdapter & | ea, |
osgGA::GUIActionAdapter & | us | ||
) | [virtual] |
Handle events, return true if handled, false otherwise.
ea | Event class for storing Keyboard, mouse and window events. |
us | Interface by which GUIEventHandlers may request actions of the GUI system |
Definition at line 124 of file WGEZoomTrackballManipulator.cpp.
References WGraphicsEngine::getGraphicsEngine(), home(), m_allowThrow, m_paintMode, and zoom().
void WGEZoomTrackballManipulator::home | ( | double | currentTime | ) | [virtual] |
Move the camera to the default position.
May be ignored by manipulators if home functionality is not appropriate.
currentTime | Variable specified in osg class but not used. |
Definition at line 60 of file WGEZoomTrackballManipulator.cpp.
References m_zoom.
Referenced by handle().
void WGEZoomTrackballManipulator::setByMatrix | ( | const osg::Matrixd & | matrix | ) | [virtual] |
Set the position of the manipulator using a 4x4 matrix.
matrix | position of the manipulator |
Definition at line 37 of file WGEZoomTrackballManipulator.cpp.
References m_zoom.
void WGEZoomTrackballManipulator::setPaintMode | ( | int | mode | ) |
setter for paint mode when set to something different from 0, a left drag should move the scene
mode | the mode |
Definition at line 162 of file WGEZoomTrackballManipulator.cpp.
References m_paintMode.
void WGEZoomTrackballManipulator::setThrow | ( | bool | allowThrow = true | ) |
En-/Disables throwing.
allowThrow | if true, throwing is enabled. |
Definition at line 167 of file WGEZoomTrackballManipulator.cpp.
References m_allowThrow.
Referenced by WGEViewer::updateThrowing().
void WGEZoomTrackballManipulator::setZoom | ( | double | zoom | ) | [inline] |
Set zoom factor.
zoom | the zoom factor to be set. |
Definition at line 143 of file WGEZoomTrackballManipulator.h.
bool WGEZoomTrackballManipulator::zoom | ( | const osgGA::GUIEventAdapter & | ea, |
osgGA::GUIActionAdapter & | us | ||
) | [private] |
Handles events related to zooming.
ea | Event class for storing Keyboard, mouse and window events. |
us | Interface by which GUIEventHandlers may request actions of the GUI system |
Definition at line 66 of file WGEZoomTrackballManipulator.cpp.
References m_zoom.
bool WGEZoomTrackballManipulator::m_allowThrow [private] |
Do we want the auto-rotation thingy?
Definition at line 133 of file WGEZoomTrackballManipulator.h.
Referenced by getThrow(), handle(), and setThrow().
int WGEZoomTrackballManipulator::m_paintMode [private] |
paint mode
Definition at line 135 of file WGEZoomTrackballManipulator.h.
Referenced by handle(), and setPaintMode().
double WGEZoomTrackballManipulator::m_zoom [private] |
Zoom factor.
Definition at line 132 of file WGEZoomTrackballManipulator.h.
Referenced by getInverseMatrix(), getMatrix(), getZoom(), home(), setByMatrix(), setZoom(), and zoom().