OMK::Inp::KeyEmitterExtension Class Reference
[User inputs]

Extension to emit an event when a key is pressed. More...

#include <OMKKeyEmitterExtension.h>

Inheritance diagram for OMK::Inp::KeyEmitterExtension:

Inheritance graph
[legend]
Collaboration diagram for OMK::Inp::KeyEmitterExtension:

Collaboration graph
[legend]
List of all members.

Protected Member Functions

virtual bool loadExtensionParameters (const ConfigurationParameterDescriptor *node)
 Configuration parameters loader of Extension.
virtual void action ()
 The overwritten method.

Private Member Functions

 DECLARE_EXTENSION_FACTORY (KeyEmitterExtension)

Detailed Description

Extension to emit an event when a key is pressed.

Date:
2007-03-14
Author:
Benoît Chanclou
Defines an extension which can be used with any object. This extension emits a event with a defined id when a key is pressed.

The creation is done dynamically through the following configuration:

visualisation
{
  Class OgreVis
  ...
  Extensions
  {
    plus
    {
            Class KeyEmitterExtension
      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
      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
    }
    ...
  }
}
 *

There is two ways to activate the action of the extension.

Definition at line 58 of file OMKKeyEmitterExtension.h.


Member Function Documentation

OMK::Inp::KeyEmitterExtension::DECLARE_EXTENSION_FACTORY ( KeyEmitterExtension   )  [private]

bool KeyEmitterExtension::loadExtensionParameters ( const ConfigurationParameterDescriptor node  )  [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 25 of file OMKKeyEmitterExtension.cpp.

References OMK::ExtensionT< OwnerClass >::_owner, and OMK::EventSignalEmitterUtil::loadParametersUtil().

void KeyEmitterExtension::action (  )  [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 32 of file OMKKeyEmitterExtension.cpp.

References OMK::ExtensionT< OwnerClass >::_owner, and OMK::EventSignalEmitterUtil::sendUtil().

00033 {
00034   sendUtil( _owner ) ;
00035 }


logo OpenMask

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

Generated with doxygen by Dimitri van Heesch ,   1997-2007