#include <OMKAnimatorT.h>
Inheritance diagram for OMK::Vis::AnimatorT< T >:
Protected Member Functions | |
Interface. | |
virtual void | selfProcessVis (void) |
Called by the partner to process the visualisation. | |
virtual void | selfProcessVis (const T &value)=0 |
Protected Attributes | |
AnimatorPlugT< T > * | _plugValue |
The plug to retrieve the value. |
Definition at line 49 of file OMKAnimatorT.h.
OMK::Vis::AnimatorT< T >::~AnimatorT | ( | ) | [virtual] |
OMK::Vis::AnimatorT< T >::AnimatorT | ( | VisualObject & | visualObject, | |
const Name & | id, | |||
AnimatorPlugT< T > * | plug | |||
) | [protected] |
Constructor for sons.
Definition at line 93 of file OMKAnimatorT.h.
References OMK::Vis::AnimatorT< T >::_plugValue, and OMASSERT.
00094 : Animator( visualObject, id ), 00095 _plugValue( plug ) 00096 { 00097 OMASSERT( _plugValue && "must be a well typed plug" ) ; 00098 }
OMK::Vis::AnimatorT< T >::AnimatorT | ( | VisualObject & | visualObject, | |
const Name & | id, | |||
const ConfigurationParameterDescriptor & | node | |||
) | [protected] |
Constructor for object factory OMK::Vis::ObjectFactory.
Definition at line 104 of file OMKAnimatorT.h.
References OMK::Vis::Animator::_plugUpdate, OMK::Vis::AnimatorT< T >::_plugValue, OMK::ParametersAccessor::get(), OMASSERT, OMK::Vis::VisBase::registerEventPlug(), and OMK::Vis::VisualObject::touchVis().
00105 : Animator( visualObject, id ), 00106 _plugValue( 0 ) 00107 { 00108 std::pair< std::string, std::string > inputPrm ; 00109 if( ParametersAccessor::get( &node, "ConnectTo", inputPrm ) ) 00110 { 00111 // found parameters for input plug => retrieve the input and create the plug 00112 Input< T >* input( visualObject.touchVis().template createInput< T >( inputPrm.first, inputPrm.second ) ) ; 00113 if( input ) 00114 { 00115 AnimatorInputPlugT< T >* inputPlug( new AnimatorInputPlugT< T >( input ) ) ; 00116 _plugUpdate = inputPlug ; 00117 _plugValue = inputPlug ; 00118 } 00119 OMASSERT( ( _plugUpdate != NULL ) && "Must be a valid pointer to a new plug" ) ; 00120 OMASSERT( ( _plugValue != NULL ) && "Cannot be null, must be a valid plug" ) ; 00121 } 00122 else 00123 { 00124 // If configFile is not providing the EventId, EventId will be the id 00125 std::string eventId = id.getString() ; 00126 ParametersAccessor::get( &node, "ListenedEvent", eventId ) ; 00127 AnimatorEventPlugT<T>* eventPlug( new AnimatorEventPlugT<T>( visualObject.touchVis(), EventIdentifier( eventId ) ) ) ; 00128 _plugUpdate = eventPlug ; 00129 _plugValue = eventPlug ; 00130 std::string emitter ; 00131 ParametersAccessor::get( &node, "Emitter", emitter ) ; 00132 visualObject.touchVis().registerEventPlug( EventIdentifier( eventId ), emitter, eventPlug ) ; 00133 } 00134 }
OMK::Vis::AnimatorT< T >::~AnimatorT | ( | ) | [virtual] |
OMK::Vis::AnimatorT< T >::AnimatorT | ( | VisualObject & | visualObject, | |
const Name & | id, | |||
AnimatorPlugT< T > * | plug | |||
) | [protected] |
Constructor for sons.
Definition at line 93 of file OMKAnimatorT.h.
References OMK::Vis::AnimatorT< T >::_plugValue, and OMASSERT.
00094 : Animator( visualObject, id ), 00095 _plugValue( plug ) 00096 { 00097 OMASSERT( _plugValue && "must be a well typed plug" ) ; 00098 }
OMK::Vis::AnimatorT< T >::AnimatorT | ( | VisualObject & | visualObject, | |
const Name & | id, | |||
const ConfigurationParameterDescriptor & | node | |||
) | [protected] |
Constructor for object factory OMK::Vis::ObjectFactory.
Definition at line 104 of file OMKAnimatorT.h.
References OMK::Vis::Animator::_plugUpdate, OMK::Vis::AnimatorT< T >::_plugValue, OMK::ParametersAccessor::get(), OMASSERT, OMK::Vis::VisBase::registerEventPlug(), and OMK::Vis::VisualObject::touchVis().
00105 : Animator( visualObject, id ), 00106 _plugValue( 0 ) 00107 { 00108 std::pair< std::string, std::string > inputPrm ; 00109 if( ParametersAccessor::get( &node, "ConnectTo", inputPrm ) ) 00110 { 00111 // found parameters for input plug => retrieve the input and create the plug 00112 Input< T >* input( visualObject.touchVis().template createInput< T >( inputPrm.first, inputPrm.second ) ) ; 00113 if( input ) 00114 { 00115 AnimatorInputPlugT< T >* inputPlug( new AnimatorInputPlugT< T >( input ) ) ; 00116 _plugUpdate = inputPlug ; 00117 _plugValue = inputPlug ; 00118 } 00119 OMASSERT( ( _plugUpdate != NULL ) && "Must be a valid pointer to a new plug" ) ; 00120 OMASSERT( ( _plugValue != NULL ) && "Cannot be null, must be a valid plug" ) ; 00121 } 00122 else 00123 { 00124 // If configFile is not providing the EventId, EventId will be the id 00125 std::string eventId = id.getString() ; 00126 ParametersAccessor::get( &node, "ListenedEvent", eventId ) ; 00127 AnimatorEventPlugT<T>* eventPlug( new AnimatorEventPlugT<T>( visualObject.touchVis(), EventIdentifier( eventId ) ) ) ; 00128 _plugUpdate = eventPlug ; 00129 _plugValue = eventPlug ; 00130 std::string emitter ; 00131 ParametersAccessor::get( &node, "Emitter", emitter ) ; 00132 visualObject.touchVis().registerEventPlug( EventIdentifier( eventId ), emitter, eventPlug ) ; 00133 } 00134 }
void OMK::Vis::AnimatorT< T >::selfProcessVis | ( | void | ) | [protected, virtual] |
Called by the partner to process the visualisation.
This method calls the homonymous method with a typed argument, the argument value is got by the plug.
Implements OMK::Vis::Animator.
Definition at line 148 of file OMKAnimatorT.h.
References OMK::Vis::AnimatorT< T >::_plugValue.
00149 { 00150 selfProcessVis( _plugValue->getTypedValue() ) ; 00151 }
virtual void OMK::Vis::AnimatorT< T >::selfProcessVis | ( | const T & | value | ) | [protected, pure virtual] |
Implemented in OMK::Vis::AwarenessAnimator< Type >, OMK::Vis::HumanoAnimator, and OMK::Vis::MaterialAnimator< Type >.
AnimatorPlugT<T>* OMK::Vis::AnimatorT< T >::_plugValue [protected] |
The plug to retrieve the value.
Definition at line 86 of file OMKAnimatorT.h.
Referenced by OMK::Vis::AnimatorT< T >::AnimatorT(), and OMK::Vis::AnimatorT< T >::selfProcessVis().
Documentation generated on Mon Jun 9 11:46:05 2008 |
Generated with doxygen by Dimitri van Heesch , 1997-2007 |