#pragma once /* -*-c++-*- osgVisual - Copyright (C) 2009-2011 Torben Dannhauer * * This library is based on OpenSceneGraph, open source and may be redistributed and/or modified under * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or * (at your option) any later version. The full license is in LICENSE file * included with this distribution, and on the openscenegraph.org website. * * osgVisual requires for some proprietary modules a license from the correspondig manufacturer. * You have to aquire licenses for all used proprietary modules. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * OpenSceneGraph Public License for more details. */ #include #include #include namespace osgGA { /** * \brief This class is a placebo manipulator, which doexs nothing. Its purpose is to allow the mixed setup of manipulators together with plain setting of cameras view and projection matrix. * * @author Torben Dannhauer * @date Jul 2012 */ class PlaceboManipulator : public CameraManipulator { public: /** * \brief Constructor * */ PlaceboManipulator(); /** * \brief This function returns the classname. * * @return Classname of this manipulator. */ virtual const char* className() const { return "PlaceboManipulator"; } /** * \brief Set the position of the matrix manipulator using a 4x4 Matrix. * * @param matrix : Matrix to set. */ virtual void setByMatrix(const osg::Matrixd& matrix); /** * \brief Set the position of the matrix manipulator using a 4x4 Matrix. * * @param matrix : Inverse Matrix to set. */ virtual void setByInverseMatrix(const osg::Matrixd& matrix) { setByMatrix(osg::Matrixd::inverse(matrix)); } /** get the position of the manipulator as 4x4 Matrix.*/ virtual osg::Matrixd getMatrix() const; /** get the position of the manipulator as a inverse matrix of the manipulator, typically used as a model view matrix.*/ virtual osg::Matrixd getInverseMatrix() const; /** * \brief Start/restart the manipulator. * * No further implementation * * @param ea : GUI eventadapter to use for initialization. * @param us : GUI actionadapter to use for initialization. */ virtual void init(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us); /** handle events, return true if handled, false otherwise.*/ virtual bool handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionAdapter& aa, osg::Object*, osg::NodeVisitor* nv); /** Get the keyboard and mouse usage of this manipulator.*/ virtual void getUsage(osg::ApplicationUsage& usage) const; protected: /** * \brief Destructor. Because it is protected, no explicit delete myPointer by external caller is possible. * This forces the class to be used with osg::ref pointers. */ virtual ~PlaceboManipulator(); osg::Matrixd modelViewMatrix; }; } // END NAMESPACE