OMK::Vis::Animator Class Reference

Animator which updates the visual object thanks to the informations found by its plug. More...

#include <OMKAnimator.h>

Inheritance diagram for OMK::Vis::Animator:

Inheritance graph
[legend]
Collaboration diagram for OMK::Vis::Animator:

Collaboration graph
[legend]
List of all members.

Public Member Functions

virtual void processVis ()
 Called by the partner to process the visualisation.
const NamegetId () const
 Returns the id (name) of the animator.
const VisualObjectgetVisualObject () const
 returns a const reference to the associated visual object
VisualObjectgetVisualObject ()
 returns a reference to the associated visual object
template<typename T>
T * getTemplateNode ()
 return AnimatorNode wich will be defined on descendance ie OgreAnimator<T>

Protected Member Functions

Interface.
virtual void selfProcessVis ()=0
 Called by the partner to process the visualisation.

Protected Attributes

AnimatorPlug_plugUpdate
 The plug to retrieve the value.
void * _tNode
 Node for descendance.

Private Attributes

Name _id
 The id (name).
VisualObject_visualObject
 The visual object associated with the animator.

Detailed Description

Animator which updates the visual object thanks to the informations found by its plug.

Author:
Benoit Chanclou, Micha� Rouill� bunraku <bchanclo@irisa.fr>
The aim of the animator and its sons is to update the visual object, which they are associated to, through the plug which gets informations with an event or an output.
If the plug uses a valued event or an output, it should use OMK::Vis::AnimatorT which is the typed version of the animator. This untyped animator and its sons use the untyped plug of OMK::Vis::AnimatorEventPlug which reacts to simple events.
See also:
How animators find the values

Definition at line 48 of file OMKAnimator.h.


Constructor & Destructor Documentation

Animator::~Animator (  )  [virtual]

Destructor.

Definition at line 74 of file OMKAnimator.cpp.

References _plugUpdate, OMK::Vis::debugMsg(), OMK_DEBUG_VIS_EXEC, and OMTRACEID.

00075 {
00076   OMTRACEID( OMK_DEBUG_VIS_EXEC, "Destruction of " << debugMsg( this ) );
00077   delete _plugUpdate ;
00078 }

Animator::Animator ( VisualObject visualObject,
const Name id,
const ConfigurationParameterDescriptor node 
) [protected]

Constructor for object factory OMK::Vis::ObjectFactory.

Definition at line 42 of file OMKAnimator.cpp.

References _plugUpdate, OMK::Vis::debugMsg(), OMK::ParametersAccessor::get(), OMK_DEBUG_VIS_EXEC, OMTRACEID, OMK::Vis::VisBase::registerEventPlug(), and OMK::Vis::VisualObject::touchVis().

00043         : _plugUpdate( 0 ),
00044         _id( id ) ,
00045         _visualObject( visualObject ),
00046   _tNode (NULL)
00047 {
00048   OMTRACEID( OMK_DEBUG_VIS_EXEC, "Construction of " << debugMsg( this ) );
00049   std::string eventId = id.getString() ;
00050         
00051   // If configFile is not providing the EventId, EventId will be the id
00052   ParametersAccessor::get( &node, "ListenedEvent", eventId ) ;
00053   std::string emitter ;
00054   ParametersAccessor::get( &node, "Emitter", emitter ) ;
00055   _plugUpdate = new AnimatorEventPlug( visualObject.touchVis(), EventIdentifier( eventId ) ) ;
00056   visualObject.touchVis().registerEventPlug( EventIdentifier( eventId ), emitter, static_cast<AnimatorEventPlug*>( _plugUpdate ) );
00057 }

Animator::Animator ( VisualObject visualObject,
const Name id 
) [protected]

Constructor for AnimatorT DON'T USE IT !

Definition at line 62 of file OMKAnimator.cpp.

References OMK::Vis::debugMsg(), OMK_DEBUG_VIS_EXEC, and OMTRACEID.

00063         : _plugUpdate( 0 ),
00064         _id( id ),
00065         _visualObject( visualObject ),
00066   _tNode ( NULL )
00067 {
00068   OMTRACEID( OMK_DEBUG_VIS_EXEC, "Construction of " << debugMsg( this ) );
00069 }

Animator::~Animator (  )  [virtual]

Destructor.

Definition at line 74 of file OMKAnimator.cpp.

References _plugUpdate, OMK::Vis::debugMsg(), OMK_DEBUG_VIS_EXEC, and OMTRACEID.

00075 {
00076   OMTRACEID( OMK_DEBUG_VIS_EXEC, "Destruction of " << debugMsg( this ) );
00077   delete _plugUpdate ;
00078 }

Animator::Animator ( VisualObject visualObject,
const Name id,
const ConfigurationParameterDescriptor node 
) [protected]

Constructor for object factory OMK::Vis::ObjectFactory.

Definition at line 42 of file OMKAnimator.cpp.

References _plugUpdate, OMK::Vis::debugMsg(), OMK::ParametersAccessor::get(), OMK_DEBUG_VIS_EXEC, OMTRACEID, OMK::Vis::VisBase::registerEventPlug(), and OMK::Vis::VisualObject::touchVis().

00043         : _plugUpdate( 0 ),
00044         _id( id ) ,
00045         _visualObject( visualObject ),
00046   _tNode (NULL)
00047 {
00048   OMTRACEID( OMK_DEBUG_VIS_EXEC, "Construction of " << debugMsg( this ) );
00049   std::string eventId = id.getString() ;
00050         
00051   // If configFile is not providing the EventId, EventId will be the id
00052   ParametersAccessor::get( &node, "ListenedEvent", eventId ) ;
00053   std::string emitter ;
00054   ParametersAccessor::get( &node, "Emitter", emitter ) ;
00055   _plugUpdate = new AnimatorEventPlug( visualObject.touchVis(), EventIdentifier( eventId ) ) ;
00056   visualObject.touchVis().registerEventPlug( EventIdentifier( eventId ), emitter, static_cast<AnimatorEventPlug*>( _plugUpdate ) );
00057 }

Animator::Animator ( VisualObject visualObject,
const Name id 
) [protected]

Constructor for AnimatorT DON'T USE IT !

Definition at line 62 of file OMKAnimator.cpp.

References OMK::Vis::debugMsg(), OMK_DEBUG_VIS_EXEC, and OMTRACEID.

00063         : _plugUpdate( 0 ),
00064         _id( id ),
00065         _visualObject( visualObject ),
00066   _tNode ( NULL )
00067 {
00068   OMTRACEID( OMK_DEBUG_VIS_EXEC, "Construction of " << debugMsg( this ) );
00069 }


Member Function Documentation

void Animator::processVis (  )  [virtual]

Called by the partner to process the visualisation.

Work only if the value associated to the plug changes.

Definition at line 84 of file OMKAnimator.cpp.

References _plugUpdate, OMK::Vis::AnimatorPlug::isValueChanged(), OMASSERTM, and selfProcessVis().

00085 {
00086         OMASSERTM( _plugUpdate, "Cannot be null, must be valid a valid plug" ) ;
00087         if( _plugUpdate->isValueChanged() )
00088         {
00089                 selfProcessVis() ;
00090         }
00091 }

const Name & OMK::Vis::Animator::getId (  )  const [inline]

Returns the id (name) of the animator.

Definition at line 221 of file OMKAnimator.h.

References _id.

Referenced by OMK::Vis::VisualObject::addAnimator(), OMK::Vis::debugMsg(), OMK::Vis::SwitchAnimator::init(), and OMK::Vis::SwitchAnimator::selfProcessVis().

00224 {

const VisualObject & OMK::Vis::Animator::getVisualObject (  )  const [inline]

returns a const reference to the associated visual object

Definition at line 228 of file OMKAnimator.h.

References _visualObject.

Referenced by OMK::Vis::debugMsg(), OMK::Vis::TransparencyValueAnimator::selfProcessVis(), and OMK::Vis::TransparencyAnimAnimator::selfProcessVis().

00231 {

VisualObject & OMK::Vis::Animator::getVisualObject (  )  [inline]

returns a reference to the associated visual object

Definition at line 235 of file OMKAnimator.h.

References _visualObject.

00238 {

template<typename T>
T * OMK::Vis::Animator::getTemplateNode (  )  [inline]

return AnimatorNode wich will be defined on descendance ie OgreAnimator<T>

Definition at line 242 of file OMKAnimator.h.

References _tNode.

00245 {

virtual void OMK::Vis::Animator::selfProcessVis (  )  [protected, pure virtual]

Called by the partner to process the visualisation.

Called by the public version if the value was changed. Must be overwrite by sons.

Implemented in OMK::Vis::AnimatorT< T >, OMK::Vis::AnimatorT< OMK::Type::SimpleTypeTimpleTypeT< Transform > >, OMK::Vis::AnimatorT< OMK::Type::SimpleTypeTstring >, OMK::Vis::AnimatorT< OMK::Type::SimpleTypeTimpleTypeT< float > >, OMK::Vis::AnimatorT< OMK::Type::SimpleTypeTimpleTypeT< bool > >, OMK::Vis::AnimatorT< OMK::Type::SimpleTypeTimpleTypeT< int > >, OMK::Vis::AnimatorT< Type >, OMK::Vis::AnimatorT< OMK::Type::SimpleTypeTimpleTypeT< Color > >, and OMK::Vis::AnimatorT< Type::PostureDataType >.

Referenced by processVis().


Member Data Documentation

AnimatorPlug* OMK::Vis::Animator::_plugUpdate [protected]

The plug to retrieve the value.

Definition at line 94 of file OMKAnimator.h.

Referenced by Animator(), OMK::Vis::AnimatorT< T >::AnimatorT(), OMK::Vis::OgreAnimator::OgreAnimator(), processVis(), and ~Animator().

Name OMK::Vis::Animator::_id [private]

The id (name).

Definition at line 100 of file OMKAnimator.h.

Referenced by getId().

VisualObject& OMK::Vis::Animator::_visualObject [private]

The visual object associated with the animator.

This reference is used by the descendant to retrieve the node to animate

Definition at line 104 of file OMKAnimator.h.

Referenced by getVisualObject().

void* OMK::Vis::Animator::_tNode [protected]

Node for descendance.

Definition at line 108 of file OMKAnimator.h.

Referenced by getTemplateNode(), OMK::Vis::OgreAnimator::OgreAnimator(), and OMK::Vis::OMK::Vis::OgreAnimatorT< OMK::Type::SimpleTypeTstring > >::OgreAnimatorT().


logo OpenMask

Documentation generated on Mon Jun 9 11:46:05 2008

Generated with doxygen by Dimitri van Heesch ,   1997-2007