1
//---------------------------------------------------------------------------
3
// Project: OpenWalnut ( http://www.openwalnut.org )
5
// Copyright 2009 OpenWalnut Community, BSV@Uni-Leipzig and CNCF@MPI-CBS
6
// For more information see http://www.openwalnut.org/copying
8
// This file is part of OpenWalnut.
10
// OpenWalnut is free software: you can redistribute it and/or modify
11
// it under the terms of the GNU Lesser General Public License as published by
12
// the Free Software Foundation, either version 3 of the License, or
13
// (at your option) any later version.
15
// OpenWalnut is distributed in the hope that it will be useful,
16
// but WITHOUT ANY WARRANTY; without even the implied warranty of
17
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
// GNU Lesser General Public License for more details.
20
// You should have received a copy of the GNU Lesser General Public License
21
// along with OpenWalnut. If not, see <http://www.gnu.org/licenses/>.
23
//---------------------------------------------------------------------------
25
#ifndef WGENOOPMANIPULATOR_H
26
#define WGENOOPMANIPULATOR_H
28
#include <osg/Version>
30
// OSG interface changed in 2.9.7, to make it compile also with those versions we do this:
31
// OSG_MIN_VERSION_REQUIRED(2, 9, 8) macro is not available in e.g. OSG 2.8.1, hence we use the old way
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>
44
* This is an OSG Manipulator implementation which does nothing. It is very useful for simple two-d views.
46
class WGENoOpManipulator: public osgGA::MatrixManipulator
51
* Convenience typedef for a boost::shared_ptr< WGENoOpManipulator >.
53
typedef osg::ref_ptr< WGENoOpManipulator > SPtr;
56
* Convenience typedef for a boost::shared_ptr< const WGENoOpManipulator >.
58
typedef osg::ref_ptr< const WGENoOpManipulator > ConstSPtr;
61
* Default constructor.
68
virtual ~WGENoOpManipulator();
71
* Return the name of the object's class type.
73
* \return the name of the object's class type
75
virtual const char* className() const;
79
* Set the position of the matrix manipulator using a 4x4 matrix.
81
* \param matrix a 4x4 matrix
83
virtual void setByMatrix( const osg::Matrixd& matrix );
86
* Set the position of the matrix manipulator using a 4x4 matrix.
88
* \param matrix a 4x4 matrix
90
virtual void setByInverseMatrix( const osg::Matrixd& matrix );
93
* Get the position of the manipulator as 4x4 matrix.
95
* \return the position of the manipulator as 4x4 matrix
97
virtual osg::Matrixd getMatrix() const;
100
* Get the position of the manipulator as a inverse matrix of the
101
* manipulator, typically used as a model view matrix.
103
* \return the position of the manipulator as a inverse matrix
105
virtual osg::Matrixd getInverseMatrix() const;
108
* Move the camera to the default position.
110
* \param us the action adapter used to request actions of the GUI
112
virtual void home( const osgGA::GUIEventAdapter& /*ea*/, osgGA::GUIActionAdapter& us ); // NOLINT We can not change the interface of OSG
115
* Start/restart the manipulator.
117
* \param us the action adapter used to request actions of the GUI
119
virtual void init( const osgGA::GUIEventAdapter& /*ea*/, osgGA::GUIActionAdapter& us ); // NOLINT We can not change the interface of OSG
124
* \param ea event class for storing keyboard, mouse and window events
125
* \param us the action adapter used to request actions of the GUI
126
* \return true if handled, false otherwise
128
virtual bool handle( const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us );
135
#endif // WGENOOPMANIPULATOR_H