From 7596b3b361118b165b8c457a70283ae5c68ebd83 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Fri, 30 Apr 2004 09:04:10 +0000 Subject: [PATCH] Added getKeyManipMap() method --- include/osgGA/KeySwitchMatrixManipulator | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/include/osgGA/KeySwitchMatrixManipulator b/include/osgGA/KeySwitchMatrixManipulator index 53db2e7de..21e5cba39 100644 --- a/include/osgGA/KeySwitchMatrixManipulator +++ b/include/osgGA/KeySwitchMatrixManipulator @@ -34,6 +34,9 @@ class OSGGA_EXPORT KeySwitchMatrixManipulator : public MatrixManipulator { public: + typedef std::pair > NamedManipulator; + typedef std::map KeyManipMap; + virtual const char* className() const { return "KeySwitchMatrixManipulator"; } /** @@ -51,23 +54,33 @@ public: void selectMatrixManipulator(unsigned int num); + /** Get the complete list of manipulators attached to this keyswitch manipulator.*/ + KeyManipMap& getKeyManipMap() { return _manips; } + /** Get the const complete list of manipulators attached to this keyswitch manipulator.*/ + const KeyManipMap& getKeyManipMap() const { return _manips; } + + + /** Get the current active manipulators.*/ MatrixManipulator* getCurrentMatrixManipulator() { return _current.get(); } + /** Get the const current active manipulators.*/ const MatrixManipulator* getCurrentMatrixManipulator() const { return _current.get(); } - MatrixManipulator* getMatrixManipulator(unsigned int num); + /** Get manipulator assigned to a specified key.*/ + MatrixManipulator* getMatrixManipulator(unsigned int key); - const MatrixManipulator* getMatrixManipulator(unsigned int num) const; + /** Get const manipulator assigned to a specified key.*/ + const MatrixManipulator* getMatrixManipulator(unsigned int key) const; // Overrides from MatrixManipulator... - /** set the coordinate frame which tells the manipulator which way is up, east and north.*/ + /** Set the coordinate frame which tells the manipulator which way is up, east and north.*/ virtual void setCoordinateFrame(const osg::CoordinateFrame& cf) { _coordinateFrame = cf; _current->setCoordinateFrame(cf); } - /** set the position of the matrix manipulator using a 4x4 Matrix.*/ + /** Set the position of the matrix manipulator using a 4x4 Matrix.*/ virtual void setByMatrix(const osg::Matrixd& matrix) { _current->setByMatrix(matrix); } /** set the position of the matrix manipulator using a 4x4 Matrix.*/ @@ -103,8 +116,6 @@ public: private: - typedef std::pair > NamedManipulator; - typedef std::map KeyManipMap; KeyManipMap _manips; osg::ref_ptr _current;