Renamed osgGA::MatrixManipualtor to osgGA::CameraManipulator so its name better reflects it's function
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
|
||||
#include <osg/AnimationPath>
|
||||
#include <osg/Notify>
|
||||
#include <osgGA/MatrixManipulator>
|
||||
#include <osgGA/CameraManipulator>
|
||||
|
||||
namespace osgGA{
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace osgGA{
|
||||
// px py pz = World position in cartesian coordinates
|
||||
// ax ay az aw = Orientation (attitude) defined as a quaternion
|
||||
|
||||
class OSGGA_EXPORT AnimationPathManipulator : public MatrixManipulator
|
||||
class OSGGA_EXPORT AnimationPathManipulator : public CameraManipulator
|
||||
{
|
||||
public:
|
||||
|
||||
|
||||
@@ -11,8 +11,8 @@
|
||||
* OpenSceneGraph Public License for more details.
|
||||
*/
|
||||
|
||||
#ifndef OSGGA_MatrixManipulator
|
||||
#define OSGGA_MatrixManipulator 1
|
||||
#ifndef OSGGA_CameraManipulator
|
||||
#define OSGGA_CameraManipulator 1
|
||||
|
||||
#include <osg/Node>
|
||||
#include <osg/Matrixd>
|
||||
@@ -31,12 +31,12 @@ namespace osgGA{
|
||||
|
||||
/**
|
||||
|
||||
MatrixManipulator is an abstract base class defining the interface, and a certain
|
||||
CameraManipulator is an abstract base class defining the interface, and a certain
|
||||
amount of default functionality, for classes which wish to control OSG cameras
|
||||
in response to GUI events.
|
||||
|
||||
*/
|
||||
class OSGGA_EXPORT MatrixManipulator : public GUIEventHandler
|
||||
class OSGGA_EXPORT CameraManipulator : public GUIEventHandler
|
||||
{
|
||||
typedef GUIEventHandler inherited;
|
||||
|
||||
@@ -44,7 +44,7 @@ class OSGGA_EXPORT MatrixManipulator : public GUIEventHandler
|
||||
|
||||
// We are not using META_Object as this is abstract class.
|
||||
// Use META_Object(osgGA,YourManipulator); in your descendant non-abstract classes.
|
||||
virtual const char* className() const { return "MatrixManipulator"; }
|
||||
virtual const char* className() const { return "CameraManipulator"; }
|
||||
|
||||
/** callback class to use to allow matrix manipulators to query the application for the local coordinate frame.*/
|
||||
class CoordinateFrameCallback : public osg::Referenced
|
||||
@@ -164,10 +164,10 @@ class OSGGA_EXPORT MatrixManipulator : public GUIEventHandler
|
||||
|
||||
protected:
|
||||
|
||||
MatrixManipulator();
|
||||
MatrixManipulator(const MatrixManipulator& mm, const osg::CopyOp& copyOp = osg::CopyOp::SHALLOW_COPY);
|
||||
CameraManipulator();
|
||||
CameraManipulator(const CameraManipulator& mm, const osg::CopyOp& copyOp = osg::CopyOp::SHALLOW_COPY);
|
||||
|
||||
virtual ~MatrixManipulator();
|
||||
virtual ~CameraManipulator();
|
||||
|
||||
std::string getManipulatorName() const;
|
||||
|
||||
@@ -14,13 +14,13 @@
|
||||
#ifndef OSGGA_VIEWLISTMANIPULATOR
|
||||
#define OSGGA_VIEWLISTMANIPULATOR 1
|
||||
|
||||
#include <osgGA/MatrixManipulator>
|
||||
#include <osgGA/CameraManipulator>
|
||||
#include <osg/Quat>
|
||||
#include <osg/CameraView>
|
||||
|
||||
namespace osgGA{
|
||||
|
||||
class OSGGA_EXPORT CameraViewSwitchManipulator : public MatrixManipulator
|
||||
class OSGGA_EXPORT CameraViewSwitchManipulator : public CameraManipulator
|
||||
{
|
||||
public:
|
||||
CameraViewSwitchManipulator() {}
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
#ifndef OSGGA_DRIVEMANIPULATOR
|
||||
#define OSGGA_DRIVEMANIPULATOR 1
|
||||
|
||||
#include <osgGA/MatrixManipulator>
|
||||
#include <osgGA/CameraManipulator>
|
||||
#include <osg/Quat>
|
||||
|
||||
namespace osgGA{
|
||||
@@ -26,7 +26,7 @@ mouse button decelerates, and the middle mouse button (or left and
|
||||
right simultaneously) stops dead.
|
||||
*/
|
||||
|
||||
class OSGGA_EXPORT DriveManipulator : public MatrixManipulator
|
||||
class OSGGA_EXPORT DriveManipulator : public CameraManipulator
|
||||
{
|
||||
public:
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
#define OSGUTIL_KEYSWITCMATRIXMANIPULATOR 1
|
||||
|
||||
#include <osgGA/Export>
|
||||
#include <osgGA/MatrixManipulator>
|
||||
#include <osgGA/CameraManipulator>
|
||||
#include <osgGA/GUIEventHandler>
|
||||
|
||||
namespace osgGA{
|
||||
@@ -28,11 +28,11 @@ being used to be switched by pressing a key. E.g. '1' for a TrackballManipultor,
|
||||
'2' for a DriveManipulator, '3' for a FlightManipulator. The manipulators available,
|
||||
and the associated switch keys, can be configured.
|
||||
*/
|
||||
class OSGGA_EXPORT KeySwitchMatrixManipulator : public MatrixManipulator
|
||||
class OSGGA_EXPORT KeySwitchMatrixManipulator : public CameraManipulator
|
||||
{
|
||||
public:
|
||||
|
||||
typedef std::pair<std::string, osg::ref_ptr<MatrixManipulator> > NamedManipulator;
|
||||
typedef std::pair<std::string, osg::ref_ptr<CameraManipulator> > NamedManipulator;
|
||||
typedef std::map<int, NamedManipulator> KeyManipMap;
|
||||
|
||||
virtual const char* className() const { return "KeySwitchMatrixManipulator"; }
|
||||
@@ -41,12 +41,12 @@ class OSGGA_EXPORT KeySwitchMatrixManipulator : public MatrixManipulator
|
||||
Add a camera manipulator with an associated name, and a key to
|
||||
trigger the switch,
|
||||
*/
|
||||
void addMatrixManipulator(int key, std::string name, MatrixManipulator *cm);
|
||||
void addMatrixManipulator(int key, std::string name, CameraManipulator *cm);
|
||||
|
||||
/**
|
||||
Add a camera manipulator with an autogenerated keybinding which is '1' + previous number of camera's registerd.
|
||||
*/
|
||||
void addNumberedMatrixManipulator(MatrixManipulator *cm);
|
||||
void addNumberedMatrixManipulator(CameraManipulator *cm);
|
||||
|
||||
unsigned int getNumMatrixManipulators() const { return _manips.size(); }
|
||||
|
||||
@@ -60,26 +60,26 @@ class OSGGA_EXPORT KeySwitchMatrixManipulator : public MatrixManipulator
|
||||
|
||||
|
||||
/** Get the current active manipulators.*/
|
||||
MatrixManipulator* getCurrentMatrixManipulator() { return _current.get(); }
|
||||
CameraManipulator* getCurrentMatrixManipulator() { return _current.get(); }
|
||||
|
||||
/** Get the const current active manipulators.*/
|
||||
const MatrixManipulator* getCurrentMatrixManipulator() const { return _current.get(); }
|
||||
const CameraManipulator* getCurrentMatrixManipulator() const { return _current.get(); }
|
||||
|
||||
|
||||
/** Get manipulator assigned to a specified index.*/
|
||||
MatrixManipulator* getMatrixManipulatorWithIndex(unsigned int key);
|
||||
CameraManipulator* getMatrixManipulatorWithIndex(unsigned int key);
|
||||
|
||||
/** Get const manipulator assigned to a specified index.*/
|
||||
const MatrixManipulator* getMatrixManipulatorWithIndex(unsigned int key) const;
|
||||
const CameraManipulator* getMatrixManipulatorWithIndex(unsigned int key) const;
|
||||
|
||||
/** Get manipulator assigned to a specified key.*/
|
||||
MatrixManipulator* getMatrixManipulatorWithKey(unsigned int key);
|
||||
CameraManipulator* getMatrixManipulatorWithKey(unsigned int key);
|
||||
|
||||
/** Get const manipulator assigned to a specified key.*/
|
||||
const MatrixManipulator* getMatrixManipulatorWithKey(unsigned int key) const;
|
||||
const CameraManipulator* getMatrixManipulatorWithKey(unsigned int key) const;
|
||||
|
||||
|
||||
// Overrides from MatrixManipulator...
|
||||
// Overrides from CameraManipulator...
|
||||
|
||||
/** set the coordinate frame which callback tells the manipulator which way is up, east and north.*/
|
||||
virtual void setCoordinateFrameCallback(CoordinateFrameCallback* cb);
|
||||
@@ -128,7 +128,7 @@ class OSGGA_EXPORT KeySwitchMatrixManipulator : public MatrixManipulator
|
||||
|
||||
KeyManipMap _manips;
|
||||
|
||||
osg::ref_ptr<MatrixManipulator> _current;
|
||||
osg::ref_ptr<CameraManipulator> _current;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -14,14 +14,14 @@
|
||||
#ifndef __SphericalManipulator_h__
|
||||
#define __SphericalManipulator_h__
|
||||
|
||||
#include <osgGA/MatrixManipulator>
|
||||
#include <osgGA/CameraManipulator>
|
||||
#include <osg/Math>
|
||||
#include <osg/Quat>
|
||||
|
||||
namespace osgGA
|
||||
{
|
||||
|
||||
class OSGGA_EXPORT SphericalManipulator : public MatrixManipulator
|
||||
class OSGGA_EXPORT SphericalManipulator : public CameraManipulator
|
||||
{
|
||||
public:
|
||||
SphericalManipulator();
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
#ifndef OSGGA_CAMERA_MANIPULATOR
|
||||
#define OSGGA_CAMERA_MANIPULATOR 1
|
||||
|
||||
#include <osgGA/MatrixManipulator>
|
||||
#include <osgGA/CameraManipulator>
|
||||
|
||||
|
||||
namespace osgGA {
|
||||
@@ -27,9 +27,9 @@ namespace osgGA {
|
||||
|
||||
/** StandardManipulator class provides basic functionality
|
||||
for user controlled manipulation.*/
|
||||
class OSGGA_EXPORT StandardManipulator : public MatrixManipulator
|
||||
class OSGGA_EXPORT StandardManipulator : public CameraManipulator
|
||||
{
|
||||
typedef MatrixManipulator inherited;
|
||||
typedef CameraManipulator inherited;
|
||||
|
||||
public:
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#include <osgGA/MatrixManipulator>
|
||||
#include <osgGA/CameraManipulator>
|
||||
#include <osg/Node>
|
||||
#include <osg/Matrix>
|
||||
|
||||
@@ -53,7 +53,7 @@ When the Shift key is released, up, down, linear left and/or linear right moveme
|
||||
|
||||
namespace osgGA {
|
||||
|
||||
class OSGGA_EXPORT UFOManipulator : public osgGA::MatrixManipulator
|
||||
class OSGGA_EXPORT UFOManipulator : public osgGA::CameraManipulator
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#include <osgUtil/UpdateVisitor>
|
||||
#include <osgUtil/SceneView>
|
||||
|
||||
#include <osgGA/MatrixManipulator>
|
||||
#include <osgGA/CameraManipulator>
|
||||
#include <osgGA/EventVisitor>
|
||||
#include <osgGA/EventQueue>
|
||||
|
||||
@@ -100,13 +100,13 @@ class OSGVIEWER_EXPORT View : public osg::View, public osgGA::GUIActionAdapter
|
||||
|
||||
/** Set the CameraManipulator that moves the View's master Camera position in response to events.
|
||||
* The parameter resetPosition determines whether manipulator is set to its home position.*/
|
||||
void setCameraManipulator(osgGA::MatrixManipulator* manipulator, bool resetPosition = true);
|
||||
void setCameraManipulator(osgGA::CameraManipulator* manipulator, bool resetPosition = true);
|
||||
|
||||
/** Get the View's CameraManipulator.*/
|
||||
osgGA::MatrixManipulator* getCameraManipulator() { return _cameraManipulator.get(); }
|
||||
osgGA::CameraManipulator* getCameraManipulator() { return _cameraManipulator.get(); }
|
||||
|
||||
/** Get the const View's CameraManipulator.*/
|
||||
const osgGA::MatrixManipulator* getCameraManipulator() const { return _cameraManipulator.get(); }
|
||||
const osgGA::CameraManipulator* getCameraManipulator() const { return _cameraManipulator.get(); }
|
||||
|
||||
/** Set the view to the CameraManipulator's home position, if non is attached home() is does nothing.
|
||||
* Note, to set the home position use getCamaraManipulator()->setHomePosition(...). */
|
||||
@@ -225,7 +225,7 @@ class OSGVIEWER_EXPORT View : public osg::View, public osgGA::GUIActionAdapter
|
||||
|
||||
osg::ref_ptr<osgViewer::Scene> _scene;
|
||||
osg::ref_ptr<osgGA::EventQueue> _eventQueue;
|
||||
osg::ref_ptr<osgGA::MatrixManipulator> _cameraManipulator;
|
||||
osg::ref_ptr<osgGA::CameraManipulator> _cameraManipulator;
|
||||
EventHandlers _eventHandlers;
|
||||
|
||||
osg::ObserverNodePath _coordinateSystemNodePath;
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
#include <osgUtil/UpdateVisitor>
|
||||
#include <osgUtil/IncrementalCompileOperation>
|
||||
|
||||
#include <osgGA/MatrixManipulator>
|
||||
#include <osgGA/EventVisitor>
|
||||
#include <osgGA/EventQueue>
|
||||
|
||||
|
||||
@@ -275,7 +275,7 @@ protected:
|
||||
osg::Timer_t _lastFrameTime;
|
||||
osg::ref_ptr<osg::AnimationPath> _animPath;
|
||||
osg::ref_ptr<osgGA::AnimationPathManipulator> _animPathManipulator;
|
||||
osg::ref_ptr<osgGA::MatrixManipulator> _oldManipulator;
|
||||
osg::ref_ptr<osgGA::CameraManipulator> _oldManipulator;
|
||||
};
|
||||
|
||||
/** Event handler for increase/decreasing LODScale.*/
|
||||
|
||||
Reference in New Issue
Block a user