AnimatLab  2
Test
OsgAnimatSim::Visualization::OsgTrackballManipulator Class Reference
+ Inheritance diagram for OsgAnimatSim::Visualization::OsgTrackballManipulator:
+ Collaboration diagram for OsgAnimatSim::Visualization::OsgTrackballManipulator:

Public Member Functions

virtual const char * className () const
 
const osg::Vec3d & getCenter () const
 
double getDistance () const
 
virtual osgUtil::SceneView::FusionDistanceMode getFusionDistanceMode () const
 
virtual float getFusionDistanceValue () const
 
virtual osg::Matrixd getInverseMatrix () const
 
virtual osg::Matrixd getMatrix () const
 
double getMinimumZoomScale () const
 
virtual const osg::Node * getNode () const
 
virtual osg::Node * getNode ()
 
const osg::Quat & getRotation () const
 
float getTrackballSize () const
 
virtual void getUsage (osg::ApplicationUsage &usage) const
 
virtual bool handle (const GUIEventAdapter &ea, GUIActionAdapter &us)
 
virtual void home (const GUIEventAdapter &ea, GUIActionAdapter &us)
 
virtual void home (double)
 
virtual void init (const GUIEventAdapter &ea, GUIActionAdapter &us)
 
virtual void setByInverseMatrix (const osg::Matrixd &matrix)
 
virtual void setByMatrix (const osg::Matrixd &matrix)
 
void setCenter (const osg::Vec3d &center)
 
void setDistance (double distance)
 
void setMinimumZoomScale (double minimumZoomScale)
 
virtual void setNode (osg::Node *)
 
void setRotation (const osg::Quat &rotation)
 
void setTrackballSize (float size)
 

Protected Member Functions

void addMouseEvent (const GUIEventAdapter &ea)
 
bool calcMovement ()
 
void computePosition (const osg::Vec3 &eye, const osg::Vec3 &lv, const osg::Vec3 &up)
 
void flushMouseEventStack ()
 
bool isMouseMoving ()
 
float tb_project_to_sphere (float r, float x, float y)
 
void trackball (osg::Vec3 &axis, float &angle, float p1x, float p1y, float p2x, float p2y)
 

Protected Attributes

osg::Vec3d _center
 
double _distance
 
osg::ref_ptr< const GUIEventAdapter > _ga_t0
 
osg::ref_ptr< const GUIEventAdapter > _ga_t1
 
double _minimumZoomScale
 
double _modelScale
 
osg::ref_ptr< osg::Node > _node
 
osg::Quat _rotation
 
bool _thrown
 
float _trackballSize
 

Detailed Description

Definition at line 24 of file OsgTrackballManipulator.h.

Member Function Documentation

void OsgAnimatSim::Visualization::OsgTrackballManipulator::addMouseEvent ( const GUIEventAdapter &  ea)
protected

Add the current mouse GUIEvent to internal stack.

Definition at line 213 of file OsgTrackballManipulator.cpp.

bool OsgAnimatSim::Visualization::OsgTrackballManipulator::calcMovement ( )
protected

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

Definition at line 258 of file OsgTrackballManipulator.cpp.

void OsgAnimatSim::Visualization::OsgTrackballManipulator::flushMouseEventStack ( )
protected

Reset the internal GUIEvent stack.

Definition at line 206 of file OsgTrackballManipulator.cpp.

const osg::Vec3d& OsgAnimatSim::Visualization::OsgTrackballManipulator::getCenter ( ) const
inline

Get the center of the trackball.

Definition at line 87 of file OsgTrackballManipulator.h.

double OsgAnimatSim::Visualization::OsgTrackballManipulator::getDistance ( ) const
inline

Get the distance of the trackball.

Definition at line 99 of file OsgTrackballManipulator.h.

virtual osgUtil::SceneView::FusionDistanceMode OsgAnimatSim::Visualization::OsgTrackballManipulator::getFusionDistanceMode ( ) const
inlinevirtual

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

Definition at line 44 of file OsgTrackballManipulator.h.

virtual float OsgAnimatSim::Visualization::OsgTrackballManipulator::getFusionDistanceValue ( ) const
inlinevirtual

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

Definition at line 47 of file OsgTrackballManipulator.h.

osg::Matrixd OsgAnimatSim::Visualization::OsgTrackballManipulator::getInverseMatrix ( ) const
virtual

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

Definition at line 230 of file OsgTrackballManipulator.cpp.

osg::Matrixd OsgAnimatSim::Visualization::OsgTrackballManipulator::getMatrix ( ) const
virtual

get the position of the manipulator as 4x4 Matrix.

Definition at line 225 of file OsgTrackballManipulator.cpp.

double OsgAnimatSim::Visualization::OsgTrackballManipulator::getMinimumZoomScale ( ) const
inline

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

Definition at line 81 of file OsgTrackballManipulator.h.

const osg::Node * OsgAnimatSim::Visualization::OsgTrackballManipulator::getNode ( ) const
virtual

Return node if attached.

Definition at line 46 of file OsgTrackballManipulator.cpp.

osg::Node * OsgAnimatSim::Visualization::OsgTrackballManipulator::getNode ( )
virtual

Return node if attached.

Definition at line 52 of file OsgTrackballManipulator.cpp.

const osg::Quat& OsgAnimatSim::Visualization::OsgTrackballManipulator::getRotation ( ) const
inline

Get the rotation of the trackball.

Definition at line 93 of file OsgTrackballManipulator.h.

float OsgAnimatSim::Visualization::OsgTrackballManipulator::getTrackballSize ( ) const
inline

Get the size of the trackball.

Definition at line 105 of file OsgTrackballManipulator.h.

void OsgAnimatSim::Visualization::OsgTrackballManipulator::getUsage ( osg::ApplicationUsage &  usage) const
virtual

Get the keyboard and mouse usage of this manipulator.

Definition at line 83 of file OsgTrackballManipulator.cpp.

bool OsgAnimatSim::Visualization::OsgTrackballManipulator::handle ( const GUIEventAdapter &  ea,
GUIActionAdapter &  us 
)
virtual

handle events, return true if handled, false otherwise.

Definition at line 90 of file OsgTrackballManipulator.cpp.

void OsgAnimatSim::Visualization::OsgTrackballManipulator::home ( const GUIEventAdapter &  ea,
GUIActionAdapter &  us 
)
virtual

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

Definition at line 69 of file OsgTrackballManipulator.cpp.

void OsgAnimatSim::Visualization::OsgTrackballManipulator::init ( const GUIEventAdapter &  ea,
GUIActionAdapter &  us 
)
virtual

Start/restart the manipulator.

Definition at line 77 of file OsgTrackballManipulator.cpp.

bool OsgAnimatSim::Visualization::OsgTrackballManipulator::isMouseMoving ( )
protected

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

Definition at line 191 of file OsgTrackballManipulator.cpp.

virtual void OsgAnimatSim::Visualization::OsgTrackballManipulator::setByInverseMatrix ( const osg::Matrixd &  matrix)
inlinevirtual

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

Definition at line 35 of file OsgTrackballManipulator.h.

void OsgAnimatSim::Visualization::OsgTrackballManipulator::setByMatrix ( const osg::Matrixd &  matrix)
virtual

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

Definition at line 219 of file OsgTrackballManipulator.cpp.

void OsgAnimatSim::Visualization::OsgTrackballManipulator::setCenter ( const osg::Vec3d &  center)
inline

Set the center of the trackball.

Definition at line 84 of file OsgTrackballManipulator.h.

void OsgAnimatSim::Visualization::OsgTrackballManipulator::setDistance ( double  distance)
inline

Set the distance of the trackball.

Definition at line 96 of file OsgTrackballManipulator.h.

void OsgAnimatSim::Visualization::OsgTrackballManipulator::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.

Definition at line 78 of file OsgTrackballManipulator.h.

void OsgAnimatSim::Visualization::OsgTrackballManipulator::setNode ( osg::Node *  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.

Definition at line 34 of file OsgTrackballManipulator.cpp.

void OsgAnimatSim::Visualization::OsgTrackballManipulator::setRotation ( const osg::Quat &  rotation)
inline

Set the rotation of the trackball.

Definition at line 90 of file OsgTrackballManipulator.h.

void OsgAnimatSim::Visualization::OsgTrackballManipulator::setTrackballSize ( float  size)

Set the size of the trackball.

Definition at line 370 of file OsgTrackballManipulator.cpp.


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