#include <OMKKeyEmitterExtension.h>
Inheritance diagram for OMK::Inp::KeyEmitterExtensionT< T, ModelType >:
Public Member Functions | |
virtual | ~KeyEmitterExtensionT () |
Static Public Attributes | |
static Name | OMK_CLASS_ID |
The id for the class in a configuration. | |
static const bool | REGISTERED_IN_EXTENSION_FACTORY |
The registration in the extension factory. | |
Protected Member Functions | |
KeyEmitterExtensionT (ExtensibleSimulatedObject *owner, const Name &id, bool registerExtension) | |
Constructor. | |
virtual bool | loadExtensionParameters (const ConfigurationParameterDescriptor *node) |
Configuration parameters loader of Extension. | |
virtual void | action () |
The overwritten method. | |
Friends | |
class | OMK::ExtensionCreatorT< KeyEmitterExtensionT< T, ModelType > > |
The creator is a friend. |
The creation is done dynamically through the following configuration:
visualisation { Class OgreVis ... Extensions { plus { Class Key...EmitterExtension // ... must be replace according to the used type Key P // the key which is used to trigger the action VisuName visualisation // the default is "visualisation" needed to create the key listener EventName eventId // The id of the event or signal Values[ value1 value2 ... ] // the values for the signal or event Signal on/off // by default is set to on // on: the extension fire a signal, off: the extension emit a event Listeners [ obj1 obj2 ... ] // the list of the object which listen } ... } }
movingPoint { Class SimplePoint Extensions { togglePosition { Class KeyTransformEmitterExtension Key P // the key which is used to trigger the action VisuName visuOgre // the default is "visualisation" needed to create the key listener AttributeId Position // The id of the attribute to set Values[ [[0 0 1]] [[1 0 0]] [[0 1 0]] ] // the values for the signal or event } } }
It is the same to write:
movingPoint { Class SimplePoint Extensions { togglePosition { Class KeyTransformEmitterExtension Key P VisuName visuOgre EventName "current_value_of_Position" // \ Signal off // > replaced by AttributeId Position Listeners [ "movingPoint" ] // / Values[ [[0 0 10]] [[10 0 0]] [[0 10 0]] ] } } UserParams { PositionSetByEventOf enable // Needed to activate the setting by event } }
There is two ways to activate the action of the extension.
the_sender_object->sendEvent( "visualisation", OMK::Inp::KeyListener::getKeyPressCode( "P" ) ) ;
namespace OMK { namespace Inp { typedef KeyEmitterExtensionT< MyType, OMK::Type::SimpleTypeT< MyType > > KeyMyTypeEmitterExtension ; } } REGISTER_TEMPLATE_EXTENSION_FACTORY( OMK::Inp::KeyStringEmitterExtension, "KeyStringEmitterExtension" ) ;
Definition at line 177 of file OMKKeyEmitterExtension.h.
OMK::Inp::KeyEmitterExtensionT< T, ModelType >::KeyEmitterExtensionT | ( | ExtensibleSimulatedObject * | owner, | |
const Name & | id, | |||
bool | registerExtension | |||
) | [inline, protected] |
Constructor.
It is protected, because it is only called by the friend creator.
Definition at line 191 of file OMKKeyEmitterExtension.h.
00192 : GenericKeyExtension< ExtensibleSimulatedObject >( owner, id, registerExtension, "" ), 00193 ValuedEventSignalEmitterUtilT< T, ModelType >() 00194 { 00195 }
virtual OMK::Inp::KeyEmitterExtensionT< T, ModelType >::~KeyEmitterExtensionT | ( | ) | [inline, virtual] |
virtual bool OMK::Inp::KeyEmitterExtensionT< T, ModelType >::loadExtensionParameters | ( | const ConfigurationParameterDescriptor * | node | ) | [inline, protected, virtual] |
Configuration parameters loader of Extension.
Retrieves the key (by default it is B), then creates the event listener and the key listener for the defined key.
Reimplemented from OMK::Inp::GenericKeyExtension< OwnerClass >.
Definition at line 200 of file OMKKeyEmitterExtension.h.
References OMK::ExtensionT< OwnerClass >::_owner, and OMK::ValuedEventSignalEmitterUtilT< T, ModelType >::loadParametersUtil().
00201 { 00202 return GenericKeyExtension< ExtensibleSimulatedObject >::loadExtensionParameters( node ) 00203 && this->loadParametersUtil( _owner, node ); 00204 }
virtual void OMK::Inp::KeyEmitterExtensionT< T, ModelType >::action | ( | ) | [inline, protected, virtual] |
The overwritten method.
Fire a signal or send an event according to the configuration.
Reimplemented from OMK::Inp::GenericKeyExtension< OwnerClass >.
Definition at line 207 of file OMKKeyEmitterExtension.h.
References OMK::ExtensionT< OwnerClass >::_owner, and OMK::ValuedEventSignalEmitterUtilT< T, ModelType >::sendUtil().
friend class OMK::ExtensionCreatorT< KeyEmitterExtensionT< T, ModelType > > [friend] |
Name OMK::Inp::KeyEmitterExtensionT< T, ModelType >::OMK_CLASS_ID [static] |
const bool OMK::Inp::KeyEmitterExtensionT< T, ModelType >::REGISTERED_IN_EXTENSION_FACTORY [static] |
Documentation generated on Mon Jun 9 11:46:04 2008 |
Generated with doxygen by Dimitri van Heesch , 1997-2007 |