#include <OMKDuplicatedAttributeExtension.h>
Inheritance diagram for OMK::DuplicatedAttributeExtension< AttributType, Type >:
Public Member Functions | |
virtual | ~DuplicatedAttributeExtension () |
Destructor. | |
Static Public Attributes | |
static Name | OMK_CLASS_ID |
The id for the extension. | |
static const bool | REGISTERED_IN_EXTENSION_FACTORY |
The registration in the extension factory. | |
Protected Member Functions | |
DuplicatedAttributeExtension (ExtensibleSimulatedObject *owner, const Name &id) | |
Constructor. | |
Configuration loaders | |
virtual bool | loadExtensionParameters (const ConfigurationParameterDescriptor *node) |
Configuration parameters loader of Extension. | |
Protected Attributes | |
AttributeAccT< Type, AttributType > * | _duplicatedAttribute |
The offset attribute. | |
Friends | |
class | DuplicatedAttributeExtensionCreatorT< AttributType, Type > |
The creators are friend. |
The offset can be done in the pre-compute or the post-compute step according to creation id. To choose one or the other use PreDuplicatedAttribute (uses to offset an input) or PostOffest (uses to offset an output), as class's name in the configuration. The configuration is:
myObject { Class MyObject // with a "Position" attribute Extensions { offset { Class PostDuplicatedAttribute // or PreDuplicatedAttribute Attribute Position // the name of the attribute to offset DuplicatedAttribute [[0 0 -100]] // the offset value (it is optional, the default is identity) } } UserParams { DuplicatedAttributeConnect [anotherObject aTransformOutput] } } *
Definition at line 47 of file OMKDuplicatedAttributeExtension.h.
OMK::DuplicatedAttributeExtension< AttributType, Type >::DuplicatedAttributeExtension | ( | ExtensibleSimulatedObject * | owner, | |
const Name & | id | |||
) | [protected] |
Constructor.
It is protected, because it is only called by the friend creators.
Definition at line 31 of file OMKDuplicatedAttributeExtension.inl.
00032 : OMK::ExtensionT< ExtensibleSimulatedObject >( owner, id ), 00033 _duplicatedAttribute( 0 ) 00034 { 00035 }
OMK::DuplicatedAttributeExtension< AttributType, Type >::~DuplicatedAttributeExtension | ( | ) | [virtual] |
Destructor.
Definition at line 38 of file OMKDuplicatedAttributeExtension.inl.
References OMK::DuplicatedAttributeExtension< AttributType, Type >::_duplicatedAttribute, OMK::ExtensionT< SimulatedObjectType >::_owner, and OMK::IAttribute::getId().
00039 { 00040 _owner->removeAttribute( _duplicatedAttribute->getId() ) ; 00041 delete _duplicatedAttribute ; 00042 _duplicatedAttribute = 0 ; 00043 }
bool OMK::DuplicatedAttributeExtension< AttributType, Type >::loadExtensionParameters | ( | const ConfigurationParameterDescriptor * | node | ) | [protected, virtual] |
Configuration parameters loader of Extension.
It retrieves, in the extension configuration, the offset and the name of the attribute to ofset.
Reimplemented from OMK::Extension.
Definition at line 46 of file OMKDuplicatedAttributeExtension.inl.
References OMK::DuplicatedAttributeExtension< AttributType, Type >::_duplicatedAttribute, OMK::ExtensionT< SimulatedObjectType >::_owner, and OMK::ParametersAccessor::get().
00047 { 00048 // Retrieve the visual objects 00049 bool ok = true ; 00050 // Attribute to offset 00051 std::string attributeName ; 00052 ok = ok && ParametersAccessor::get( node, "Attribute", attributeName, _owner ) ; 00053 if( ok ) 00054 { 00055 Name id( attributeName + "_duplicated_" + typeid( Type ).name() ) ; 00056 ParametersAccessor::get( node, "Id", id ) ; 00057 IAccessorT< AttributType >* accessor = _owner->getBaseAttribute< AttributType >( Name( attributeName ) ) ; 00058 ok = accessor != 0 ; 00059 _duplicatedAttribute = new AttributeAccT< Type, AttributType >( id, accessor ); 00060 _owner->addAttribute( *_duplicatedAttribute ) ; 00061 } 00062 return ok ; 00063 }
friend class DuplicatedAttributeExtensionCreatorT< AttributType, Type > [friend] |
Name OMK::DuplicatedAttributeExtension< AttributType, Type >::OMK_CLASS_ID [static] |
const bool OMK::DuplicatedAttributeExtension< AttributType, Type >::REGISTERED_IN_EXTENSION_FACTORY [static] |
The registration in the extension factory.
Definition at line 58 of file OMKDuplicatedAttributeExtension.h.
AttributeAccT< Type, AttributType >* OMK::DuplicatedAttributeExtension< AttributType, Type >::_duplicatedAttribute [protected] |
The offset attribute.
It can be defined by the configuration parameter named Offset.
Definition at line 78 of file OMKDuplicatedAttributeExtension.h.
Referenced by OMK::DuplicatedAttributeExtension< AttributType, Type >::loadExtensionParameters(), and OMK::DuplicatedAttributeExtension< AttributType, Type >::~DuplicatedAttributeExtension().
Documentation generated on Mon Jun 9 11:46:01 2008 |
Generated with doxygen by Dimitri van Heesch , 1997-2007 |