#include <OMKHumanoPlayer.h>
Inheritance diagram for OMK::HumanoPlayer:
Protected Member Functions | |
virtual bool | loadParameters (const ConfigurationParameterDescriptor *node) |
Configuration parameters loader of BasicHumano. | |
virtual void | computeParameters () |
This a part of the compute method. | |
Protected Attributes | |
AttributeT< bool > | _loop |
AttributeT< bool > | _oneStep |
AttributeT< bool > | _stop |
HBT::Player | _player |
Private Member Functions | |
DECLARE_OBJECT_FACTORY (HumanoPlayer) |
There are three flag attributes to control the replay.
player { Class HumanoPlayer Scheduling { Frequency 60 } UserParams { File "avatar2.rec" Loop on } Extensions { toggleStop { Class KeyBoolEmitterExtension Key S VisuName visuOgre AttributeId Stop Values[ on off ] } } }
Definition at line 46 of file OMKHumanoPlayer.h.
OMK::HumanoPlayer::DECLARE_OBJECT_FACTORY | ( | HumanoPlayer | ) | [private] |
bool HumanoPlayer::loadParameters | ( | const ConfigurationParameterDescriptor * | node | ) | [protected, virtual] |
Configuration parameters loader of BasicHumano.
This initialisation fire a signal to create the visual object in all the visualisations. To get the parameter to create the associated avatar visual object it calls getVisualObjectPrm.
Reimplemented from OMK::BasicHumano.
Definition at line 36 of file OMKHumanoPlayer.cpp.
References OMK::MovingHumano::_initialisationSequence, _loop, _player, OMK::ParametersAccessor::get(), OMK::SimulatedObject::getName(), OMK::Name::getString(), HBT::InitialisationSequence::humanName, OMK::BasicHumano::loadParameters(), HBT::Player::open(), HBT::Player::read(), and HBT::Player::setLoop().
00037 { 00038 bool ok = true ; 00039 // Get the humano to record 00040 std::string file ; 00041 ok = ok && ParametersAccessor::get( node, "File", file, this ) ; 00042 00043 if( ok ) 00044 { 00045 // get the file to output data 00046 _initialisationSequence = new HBT::InitialisationSequence ; 00047 _player.open( file.c_str() ) ; 00048 _player.setLoop( _loop ) ; 00049 _player.read( *_initialisationSequence ) ; 00050 // change the name to the current one 00051 _initialisationSequence->humanName = getName().getString() ; 00052 } 00053 00054 return ok && MovingHumano::loadParameters( node ) ; 00055 }
void HumanoPlayer::computeParameters | ( | ) | [protected, virtual] |
This a part of the compute method.
Fire the signal which includes the initialisation sequence at the first call. This initialises the associated avatar visual object.
Reimplemented from OMK::BasicHumano.
Definition at line 58 of file OMKHumanoPlayer.cpp.
References OMK::BasicHumano::_initDone, _loop, _oneStep, _player, OMK::MovingHumano::_posture, _stop, OMK::BasicHumano::computeParameters(), HBT::Player::read(), OMK::IAttributeT< PrmType, ModelType, AccessorType >::set(), and HBT::Player::setLoop().
00059 { 00060 _player.setLoop( _loop ) ; 00061 if( _initDone && ( !_stop || _oneStep ) ) 00062 { 00063 unsigned int date ; 00064 HBT::PostureData posture ; 00065 _player.read( date, posture ) ; 00066 _posture.set( posture ) ; 00067 _oneStep.set( false ) ; 00068 } 00069 MovingHumano::computeParameters() ; 00070 }
AttributeT< bool > OMK::HumanoPlayer::_loop [protected] |
Definition at line 52 of file OMKHumanoPlayer.h.
Referenced by computeParameters(), and loadParameters().
AttributeT< bool > OMK::HumanoPlayer::_oneStep [protected] |
AttributeT< bool > OMK::HumanoPlayer::_stop [protected] |
HBT::Player OMK::HumanoPlayer::_player [protected] |
Definition at line 55 of file OMKHumanoPlayer.h.
Referenced by computeParameters(), and loadParameters().
Documentation generated on Mon Jun 9 11:46:04 2008 |
Generated with doxygen by Dimitri van Heesch , 1997-2007 |