25 #ifndef WGEZOOMTRACKBALLMANIPULATOR_H
26 #define WGEZOOMTRACKBALLMANIPULATOR_H
28 #include <osgGA/TrackballManipulator>
30 #include "WGEZoomTrackballNodeVisitor.h"
48 virtual void setByMatrix(
const osg::Matrixd& matrix );
77 virtual void home(
double currentTime );
86 virtual bool handle(
const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us );
114 void setThrow(
bool allowThrow =
true );
145 bool zoom(
const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us );
New OSG manipulator: TrackballManipulator with added mouse wheel zoom.
bool getThrow() const
Checks whether throwing is active.
double m_zoom
Zoom factor.
void setThrow(bool allowThrow=true)
En-/Disables throwing.
virtual bool performMovementMiddleMouseButton(const double eventTimeDelta, const double dx, const double dy)
Performs the middle mouse button click.
void setZoom(double zoom)
Set zoom factor.
virtual void computeHomePosition(const osg::Camera *camera, bool useBoundingBox)
Computes the home position.
void fitToScreen(const osg::Camera *camera)
Zooms and centers to fit screen.
bool zoom(const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &us)
Handles events related to zooming.
bool m_allowThrow
Do we want the auto-rotation thingy?
virtual osg::Matrixd getInverseMatrix() const
Get the position of the manipulator as a inverse matrix of the manipulator, typically used as a model...
WGEZoomTrackballManipulator()
Default constructor.
double m_radius
The radius of the bounding sphere.
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.
double getZoom() const
Get zoom factor.
int m_paintMode
paint mode
virtual void home(double currentTime)
Move the camera to the default position.
virtual osg::Matrixd getMatrixWithoutZoom() const
Get the manipulator only containing rotation and translation.
virtual bool handle(const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &us)
Handle events, return true if handled, false otherwise.
void setPaintMode(int mode)
setter for paint mode when set to something different from 0, a left drag should move the scene