25 #ifndef WGE2DMANIPULATOR_H
26 #define WGE2DMANIPULATOR_H
28 #include <osg/Version>
32 #if( ( OPENSCENEGRAPH_MAJOR_VERSION > 2 ) || ( OPENSCENEGRAPH_MAJOR_VERSION == 2 && ( OPENSCENEGRAPH_MINOR_VERSION > 9 || \
33 ( OPENSCENEGRAPH_MINOR_VERSION == 9 && OPENSCENEGRAPH_PATCH_VERSION >= 8 ) ) ) )
34 #include <osgGA/CameraManipulator>
37 typedef CameraManipulator MatrixManipulator;
40 #include <osgGA/MatrixManipulator>
69 virtual void setByMatrix(
const osg::Matrixd& matrix );
98 virtual void home(
const osgGA::GUIEventAdapter& , osgGA::GUIActionAdapter& us );
105 virtual void init(
const osgGA::GUIEventAdapter& , osgGA::GUIActionAdapter& us );
114 virtual bool handle(
const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us );
121 virtual void getUsage( osg::ApplicationUsage& usage )
const;
155 osg::ref_ptr< const osgGA::GUIEventAdapter >
m_ga_t1;
160 osg::ref_ptr< const osgGA::GUIEventAdapter >
m_ga_t0;
170 bool zoom(
const osgGA::GUIEventAdapter& ea );
A manipulator which changes the view of a 2D scene.
bool calcMovement()
Calculate the movement of the camera for the given mouse movement.
virtual const char * className() const
Return the name of the object's class type.
bool zoom(const osgGA::GUIEventAdapter &ea)
Handles events related to zooming.
void flushMouseEventStack()
Reset the internal GUIEvent stack.
osg::ref_ptr< const osgGA::GUIEventAdapter > m_ga_t0
The newer event from the internal event stack.
virtual void setByInverseMatrix(const osg::Matrixd &matrix)
Set the position of the matrix manipulator using a 4x4 matrix.
virtual void getUsage(osg::ApplicationUsage &usage) const
Get the keyboard and mouse usage of this manipulator.
void addMouseEvent(const osgGA::GUIEventAdapter &ea)
Add the current mouse GUIEvent to the internal stack.
virtual void home(const osgGA::GUIEventAdapter &, osgGA::GUIActionAdapter &us)
Move the camera to the default position.
virtual osg::Matrixd getMatrix() const
Get the position of the manipulator as 4x4 matrix.
WGE2DManipulator()
Constructor.
double m_positionX
The x-position of the viewing window's lower left corner.
virtual void setByMatrix(const osg::Matrixd &matrix)
Set the position of the matrix manipulator using a 4x4 matrix.
virtual ~WGE2DManipulator()
Destructor.
virtual osg::Matrixd getInverseMatrix() const
Get the position of the manipulator as a inverse matrix of the manipulator, typically used as a model...
osg::ref_ptr< const osgGA::GUIEventAdapter > m_ga_t1
The older event from the internal event stack.
virtual void init(const osgGA::GUIEventAdapter &, osgGA::GUIActionAdapter &us)
Start/restart the manipulator.
virtual bool handle(const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &us)
Handle events.
double m_positionY
The y-position of the viewing window's lower left corner.