openscenegraph
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes
osgGA::SphericalManipulator Class Reference
Inheritance diagram for osgGA::SphericalManipulator:
osgGA::CameraManipulator osgGA::GUIEventHandler osg::NodeCallback osg::Drawable::EventCallback osg::Object osg::Object osg::Referenced osg::Referenced

List of all members.

Public Types

enum  RotationMode { ELEVATION_HEADING = 0, HEADING, ELEVATION, MAP }

Public Member Functions

 SphericalManipulator ()
virtual const char * className () const
virtual void setByMatrix (const osg::Matrixd &matrix)
virtual void setByInverseMatrix (const osg::Matrixd &matrix)
virtual osg::Matrixd getMatrix () const
virtual osg::Matrixd getInverseMatrix () const
virtual
osgUtil::SceneView::FusionDistanceMode 
getFusionDistanceMode () const
virtual float getFusionDistanceValue () const
virtual void setNode (osg::Node *)
virtual const osg::NodegetNode () const
virtual osg::NodegetNode ()
virtual void home (const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &us)
virtual void home (double)
virtual void init (const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &us)
void zoomOn (const osg::BoundingSphere &bound)
virtual bool handle (const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &us)
virtual void computeHomePosition ()
void computeViewPosition (const osg::BoundingSphere &bound, double &scale, double &distance, osg::Vec3d &center)
void setCenter (const osg::Vec3d &center)
const osg::Vec3dgetCenter () const
bool setDistance (double distance)
double getDistance () const
double getHomeDistance () const
void setHeading (double azimuth)
double getHeading () const
void setElevation (double elevation)
double getElevtion () const
double getMinimumZoomScale () const
void setMinimumZoomScale (double minimumZoomScale)
void setScroolWheelZoomDelta (double zoomDelta)
double getScroolWheelZoomDelta () const
virtual void getUsage (osg::ApplicationUsage &usage) const
RotationMode getRotationMode () const
void setRotationMode (RotationMode mode)
bool getAllowThrow () const
void setAllowThrow (bool allowThrow)

Protected Member Functions

virtual ~SphericalManipulator ()
void flushMouseEventStack ()
void addMouseEvent (const osgGA::GUIEventAdapter &ea)
bool calcMovement ()
bool isMouseMoving ()

Protected Attributes

osg::ref_ptr< const
osgGA::GUIEventAdapter
_ga_t1
osg::ref_ptr< const
osgGA::GUIEventAdapter
_ga_t0
osg::observer_ptr< osg::Node_node
double _modelScale
double _minimumZoomScale
bool _thrown
bool _allowThrow
double _delta_frame_time
double _last_frame_time
RotationMode _rotationMode
osg::Vec3d _center
double _distance
double _heading
double _elevation
double _homeDistance
double _zoomDelta

Member Enumeration Documentation

Enumerator:
ELEVATION_HEADING 
HEADING 
ELEVATION 
MAP 

Constructor & Destructor Documentation

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

Member Function Documentation

Add the current mouse GUIEvent to internal stack.

For the give mouse movement calculate the movement of the camera. Return true is camera has moved and a redraw is required.

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

return the name of the object's class type. Must be defined by derived classes.

Reimplemented from osgGA::CameraManipulator.

Compute the home position.

void osgGA::SphericalManipulator::computeViewPosition ( const osg::BoundingSphere bound,
double &  scale,
double &  distance,
osg::Vec3d center 
)

Reset the internal GUIEvent stack.

Returns true if the camera can be thrown, false otherwise. This defaults to true.

double osgGA::SphericalManipulator::getDistance ( ) const [inline]
double osgGA::SphericalManipulator::getElevtion ( ) const [inline]

Get the FusionDistanceMode. Used by SceneView for setting up stereo convergence.

Reimplemented from osgGA::CameraManipulator.

References osgUtil::SceneView::USE_FUSION_DISTANCE_VALUE.

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

Get the FusionDistanceValue. Used by SceneView for setting up stereo convergence.

Reimplemented from osgGA::CameraManipulator.

double osgGA::SphericalManipulator::getHeading ( ) const [inline]

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

Implements osgGA::CameraManipulator.

get the position of the manipulator as 4x4 Matrix.

Implements osgGA::CameraManipulator.

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

virtual const osg::Node* osgGA::SphericalManipulator::getNode ( ) const [virtual]

Return node if attached.

Reimplemented from osgGA::CameraManipulator.

Return node if attached.

Reimplemented from osgGA::CameraManipulator.

get the mouse scroll wheel zoom delta.

virtual void osgGA::SphericalManipulator::getUsage ( osg::ApplicationUsage usage) const [virtual]

Get the keyboard and mouse usage of this manipulator.

Reimplemented from osgGA::GUIEventHandler.

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

handle events, return true if handled, false otherwise.

Reimplemented from osgGA::CameraManipulator.

virtual void osgGA::SphericalManipulator::home ( const osgGA::GUIEventAdapter ea,
osgGA::GUIActionAdapter us 
) [virtual]

Move the camera to the default position. May be ignored by manipulators if home functionality is not appropriate.

Reimplemented from osgGA::CameraManipulator.

virtual void osgGA::SphericalManipulator::home ( double  ) [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 from osgGA::CameraManipulator.

virtual void osgGA::SphericalManipulator::init ( const osgGA::GUIEventAdapter ea,
osgGA::GUIActionAdapter us 
) [virtual]

Start/restart the manipulator.

Reimplemented from osgGA::CameraManipulator.

Check the speed at which the mouse is moving. If speed is below a threshold then return false, otherwise return true.

void osgGA::SphericalManipulator::setAllowThrow ( bool  allowThrow) [inline]

Set the 'allow throw' flag. Releasing the mouse button while moving the camera results in a throw.

virtual void osgGA::SphericalManipulator::setByInverseMatrix ( const osg::Matrixd matrix) [inline, virtual]

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

Implements osgGA::CameraManipulator.

References osg::Matrixd::inverse().

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

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

Implements osgGA::CameraManipulator.

void osgGA::SphericalManipulator::setCenter ( const osg::Vec3d center) [inline]
bool osgGA::SphericalManipulator::setDistance ( double  distance)
void osgGA::SphericalManipulator::setElevation ( double  elevation) [inline]
void osgGA::SphericalManipulator::setHeading ( double  azimuth) [inline]
void osgGA::SphericalManipulator::setMinimumZoomScale ( double  minimumZoomScale) [inline]

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

virtual void osgGA::SphericalManipulator::setNode ( osg::Node ) [virtual]

Attach a node to the manipulator. Automatically detaches previously attached node. setNode(NULL) detaches previously nodes. Is ignored by manipulators which do not require a reference model.

Reimplemented from osgGA::CameraManipulator.

void osgGA::SphericalManipulator::setScroolWheelZoomDelta ( double  zoomDelta) [inline]

set the mouse scroll wheel zoom delta. Range -1.0 to +1.0, -ve value inverts wheel direction and zero switches off scroll wheel.


Member Data Documentation

The approximate amount of time it is currently taking to draw a frame. This is used to compute the delta in translation/rotation during a thrown display update. It allows us to match an delta in position/rotation independent of the rendering frame rate.

The time the last frame started. Used when _rate_sensitive is true so that we can match display update rate to rotation/translation rate.


The documentation for this class was generated from the following file: