OMK::MKMMotionTaskExtension Class Reference

#include <OMKMKMMotionTaskExtension.h>

Inheritance diagram for OMK::MKMMotionTaskExtension:

Inheritance graph
[legend]
Collaboration diagram for OMK::MKMMotionTaskExtension:

Collaboration graph
[legend]
List of all members.

Protected Member Functions

virtual bool loadExtensionParameters (const ConfigurationParameterDescriptor *node)
 Configuration parameters loader of Extension.
virtual void preComputeParameters ()
 method.

Protected Attributes

AttributeT< bool_activate
mkm::CHumanTask_Motion _motionTask
bool _initDone
std::string _motion
float _startAt
float _stopAt
float _startingDuration
float _stoppingDuration
float _weight
float _rank

Private Member Functions

 DECLARE_EXTENSION_FACTORY (MKMMotionTaskExtension)

Detailed Description

Definition at line 31 of file OMKMKMMotionTaskExtension.h.


Member Function Documentation

OMK::MKMMotionTaskExtension::DECLARE_EXTENSION_FACTORY ( MKMMotionTaskExtension   )  [private]

bool MKMMotionTaskExtension::loadExtensionParameters ( const ConfigurationParameterDescriptor node  )  [protected, virtual]

Configuration parameters loader of Extension.

Parameters:
[in] node the root node of the configuration parameter, null if no node defined for the extension.
Returns:
should return true if all the parameters are well retrieved.
Overwrite this method to initialise the extension. This method allows the extension to get parameters of its own field.
Be careful, loadObjectParameters method is called before this method.
See How to configure an extension ? for details.

Reimplemented from OMK::Extension.

Definition at line 61 of file OMKMKMMotionTaskExtension.cpp.

References _activate, _motion, _rank, _startAt, _startingDuration, _stopAt, _stoppingDuration, _weight, OMK::ParametersAccessor::get(), OMK::ExtensionT< OMK::MKMHumano >::getOwner(), and OMK::IAttributeBaseT< PrmType >::loadParameters().

00062 {
00063   // Retrieve all the parameters
00064   bool ok = true ;
00065   ok = ok && ParametersAccessor::get( node, "Motion", _motion, getOwner() ) ;
00066   ParametersAccessor::get( node, "StartAt", _startAt ) ;
00067   ParametersAccessor::get( node, "StopAt", _stopAt ) ;
00068   ParametersAccessor::get( node, "StartingDuration", _startingDuration ) ;
00069   ParametersAccessor::get( node, "StoppingDuration", _stoppingDuration ) ;
00070   ParametersAccessor::get( node, "PriorityWeight", _weight ) ;
00071   ParametersAccessor::get( node, "PriorityRank", _rank ) ;
00072   _activate.loadParameters( node, "Activation" ) ;
00073 
00074   return ok ;
00075 }

void MKMMotionTaskExtension::preComputeParameters (  )  [protected, virtual]

method.

This method is called by the extensible simulated object at each compute step. Its call takes place in the compute method just after the inputs were retrieved by the computeInputs method and before the output parameters will be computed by the computeParameters

Reimplemented from OMK::Extension.

Definition at line 76 of file OMKMKMMotionTaskExtension.cpp.

References _activate, _initDone, _motion, _motionTask, _rank, _startAt, _startingDuration, _stopAt, _stoppingDuration, _weight, OMK::IAttributeT< PrmType, ModelType, AccessorType >::get(), and OMK::ExtensionT< OMK::MKMHumano >::getOwner().

00077 {
00078   // Waiting for the avatar master is intialised
00079   if( !_initDone && getOwner()->_avatarMaster.isInitialized() )
00080   {
00081     // Defines the motion task and starts it
00082     _initDone = true ;
00083     _motionTask.init( getOwner()->_controlMesh, _motion ) ;
00084     _motionTask.setStartAtAbsoluteTime( _startAt ) ;
00085     _motionTask.setStopAtAbsoluteTime( _stopAt ) ;
00086     _motionTask.setStartingDuration( _startingDuration ) ;
00087     _motionTask.setStoppingDuration( _stoppingDuration ) ;
00088     _motionTask.setPriorityWeight( _weight ) ;
00089     _motionTask.setPriorityRank( _rank ) ;
00090     _activate.get() ? _motionTask.start() : _motionTask.stop() ;
00091   }
00092   if( _initDone )
00093   {
00094     if( _motionTask.isActive() && !_activate.get() )
00095     {
00096       _motionTask.stop() ;
00097     }
00098     if( !_motionTask.isActive() && _activate.get() )
00099     {
00100       _motionTask.start() ;
00101     }
00102   }
00103 }


Member Data Documentation

AttributeT< bool > OMK::MKMMotionTaskExtension::_activate [protected]

Definition at line 37 of file OMKMKMMotionTaskExtension.h.

Referenced by loadExtensionParameters(), and preComputeParameters().

mkm::CHumanTask_Motion OMK::MKMMotionTaskExtension::_motionTask [protected]

Definition at line 38 of file OMKMKMMotionTaskExtension.h.

Referenced by preComputeParameters().

bool OMK::MKMMotionTaskExtension::_initDone [protected]

Definition at line 39 of file OMKMKMMotionTaskExtension.h.

Referenced by preComputeParameters().

std::string OMK::MKMMotionTaskExtension::_motion [protected]

Definition at line 40 of file OMKMKMMotionTaskExtension.h.

Referenced by loadExtensionParameters(), and preComputeParameters().

float OMK::MKMMotionTaskExtension::_startAt [protected]

Definition at line 41 of file OMKMKMMotionTaskExtension.h.

Referenced by loadExtensionParameters(), and preComputeParameters().

float OMK::MKMMotionTaskExtension::_stopAt [protected]

Definition at line 42 of file OMKMKMMotionTaskExtension.h.

Referenced by loadExtensionParameters(), and preComputeParameters().

float OMK::MKMMotionTaskExtension::_startingDuration [protected]

Definition at line 43 of file OMKMKMMotionTaskExtension.h.

Referenced by loadExtensionParameters(), and preComputeParameters().

float OMK::MKMMotionTaskExtension::_stoppingDuration [protected]

Definition at line 44 of file OMKMKMMotionTaskExtension.h.

Referenced by loadExtensionParameters(), and preComputeParameters().

float OMK::MKMMotionTaskExtension::_weight [protected]

Definition at line 45 of file OMKMKMMotionTaskExtension.h.

Referenced by loadExtensionParameters(), and preComputeParameters().

float OMK::MKMMotionTaskExtension::_rank [protected]

Definition at line 46 of file OMKMKMMotionTaskExtension.h.

Referenced by loadExtensionParameters(), and preComputeParameters().


logo OpenMask

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

Generated with doxygen by Dimitri van Heesch ,   1997-2007