OMK::HumanoPlayer Class Reference

Humano simulated objects which replays a sequence read from a file. More...

#include <OMKHumanoPlayer.h>

Inheritance diagram for OMK::HumanoPlayer:

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

Collaboration graph
[legend]
List of all members.

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)

Detailed Description

Humano simulated objects which replays a sequence read from a file.

There are three flag attributes to control the replay.

Definition at line 46 of file OMKHumanoPlayer.h.


Member Function Documentation

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 }


Member Data Documentation

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]

Definition at line 53 of file OMKHumanoPlayer.h.

Referenced by computeParameters().

AttributeT< bool > OMK::HumanoPlayer::_stop [protected]

Definition at line 54 of file OMKHumanoPlayer.h.

Referenced by computeParameters().

HBT::Player OMK::HumanoPlayer::_player [protected]

Definition at line 55 of file OMKHumanoPlayer.h.

Referenced by computeParameters(), and loadParameters().


logo OpenMask

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

Generated with doxygen by Dimitri van Heesch ,   1997-2007