OMK::TriggerAttributeExtension Class Reference
[Extensions]

A trigger which sets a boolean attribute to true if the distance between the object and the target is less than the thresold. More...

#include <OMKTriggerExtension.h>

Inheritance diagram for OMK::TriggerAttributeExtension:

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

Collaboration graph
[legend]
List of all members.

Protected Member Functions

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

Private Member Functions

 DECLARE_EXTENSION_FACTORY (TriggerAttributeExtension)

Detailed Description

A trigger which sets a boolean attribute to true if the distance between the object and the target is less than the thresold.

Module description :
The boolean attribute must be already declared by the object (or a previous extension). This extension sets the boolean attribute to true if the distance between the object position and the target position is less than the thresold.

The threshold attribute is named ExtensionIdThreshold.

See also TriggerExtension.

Configuration parameters :
The parameters are: Example with an object with a trasform attribute named ObjectPosition a boolean attribute named Activation :
    object
    {
      Class MyObject
      Scheduling
      {
        Frequency 60
      }
      UserParams
      {
        ObjectPosition [[0 0 200]]
        triggerTargetConnect [trajectory Position]
      }
      Extensions
      {
        trigger
        {
          PositionId ObjectPosition
          Class TriggerAttribute
          AttributeId Activation
          Thresold 30.0
        }
      }
    }
Because no target attribute is available in the object, the trigger extension adds automatically a transform attribute named triggerTarget to get the target position.

Definition at line 225 of file OMKTriggerExtension.h.


Member Function Documentation

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

bool TriggerAttributeExtension::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::TriggerBaseExtension.

Definition at line 136 of file OMKTriggerExtension.cpp.

References OMK::TriggerBaseExtension::_flagAccessor, OMK::ExtensionT< OMK::ExtensibleSimulatedObject >::_owner, OMK::ParametersAccessor::get(), OMK::ExtensibleSimulatedObject::getBaseAttribute(), and OMK::TriggerBaseExtension::loadExtensionParameters().

00137 {
00138   Name attributeName( "Activation" ) ;
00139   ParametersAccessor::get( node, "AttributeId", attributeName ) ;
00140   _flagAccessor = _owner->getBaseAttribute< bool >( attributeName ) ;
00141 
00142   return _flagAccessor && TriggerBaseExtension::loadExtensionParameters( node );
00143 }


logo OpenMask

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

Generated with doxygen by Dimitri van Heesch ,   1997-2007