osgGA::MatrixManipulator Class Reference

MatrixManipulator 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. More...

Inheritance diagram for osgGA::MatrixManipulator:

Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual const char * className () const
 return the name of the object's class type.
virtual void setMinimumDistance (float minimumDistance)
 set the minimum distance (as ratio) the eye point can be zoomed in towards the center before the center is pushed forward.
float getMinimumDistance () const
 get the minimum distance (as ratio) the eye point can be zoomed in
virtual void setCoordinateFrameCallback (CoordinateFrameCallback *cb)
 set the coordinate frame which callback tells the manipulator which way is up, east and north.
CoordinateFrameCallbackgetCoordinateFrameCallback ()
 get the coordinate frame callback which tells the manipulator which way is up, east and north.
const
CoordinateFrameCallback
getCoordinateFrameCallback () const
 get the coordinate frame callback which tells the manipulator which way is up, east and north.
osg::CoordinateFrame getCoordinateFrame (const osg::Vec3d &position) const
 get the coordinate frame.
osg::Vec3d getSideVector (const osg::CoordinateFrame &cf) const
osg::Vec3d getFrontVector (const osg::CoordinateFrame &cf) const
osg::Vec3d getUpVector (const osg::CoordinateFrame &cf) const
virtual void setByMatrix (const osg::Matrixd &matrix)=0
 set the position of the matrix manipulator using a 4x4 Matrix.
virtual void setByInverseMatrix (const osg::Matrixd &matrix)=0
 set the position of the matrix manipulator using a 4x4 Matrix.
virtual osg::Matrixd getMatrix () const =0
 get the position of the manipulator as 4x4 Matrix.
virtual osg::Matrixd getInverseMatrix () const =0
 get the position of the manipulator as a inverse matrix of the manipulator, typically used as a model view matrix.
virtual
osgUtil::SceneView::FusionDistanceMode 
getFusionDistanceMode () const
 Get the FusionDistanceMode.
virtual float getFusionDistanceValue () const
 Get the FusionDistanceValue.
void setIntersectTraversalMask (unsigned int mask)
 Set the mask to use when set up intersection traversal such as used in manipulators that follow terrain or have collision detection.
unsigned int getIntersectTraversalMask () const
 Get the mask to use when set up intersection traversal such as used in manipulators that follow terrain or have collision detection.
virtual void setNode (osg::Node *)
 Attach a node to the manipulator, automatically detaching any previously attached node.
virtual const osg::NodegetNode () const
 Return const node if attached.
virtual osg::NodegetNode ()
 Return node if attached.
virtual void setHomePosition (const osg::Vec3d &eye, const osg::Vec3d &center, const osg::Vec3d &up, bool autoComputeHomePosition=false)
 Manually set the home position, and set the automatic compute of home position.
virtual void getHomePosition (osg::Vec3d &eye, osg::Vec3d &center, osg::Vec3d &up) const
 Get the mnaully set home position.
virtual void setAutoComputeHomePosition (bool flag)
 Set whether the automatic compute of the home position is enabled.
bool getAutoComputeHomePosition () const
 Get whether the automatic compute of the home position is enabled.
virtual void computeHomePosition ()
 Compute the home position.
virtual void home (const GUIEventAdapter &, GUIActionAdapter &)
 Move the camera to the default position.
virtual void home (double)
 Move the camera to the default position.
virtual void init (const GUIEventAdapter &, GUIActionAdapter &)
 Start/restart the manipulator.
virtual bool handle (const GUIEventAdapter &ea, GUIActionAdapter &us)
 Handle events, return true if handled, false otherwise.

Protected Member Functions

 MatrixManipulator ()
virtual ~MatrixManipulator ()

Protected Attributes

double _minimumDistance
unsigned int _intersectTraversalMask
bool _autoComputeHomePosition
osg::Vec3d _homeEye
osg::Vec3d _homeCenter
osg::Vec3d _homeUp
osg::ref_ptr
< CoordinateFrameCallback
_coordinateFrameCallback

Classes

class  CoordinateFrameCallback
 callback class to use to allow matrix manipulators to querry the application for the local coordinate frame. More...


Detailed Description

MatrixManipulator 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.

Constructor & Destructor Documentation

osgGA::MatrixManipulator::MatrixManipulator (  )  [protected]

virtual osgGA::MatrixManipulator::~MatrixManipulator (  )  [protected, virtual]


Member Function Documentation

virtual const char* osgGA::MatrixManipulator::className (  )  const [inline, virtual]

return the name of the object's class type.

Must be defined by derived classes.

Implements osg::Object.

Reimplemented in osgGA::AnimationPathManipulator, osgGA::DriveManipulator, osgGA::FlightManipulator, osgGA::KeySwitchMatrixManipulator, osgGA::NodeTrackerManipulator, osgGA::TerrainManipulator, osgGA::TrackballManipulator, and osgGA::UFOManipulator.

virtual void osgGA::MatrixManipulator::setMinimumDistance ( float  minimumDistance  )  [inline, virtual]

set the minimum distance (as ratio) the eye point can be zoomed in towards the center before the center is pushed forward.

Reimplemented in osgGA::KeySwitchMatrixManipulator.

float osgGA::MatrixManipulator::getMinimumDistance (  )  const [inline]

get the minimum distance (as ratio) the eye point can be zoomed in

virtual void osgGA::MatrixManipulator::setCoordinateFrameCallback ( CoordinateFrameCallback cb  )  [inline, virtual]

set the coordinate frame which callback tells the manipulator which way is up, east and north.

CoordinateFrameCallback* osgGA::MatrixManipulator::getCoordinateFrameCallback (  )  [inline]

get the coordinate frame callback which tells the manipulator which way is up, east and north.

const CoordinateFrameCallback* osgGA::MatrixManipulator::getCoordinateFrameCallback (  )  const [inline]

get the coordinate frame callback which tells the manipulator which way is up, east and north.

osg::CoordinateFrame osgGA::MatrixManipulator::getCoordinateFrame ( const osg::Vec3d position  )  const [inline]

get the coordinate frame.

osg::Vec3d osgGA::MatrixManipulator::getSideVector ( const osg::CoordinateFrame cf  )  const [inline]

osg::Vec3d osgGA::MatrixManipulator::getFrontVector ( const osg::CoordinateFrame cf  )  const [inline]

osg::Vec3d osgGA::MatrixManipulator::getUpVector ( const osg::CoordinateFrame cf  )  const [inline]

virtual void osgGA::MatrixManipulator::setByMatrix ( const osg::Matrixd matrix  )  [pure virtual]

set the position of the matrix manipulator using a 4x4 Matrix.

Implemented in osgGA::AnimationPathManipulator, osgGA::DriveManipulator, osgGA::FlightManipulator, osgGA::KeySwitchMatrixManipulator, osgGA::NodeTrackerManipulator, osgGA::TerrainManipulator, osgGA::TrackballManipulator, and osgGA::UFOManipulator.

virtual void osgGA::MatrixManipulator::setByInverseMatrix ( const osg::Matrixd matrix  )  [pure virtual]

set the position of the matrix manipulator using a 4x4 Matrix.

Implemented in osgGA::AnimationPathManipulator, osgGA::DriveManipulator, osgGA::FlightManipulator, osgGA::KeySwitchMatrixManipulator, osgGA::NodeTrackerManipulator, osgGA::TerrainManipulator, osgGA::TrackballManipulator, and osgGA::UFOManipulator.

virtual osg::Matrixd osgGA::MatrixManipulator::getMatrix (  )  const [pure virtual]

get the position of the manipulator as 4x4 Matrix.

Implemented in osgGA::AnimationPathManipulator, osgGA::DriveManipulator, osgGA::FlightManipulator, osgGA::KeySwitchMatrixManipulator, osgGA::NodeTrackerManipulator, osgGA::TerrainManipulator, osgGA::TrackballManipulator, and osgGA::UFOManipulator.

virtual osg::Matrixd osgGA::MatrixManipulator::getInverseMatrix (  )  const [pure virtual]

get the position of the manipulator as a inverse matrix of the manipulator, typically used as a model view matrix.

Implemented in osgGA::AnimationPathManipulator, osgGA::DriveManipulator, osgGA::FlightManipulator, osgGA::KeySwitchMatrixManipulator, osgGA::NodeTrackerManipulator, osgGA::TerrainManipulator, osgGA::TrackballManipulator, and osgGA::UFOManipulator.

virtual osgUtil::SceneView::FusionDistanceMode osgGA::MatrixManipulator::getFusionDistanceMode (  )  const [inline, virtual]

Get the FusionDistanceMode.

Used by SceneView for setting up setereo convergence.

Reimplemented in osgGA::KeySwitchMatrixManipulator, osgGA::NodeTrackerManipulator, osgGA::TerrainManipulator, and osgGA::TrackballManipulator.

virtual float osgGA::MatrixManipulator::getFusionDistanceValue (  )  const [inline, virtual]

Get the FusionDistanceValue.

Used by SceneView for setting up setereo convergence.

Reimplemented in osgGA::KeySwitchMatrixManipulator, osgGA::NodeTrackerManipulator, osgGA::TerrainManipulator, and osgGA::TrackballManipulator.

void osgGA::MatrixManipulator::setIntersectTraversalMask ( unsigned int  mask  )  [inline]

Set the mask to use when set up intersection traversal such as used in manipulators that follow terrain or have collision detection.

The intersection traversal mask is useful for controlling what parts of the scene graph should be used for intersection purposes.

unsigned int osgGA::MatrixManipulator::getIntersectTraversalMask (  )  const [inline]

Get the mask to use when set up intersection traversal such as used in manipulators that follow terrain or have collision detection.

virtual void osgGA::MatrixManipulator::setNode ( osg::Node  )  [inline, virtual]

Attach a node to the manipulator, automatically detaching any previously attached node.

setNode(NULL) detaches previous nodes. May be ignored by manipulators which do not require a reference model.

Reimplemented in osgGA::DriveManipulator, osgGA::FlightManipulator, osgGA::KeySwitchMatrixManipulator, osgGA::NodeTrackerManipulator, osgGA::TerrainManipulator, osgGA::TrackballManipulator, and osgGA::UFOManipulator.

virtual const osg::Node* osgGA::MatrixManipulator::getNode (  )  const [inline, virtual]

Return const node if attached.

Reimplemented in osgGA::DriveManipulator, osgGA::FlightManipulator, osgGA::KeySwitchMatrixManipulator, osgGA::NodeTrackerManipulator, osgGA::TerrainManipulator, osgGA::TrackballManipulator, and osgGA::UFOManipulator.

virtual osg::Node* osgGA::MatrixManipulator::getNode (  )  [inline, virtual]

Return node if attached.

Reimplemented in osgGA::DriveManipulator, osgGA::FlightManipulator, osgGA::KeySwitchMatrixManipulator, osgGA::NodeTrackerManipulator, osgGA::TerrainManipulator, osgGA::TrackballManipulator, and osgGA::UFOManipulator.

virtual void osgGA::MatrixManipulator::setHomePosition ( const osg::Vec3d eye,
const osg::Vec3d center,
const osg::Vec3d up,
bool  autoComputeHomePosition = false 
) [inline, virtual]

Manually set the home position, and set the automatic compute of home position.

Reimplemented in osgGA::KeySwitchMatrixManipulator.

virtual void osgGA::MatrixManipulator::getHomePosition ( osg::Vec3d eye,
osg::Vec3d center,
osg::Vec3d up 
) const [inline, virtual]

Get the mnaully set home position.

virtual void osgGA::MatrixManipulator::setAutoComputeHomePosition ( bool  flag  )  [inline, virtual]

Set whether the automatic compute of the home position is enabled.

Reimplemented in osgGA::KeySwitchMatrixManipulator.

bool osgGA::MatrixManipulator::getAutoComputeHomePosition (  )  const [inline]

Get whether the automatic compute of the home position is enabled.

virtual void osgGA::MatrixManipulator::computeHomePosition (  )  [inline, virtual]

Compute the home position.

Reimplemented in osgGA::DriveManipulator, osgGA::KeySwitchMatrixManipulator, osgGA::NodeTrackerManipulator, and osgGA::UFOManipulator.

virtual void osgGA::MatrixManipulator::home ( const GUIEventAdapter ,
GUIActionAdapter  
) [inline, virtual]

Move the camera to the default position.

May be ignored by manipulators if home functionality is not appropriate.

Reimplemented in osgGA::AnimationPathManipulator, osgGA::DriveManipulator, osgGA::FlightManipulator, osgGA::KeySwitchMatrixManipulator, osgGA::NodeTrackerManipulator, osgGA::TerrainManipulator, osgGA::TrackballManipulator, and osgGA::UFOManipulator.

virtual void osgGA::MatrixManipulator::home ( double   )  [inline, virtual]

Move the camera to the default position.

This version does not require GUIEventAdapter and GUIActionAdapter so may be called from somewhere other than a handle() method in GUIEventHandler. Application must be aware of implications.

Reimplemented in osgGA::AnimationPathManipulator, osgGA::TrackballManipulator, and osgGA::UFOManipulator.

virtual void osgGA::MatrixManipulator::init ( const GUIEventAdapter ,
GUIActionAdapter  
) [inline, virtual]

Start/restart the manipulator.

FIXME: what does this actually mean? Provide examples.

Reimplemented in osgGA::AnimationPathManipulator, osgGA::DriveManipulator, osgGA::FlightManipulator, osgGA::KeySwitchMatrixManipulator, osgGA::NodeTrackerManipulator, osgGA::TerrainManipulator, osgGA::TrackballManipulator, and osgGA::UFOManipulator.

virtual bool osgGA::MatrixManipulator::handle ( const GUIEventAdapter ea,
GUIActionAdapter us 
) [virtual]

Handle events, return true if handled, false otherwise.

Reimplemented from osgGA::GUIEventHandler.

Reimplemented in osgGA::AnimationPathManipulator, osgGA::DriveManipulator, osgGA::FlightManipulator, osgGA::KeySwitchMatrixManipulator, osgGA::NodeTrackerManipulator, osgGA::TerrainManipulator, osgGA::TrackballManipulator, and osgGA::UFOManipulator.


Member Data Documentation

double osgGA::MatrixManipulator::_minimumDistance [protected]

unsigned int osgGA::MatrixManipulator::_intersectTraversalMask [protected]

bool osgGA::MatrixManipulator::_autoComputeHomePosition [protected]

osg::Vec3d osgGA::MatrixManipulator::_homeEye [protected]

osg::Vec3d osgGA::MatrixManipulator::_homeCenter [protected]

osg::Vec3d osgGA::MatrixManipulator::_homeUp [protected]

osg::ref_ptr<CoordinateFrameCallback> osgGA::MatrixManipulator::_coordinateFrameCallback [protected]


The documentation for this class was generated from the following file:
Generated at Sun Oct 14 02:12:22 2007 for the OpenSceneGraph by doxygen 1.5.3.