OpenWalnut
1.5.0dev
|
New OSG manipulator: TrackballManipulator with added mouse wheel zoom. More...
#include <WGEZoomTrackballManipulator.h>
Public Member Functions | |
WGEZoomTrackballManipulator () | |
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... | |
virtual void | computeHomePosition (const osg::Camera *camera, bool useBoundingBox) |
Computes the home position. More... | |
void | fitToScreen (const osg::Camera *camera) |
Zooms and centers to fit screen. More... | |
Private Member Functions | |
bool | zoom (const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &us) |
Handles events related to zooming. More... | |
virtual bool | performMovementMiddleMouseButton (const double eventTimeDelta, const double dx, const double dy) |
Performs the middle mouse button click. 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... | |
double | m_radius |
The radius of the bounding sphere. More... | |
New OSG manipulator: TrackballManipulator with added mouse wheel zoom.
Definition at line 36 of file WGEZoomTrackballManipulator.h.
WGEZoomTrackballManipulator::WGEZoomTrackballManipulator | ( | ) |
Default constructor.
Definition at line 28 of file WGEZoomTrackballManipulator.cpp.
|
virtual |
Computes the home position.
camera | The camera from which to compute. |
useBoundingBox | if boundingboxes should be used. |
Definition at line 179 of file WGEZoomTrackballManipulator.cpp.
References WGEZoomTrackballNodeVisitor::getBoundingBox(), and m_radius.
Referenced by fitToScreen().
void WGEZoomTrackballManipulator::fitToScreen | ( | const osg::Camera * | camera | ) |
Zooms and centers to fit screen.
camera | The camera to zoom. |
Definition at line 215 of file WGEZoomTrackballManipulator.cpp.
References computeHomePosition(), m_radius, and m_zoom.
|
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.
|
virtual |
Get the position of the manipulator as 4x4 matrix.
Definition at line 45 of file WGEZoomTrackballManipulator.cpp.
References m_zoom.
|
virtual |
Get the manipulator only containing rotation and translation.
Definition at line 50 of file WGEZoomTrackballManipulator.cpp.
bool WGEZoomTrackballManipulator::getThrow | ( | ) | const |
Checks whether throwing is active.
Definition at line 174 of file WGEZoomTrackballManipulator.cpp.
References m_allowThrow.
|
inline |
Get zoom factor.
Definition at line 165 of file WGEZoomTrackballManipulator.h.
References m_zoom.
|
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().
|
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().
|
privatevirtual |
Performs the middle mouse button click.
eventTimeDelta | The delta time of the event |
dx | The delta x of the mouse. |
dy | The delta y of the mouse. |
Definition at line 255 of file WGEZoomTrackballManipulator.cpp.
References m_zoom.
|
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 164 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 169 of file WGEZoomTrackballManipulator.cpp.
References m_allowThrow.
Referenced by WGEViewer::updateThrowing().
|
inline |
Set zoom factor.
zoom | the zoom factor to be set. |
Definition at line 170 of file WGEZoomTrackballManipulator.h.
References m_zoom, and zoom().
|
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.
Referenced by handle(), and setZoom().
|
private |
Do we want the auto-rotation thingy?
Definition at line 158 of file WGEZoomTrackballManipulator.h.
Referenced by getThrow(), handle(), and setThrow().
|
private |
paint mode
Definition at line 160 of file WGEZoomTrackballManipulator.h.
Referenced by handle(), and setPaintMode().
|
private |
The radius of the bounding sphere.
Definition at line 162 of file WGEZoomTrackballManipulator.h.
Referenced by computeHomePosition(), and fitToScreen().
|
private |
Zoom factor.
Definition at line 157 of file WGEZoomTrackballManipulator.h.
Referenced by fitToScreen(), getInverseMatrix(), getMatrix(), getZoom(), home(), performMovementMiddleMouseButton(), setByMatrix(), setZoom(), and zoom().