OMK::Inp::InputCreatorListener Class Reference

Specialization of OgreVis for the Inputs OIS library. More...

#include <OMKInputExtension.h>

Inheritance diagram for OMK::Inp::InputCreatorListener:

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

Collaboration graph
[legend]
List of all members.

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

Detailed Description

Specialization of OgreVis for the Inputs OIS library.

Date:
2007-02-14
Author:
Benoît Chanclou, bunraku <benoit.chanclou@irisa.fr>
This object initialises the device input handler.

Definition at line 497 of file OMKInputExtension.h.


Constructor & Destructor Documentation

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]

Destructor.

Definition at line 601 of file OMKInputExtension.cpp.

00602 {
00603 }


Member Function Documentation

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.

bool InputCreatorListener::processEvent ( Event event  )  [private, virtual]

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 }


Friends And Related Function Documentation

friend class InputExtension [friend]

Definition at line 501 of file OMKInputExtension.h.


Member Data Documentation

InputExtension* OMK::Inp::InputCreatorListener::_inputExtension [private]

The associated extension.

Definition at line 516 of file OMKInputExtension.h.

Referenced by processEvent().


logo OpenMask

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

Generated with doxygen by Dimitri van Heesch ,   1997-2007