Added getKeyManipMap() method

This commit is contained in:
Robert Osfield 2004-04-30 09:04:10 +00:00
parent 97bf993e5d
commit 7596b3b361

View File

@ -34,6 +34,9 @@ class OSGGA_EXPORT KeySwitchMatrixManipulator : public MatrixManipulator
{
public:
typedef std::pair<std::string, osg::ref_ptr<MatrixManipulator> > NamedManipulator;
typedef std::map<int, NamedManipulator> 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<std::string, osg::ref_ptr<MatrixManipulator> > NamedManipulator;
typedef std::map<int, NamedManipulator> KeyManipMap;
KeyManipMap _manips;
osg::ref_ptr<MatrixManipulator> _current;