OpenWalnut  1.4.0
Public Types | Public Member Functions | Private Member Functions | Private Attributes
WGEAnimationManipulator Class Reference

New OSG manipulator: AnimationManipulator. More...

#include <WGEAnimationManipulator.h>

+ Inheritance diagram for WGEAnimationManipulator:

List of all members.

Public Types

typedef osg::ref_ptr
< WGEAnimationManipulator
RefPtr
 Convenience typedef.
typedef osg::ref_ptr< const
WGEAnimationManipulator
ConstRefPtr
 Convenience typedef.

Public Member Functions

 WGEAnimationManipulator (WTimer::ConstSPtr timer=WTimer::ConstSPtr(new WRealtimeTimer()))
 Constructs a animation path manipulator using a realtime timer if not specified.
virtual ~WGEAnimationManipulator ()
 Destructor.
virtual void setByMatrix (const osg::Matrixd &matrix)
 Sets the current matrix of this animation manipulator.
virtual void setByInverseMatrix (const osg::Matrixd &matrix)
 Sets the current inverse matrix of this animation manipulator.
virtual osg::Matrixd getMatrix () const
 Gets the current animation matrix for the current time-step.
virtual osg::Matrixd getInverseMatrix () const
 Gets the current inverse animation matrix for the current time-step.
virtual bool handle (const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &us)
 Handles incoming events send by the event dispatcher of the view.
virtual void init (const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &us)
 Initializes this manipulator.
virtual void home (const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &us)
 Sets the manipulator back to its default.
virtual void home (double currentTime)
 Sets the animation callback to a certain time.
virtual void setTimer (WTimer::ConstSPtr timer)
 Allows to switch the timer type.

Private Member Functions

void handleFrame ()
 This method updates m_matrix per frame according to time elapsed.

Private Attributes

osg::Matrixd m_matrix
 The view matrix.
WTimer::ConstSPtr m_timer
 This timer keeps track of the current animation-time.
double m_homeOffsetTime
 If home() is called, the homeOffsetTime stores the timers current value.
bool m_paused
 If true, the animation is suspended.

Detailed Description

New OSG manipulator: AnimationManipulator.

Can play back animation paths (not osg::AnimationPath),

Definition at line 51 of file WGEAnimationManipulator.h.


Member Typedef Documentation

Convenience typedef.

Definition at line 62 of file WGEAnimationManipulator.h.

Convenience typedef.

Definition at line 57 of file WGEAnimationManipulator.h.


Constructor & Destructor Documentation

Constructs a animation path manipulator using a realtime timer if not specified.

Parameters:
timerthe timer type

Definition at line 35 of file WGEAnimationManipulator.cpp.

Destructor.

Definition at line 44 of file WGEAnimationManipulator.cpp.


Member Function Documentation

osg::Matrixd WGEAnimationManipulator::getInverseMatrix ( ) const [virtual]

Gets the current inverse animation matrix for the current time-step.

In most cases, this should be used as modelview matrix.

Returns:
the matrix

Definition at line 64 of file WGEAnimationManipulator.cpp.

References m_matrix.

osg::Matrixd WGEAnimationManipulator::getMatrix ( ) const [virtual]

Gets the current animation matrix for the current time-step.

Returns:
the matrix.

Definition at line 59 of file WGEAnimationManipulator.cpp.

References m_matrix.

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

Handles incoming events send by the event dispatcher of the view.

Parameters:
eaevent adapter
usaction adapter allowing interaction with the event dispatcher
Returns:
true if the event was handled

Definition at line 69 of file WGEAnimationManipulator.cpp.

References handleFrame().

This method updates m_matrix per frame according to time elapsed.

Definition at line 329 of file WGEAnimationManipulator.cpp.

References Transformation::finish(), m_homeOffsetTime, m_matrix, and m_timer.

Referenced by handle().

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

Sets the manipulator back to its default.

Parameters:
eaevent adapter
usaction adapter allowing interaction with the event dispatcher

Definition at line 93 of file WGEAnimationManipulator.cpp.

Referenced by init(), and setTimer().

void WGEAnimationManipulator::home ( double  currentTime) [virtual]

Sets the animation callback to a certain time.

Parameters:
currentTimethe time to which the manipulator should be set.

Definition at line 98 of file WGEAnimationManipulator.cpp.

References m_homeOffsetTime, and m_timer.

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

Initializes this manipulator.

This simply calls home( 0 ).

Parameters:
eaevent adapter
usaction adapter allowing interaction with the event dispatcher

Definition at line 88 of file WGEAnimationManipulator.cpp.

References home().

void WGEAnimationManipulator::setByInverseMatrix ( const osg::Matrixd &  matrix) [virtual]

Sets the current inverse matrix of this animation manipulator.

This is, in most cases, the modelview matrix. This most probably gets overwritten in the next frame by the current animation matrix.

Parameters:
matrixthe matrix to set

Definition at line 54 of file WGEAnimationManipulator.cpp.

References m_matrix.

void WGEAnimationManipulator::setByMatrix ( const osg::Matrixd &  matrix) [virtual]

Sets the current matrix of this animation manipulator.

This most probably gets overwritten in the next frame by the current animation matrix.

Parameters:
matrixthe matrix to set

Definition at line 49 of file WGEAnimationManipulator.cpp.

References m_matrix.

Allows to switch the timer type.

It continues animation at the current timer position.

Parameters:
timerthe timer

Definition at line 103 of file WGEAnimationManipulator.cpp.

References home(), and m_timer.


Member Data Documentation

If home() is called, the homeOffsetTime stores the timers current value.

Definition at line 161 of file WGEAnimationManipulator.h.

Referenced by handleFrame(), and home().

osg::Matrixd WGEAnimationManipulator::m_matrix [private]

The view matrix.

Gets modified on a per-frame basis.

Definition at line 151 of file WGEAnimationManipulator.h.

Referenced by getInverseMatrix(), getMatrix(), handleFrame(), setByInverseMatrix(), and setByMatrix().

If true, the animation is suspended.

Definition at line 171 of file WGEAnimationManipulator.h.

This timer keeps track of the current animation-time.

Definition at line 156 of file WGEAnimationManipulator.h.

Referenced by handleFrame(), home(), and setTimer().


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