/*****************************************************************************
 * $LastChangedDate: 2010-07-08 00:07:37 -0400 (Thu, 08 Jul 2010) $
 * @file
 * @author  Jim E. Brooks  http://www.palomino3d.org
 * @brief   Base class for manipulator (OSG specific).
 *//*
 * LEGAL:   COPYRIGHT (C) 2009 JIM E. BROOKS
 *          THIS SOURCE CODE IS RELEASED UNDER THE TERMS
 *          OF THE GNU GENERAL PUBLIC LICENSE VERSION 2 (GPL 2).
 *****************************************************************************/

#ifndef VIEW_MANIPULATOR_HH
#define VIEW_MANIPULATOR_HH 1

#include <osg/Version>
#if OPENSCENEGRAPH_MAJOR_VERSION*100 + OPENSCENEGRAPH_MINOR_VERSION*10 + OPENSCENEGRAPH_PATCH_VERSION >= 298
#   include <osgGA/CameraManipulator>
#   define MatrixManipulator CameraManipulator
#else
#   include <osgGA/MatrixManipulator>
#endif
#include <osgGA/GUIEventAdapter>
#include <osgGA/GUIActionAdapter>

namespace view {

////////////////////////////////////////////////////////////////////////////////
/// @brief Base class for manipulator (OSG specific).
///
/// A ManipulatorViewpoint can be composed with a Manipulator object.
///
class Manipulator : public osgGA::MatrixManipulator
{
protected:  // don't directly instantiate
                            Manipulator( void ) { }
    virtual                 ~Manipulator() { }

public:
// OSG-specific:
    virtual void            home( double currentTime ) { }
    virtual void            home( const osgGA::GUIEventAdapter& event, osgGA::GUIActionAdapter& action ) { }
    virtual bool            handle( const osgGA::GUIEventAdapter& event, osgGA::GUIActionAdapter& action ) { return false; }
    virtual void            setByMatrix( const osg::Matrixd& matrix ) = 0;
    virtual osg::Matrixd    getMatrix( void ) const = 0 /*suppress checks.sh*/ ;
    virtual void            setByInverseMatrix( const osg::Matrixd& matrix ) = 0;
    virtual osg::Matrixd    getInverseMatrix( void ) const = 0 /*suppress checks.sh*/;
};

} // namespace view

#endif // VIEW_MANIPULATOR_HH
