#include <OMKInputExtension.h>
Inheritance diagram for OMK::Inp::InputCreatorListener:
Private Member Functions | |
InputCreatorListener (OMK::Vis::OgreVis *owner, InputExtension *inputExtension) | |
Default constructor of OgreVisAndInputs only called by creator. | |
virtual | ~InputCreatorListener () |
Destructor. | |
Inherited | |
virtual void | registerEvents () |
to register the events | |
virtual bool | processEvent (Event *event) |
to handle the events received by the visualisation | |
Private Attributes | |
InputExtension * | _inputExtension |
The associated extension. | |
Friends | |
class | InputExtension |
Definition at line 497 of file OMKInputExtension.h.
InputCreatorListener::InputCreatorListener | ( | OMK::Vis::OgreVis * | owner, | |
InputExtension * | inputExtension | |||
) | [private] |
Default constructor of OgreVisAndInputs only called by creator.
Definition at line 595 of file OMKInputExtension.cpp.
00596 : EventListener( *owner ), 00597 _inputExtension( inputExtension ) 00598 { 00599 }
InputCreatorListener::~InputCreatorListener | ( | ) | [private, virtual] |
void InputCreatorListener::registerEvents | ( | ) | [private, virtual] |
to register the events
Reimplemented from OMK::EventListener.
Definition at line 605 of file OMKInputExtension.cpp.
References OMK::EventListener::_owner, OMK::Inp::InputExtension::ADD_INPUT, OMK::Inp::InputExtension::ADD_KEY, OMK::SimulatedObject::registerEventListenerForEvent(), and OMK::Inp::InputExtension::REMOVE_INPUT.
00606 { 00607 _owner.registerEventListenerForEvent( *this, InputExtension::ADD_INPUT ) ; 00608 _owner.registerEventListenerForEvent( *this, InputExtension::REMOVE_INPUT ) ; 00609 _owner.registerEventListenerForEvent( *this, InputExtension::ADD_KEY ) ; 00610 }
to handle the events received by the visualisation
Implements OMK::EventListener.
Definition at line 612 of file OMKInputExtension.cpp.
References _inputExtension, OMK::Inp::InputExtension::ADD_INPUT, OMK::Inp::InputExtension::ADD_KEY, OMK::Inp::InputExtension::addKeyListener(), OMK::Inp::InputExtension::addListener(), OMK::Event::eventId, OMK::Name::getString(), OMK_DEBUG_INP_EXT, OMTRACEID, OMK::Inp::InputExtension::REMOVE_INPUT, and OMK::Inp::InputExtension::removeListener().
00613 { 00614 OMTRACEID(OMK_DEBUG_INP_EXT, ">>>eventId \"" << e->eventId.getString()<< "\"" << std::endl ) ; 00615 // Return value 00616 bool ok = false ; 00617 00618 if( e->eventId == InputExtension::ADD_INPUT ) 00619 { // Add a new partner 00620 ok = _inputExtension->addListener( dynamic_cast< ValuedEvent< AddInputListenerPrm > * >( e )->value ) ; 00621 } 00622 else if( e->eventId == InputExtension::REMOVE_INPUT ) 00623 { // Add a new partner 00624 ok = _inputExtension->removeListener( dynamic_cast< ValuedEvent< Name > * >( e )->value ) ; 00625 } 00626 else if( e->eventId == InputExtension::ADD_KEY ) 00627 { // Add a new partner 00628 ok = _inputExtension->addKeyListener( dynamic_cast< ValuedEvent< AddInputKeyPrm > * >( e )->value ) ; 00629 } 00630 00631 return ok ; 00632 }
friend class InputExtension [friend] |
Definition at line 501 of file OMKInputExtension.h.
The associated extension.
Definition at line 516 of file OMKInputExtension.h.
Referenced by processEvent().
Documentation generated on Mon Jun 9 11:46:04 2008 |
Generated with doxygen by Dimitri van Heesch , 1997-2007 |