OMK::MovingHumano Class Reference

This simulated object defines a humano which gives a posture attribute to animate its associated avatars through animators. More...

#include <OMKMovingHumano.h>

Inheritance diagram for OMK::MovingHumano:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

virtual ~MovingHumano ()
 Destructor.

Protected Member Functions

 MovingHumano (Controller &ctrl, const ObjectDescriptor &objectDescriptor)
 Constructor.
virtual OMK::Type::AddVisualObjectPrm getVisualObjectPrm (ConfigurationParameterDescriptor *node) const
 The parameter to create the associated visual object.
virtual HBT::InitialisationSequencegetInitialiseSequence ()
 To get the initialisation sequence.

Protected Attributes

AttributeT< HBT::PostureData_posture
 The posture attribute.
HBT::InitialisationSequence_initialisationSequence
 A pointer to the initialisation sequence returned by getInitialiseSequence.

Detailed Description

This simulated object defines a humano which gives a posture attribute to animate its associated avatars through animators.

This simulated object cannot be create by the factory, it is only used by must be redefined by a son.

The posture attribute is named "Posture" and gives posture data. This structure cannot be set in the configuration file because it is too complex.

Definition at line 21 of file OMKMovingHumano.h.


Constructor & Destructor Documentation

MovingHumano::MovingHumano ( Controller ctrl,
const ObjectDescriptor objectDescriptor 
) [protected]

Constructor.

It is protected, because it is only called by the friend creator.

Adds the posture attribute with an output to update the associated avatar.

Definition at line 11 of file OMKMovingHumano.cpp.

References _posture, and OMK::ExtensibleSimulatedObject::addAttribute().

00012 : BasicHumano( ctrl, objectDescriptor ),
00013   _posture( "Posture", HBT::PostureData() ),
00014   _initialisationSequence( 0 )
00015 { 
00016   // The attribute to get the posture of the avatar
00017   addAttribute( _posture, true ) ;
00018 }

MovingHumano::~MovingHumano (  )  [virtual]

Destructor.

Does nothing special.

Definition at line 20 of file OMKMovingHumano.cpp.

00021 {
00022 }


Member Function Documentation

AddVisualObjectPrm MovingHumano::getVisualObjectPrm ( ConfigurationParameterDescriptor node  )  const [protected, virtual]

The parameter to create the associated visual object.

Returns:
The basic parameters to create a avatar visual object.
This function supplements the work made by the ancestor, to add a humano animator to the avatar visual object. This animator is connected to the posture attribute.

Reimplemented from OMK::BasicHumano.

Definition at line 24 of file OMKMovingHumano.cpp.

References OMK::ParametersAccessor::get(), OMK::SimulatedObject::getName(), OMK::BasicHumano::getVisualObjectPrm(), OMTRACE, and OMK::ParametersAccessor::set().

00025 {
00026   // Inclusion of the animator parameters in the node
00027   const ConfigurationParameterDescriptor* animatorNode = 0 ;
00028   ParametersAccessor::get( node, "Animator", animatorNode ) ;
00029   ConfigurationParameterDescriptor* modifiedAnimatorNode = const_cast< ConfigurationParameterDescriptor* >( animatorNode ) ;
00030   OMTRACE(" NodePere " << *node);
00031   if (animatorNode)
00032     OMTRACE(" Node " << *animatorNode);
00033 
00034   ConfigurationParameterDescriptor* humanoAnimatorNode = 0 ;
00035   ParametersAccessor::set( humanoAnimatorNode, "Class", std::string( "HumanoAnimator" ) ) ;
00036   ParametersAccessor::set( 
00037     humanoAnimatorNode, "ConnectTo",
00038     std::pair< Name, std::string >( getName(), "Posture" ) ) ;
00039   ParametersAccessor::set( modifiedAnimatorNode, "AvatarAnimator", humanoAnimatorNode ) ;
00040   if( !animatorNode ) ParametersAccessor::set( node, "Animator", modifiedAnimatorNode ) ;
00041 
00042   // The default parameters
00043   AddVisualObjectPrm visualObjectPrm( BasicHumano::getVisualObjectPrm( node ) ) ;
00044 
00045   return visualObjectPrm ;
00046 }

virtual HBT::InitialisationSequence* OMK::MovingHumano::getInitialiseSequence (  )  [inline, protected, virtual]

To get the initialisation sequence.

Returns:
A pointer to a valid previously initialised initialisation sequence.
See _initialisationSequence.

Implements OMK::BasicHumano.

Definition at line 52 of file OMKMovingHumano.h.

00052 { return _initialisationSequence ; } ;


Member Data Documentation

AttributeT< HBT::PostureData > OMK::MovingHumano::_posture [protected]

The posture attribute.

This posture attribute creates an output to update the associated avatar visual object throught a humano animator.

Definition at line 39 of file OMKMovingHumano.h.

Referenced by OMK::MKMHumano::computeParameters(), OMK::HumanoPlayer::computeParameters(), and MovingHumano().

HBT::InitialisationSequence* OMK::MovingHumano::_initialisationSequence [protected]

A pointer to the initialisation sequence returned by getInitialiseSequence.

This pointer is not deleted in the destructor, the son must delete it if necessary.

Must be initialised with a valid initialisation sequence before the first call to compute.

Definition at line 52 of file OMKMovingHumano.h.

Referenced by OMK::MKMHumano::computeParameters(), and OMK::HumanoPlayer::loadParameters().


logo OpenMask

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

Generated with doxygen by Dimitri van Heesch ,   1997-2007