ALBA
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
albaInteractorSER Class Reference

#include <albaInteractorSER.h>

Inheritance diagram for albaInteractorSER:
Inheritance graph
[legend]
Collaboration diagram for albaInteractorSER:
Collaboration graph
[legend]

Public Types

typedef std::map< albaString, albaAutoPointer< albaAction > > mmuActionsMap
 
- Public Types inherited from albaInteractor
enum  modalities { SINGLE_BUTTON_MODE =0 , MULTI_BUTTON_MODE }
 

Public Member Functions

 albaTypeMacro (albaInteractorSER, albaInteractor)
 
void BindDeviceToAction (albaDevice *device, albaAction *action)
 
void BindDeviceToAction (albaDevice *device, const char *action_name)
 
void UnBindDeviceFromAction (albaDevice *device, albaAction *action)
 
void UnBindDeviceFromAction (albaDevice *device, const char *action_name)
 
void UnBindDeviceFromAllActions (albaDevice *device)
 
void GetDeviceBindings (albaDevice *device, std::vector< albaAction * > &actions)
 
int BindAction (const char *action, albaInteractor *agent)
 
int UnBindAction (const char *action, albaInteractor *agent)
 
albaActionAddAction (const char *name, float priority=0.0, int type=albaAction::SHARED_ACTION)
 
void AddAction (albaAction *action, float priority=0.0)
 
albaActionGetAction (const char *name)
 
void GetActions (std::vector< albaAction * > &actions)
 
const mmuActionsMapGetActions ()
 
- Public Member Functions inherited from albaInteractor
 albaInteractor ()
 
virtual ~albaInteractor ()
 
 ALBA_ID_DEC (INTERACTION_STARTED)
 
 ALBA_ID_DEC (INTERACTION_STOPPED)
 
 ALBA_ID_DEC (BUTTON_DOWN)
 
 ALBA_ID_DEC (BUTTON_UP)
 
 albaAbstractTypeMacro (albaInteractor, albaAgent)
 
virtual void SetRendererAndView (vtkRenderer *ren, albaView *view)
 
vtkRenderer * GetRenderer ()
 
albaViewGetView ()
 
albaDeviceGetDevice ()
 
virtual void SetDevice (albaDevice *)
 
virtual void SetVME (albaVME *vme)
 
void SetProp (vtkProp3D *prop)
 
void SetIgnoreTriggerEvents (bool flag)
 
int GetIgnoreTriggerEvents (bool flag)
 
void IgnoreTriggerEventsOn ()
 
void IgnoreTriggerEventsOff ()
 
void SetStartInteractionEvent (albaID event)
 
albaID GetStartInteractionEvent ()
 
void SetStopInteractionEvent (albaID event)
 
albaID GetStopInteractionEvent ()
 
void SetStartButton (int btn)
 
int GetStartButton ()
 
void SetModifiers (int mod)
 
int GetModifiers ()
 
int GetCurrentButton ()
 
unsigned long GetCurrentModifier ()
 
virtual int StartInteraction (albaDevice *device)
 
virtual int StopInteraction (albaDevice *device)
 
virtual bool IsInteracting ()
 
virtual bool IsInteracting (albaDevice *device)
 
void SetButtonMode (int mode)
 
int GetButtonMode ()
 
void SetButtonModeToSingleButton ()
 
void SetButtonModeToMultiButton ()
 
virtual void OnEvent (albaEventBase *event)
 
void TestModeOn ()
 
void TestModeOff ()
 
bool GetTestMode ()
 
- Public Member Functions inherited from albaAgent
 albaAbstractTypeMacro (albaAgent, albaReferenceCounted)
 
 ALBA_ID_DEC (AGENT_INITIALIZE)
 
void AddObserver (albaObserver *listener, albaID channel=MCH_UP)
 
void RemoveObserver (albaObserver *listener)
 
void RemoveAllObservers ()
 
virtual void OnEvent (albaEventBase *event)
 
bool HasObservers (albaID channel)
 
void GetObservers (albaID channel, std::vector< albaObserver * > &olist)
 
int Initialize ()
 
void Shutdown ()
 
int IsInitialized ()
 
virtual void SetName (const char *name)
 
const char * GetName ()
 
- Public Member Functions inherited from albaReferenceCounted
 albaReferenceCounted ()
 
virtual ~albaReferenceCounted ()
 
 albaAbstractTypeMacro (albaReferenceCounted, albaObject)
 
virtual void Delete ()
 
void Register (void *obj)
 
virtual void UnRegister (void *obj)
 
int GetReferenceCount ()
 
void SetReferenceCount (int)
 
- Public Member Functions inherited from albaObject
 albaObject ()
 
virtual ~albaObject ()
 
virtual void Delete ()
 
virtual const char * GetTypeName () const
 
virtual bool IsA (const char *type_name) const
 
virtual bool IsA (const albaTypeID &type_id) const
 
virtual albaObjectNewObjectInstance () const =0
 
virtual const albaTypeIDGetTypeId () const
 
virtual void Print (std::ostream &os, const int indent=0) const
 
 albaObject (const albaObject &c)
 
- Public Member Functions inherited from albaObserver
 albaObserver ()
 
virtual ~albaObserver ()
 
virtual void OnEvent (albaEventBase *e)=0
 
- Public Member Functions inherited from albaEventBroadcaster
 albaEventBroadcaster (void *owner=NULL)
 
virtual ~albaEventBroadcaster ()
 
 albaEventBroadcaster (const albaEventBroadcaster &c)
 
void AddObserver (albaObserver *obj)
 
void AddObserver (albaObserver &obj)
 
albaObserverCallbackAddObserverCallback (void(*f)(void *sender, albaID eid, void *clientdata, void *calldata))
 
bool RemoveObserver (albaObserver *obj)
 
void RemoveAllObservers ()
 
bool IsObserver (albaObserver *obj)
 
bool HasObservers ()
 
void GetObservers (std::vector< albaObserver * > &olist)
 
void InvokeEvent (albaEventBase &e)
 
void InvokeEvent (albaEventBase *e)
 
void InvokeEvent (void *sender, albaID id=ID_NO_EVENT, void *data=NULL)
 
void SetChannel (albaID ch)
 
albaID GetChannel ()
 
virtual void SetListener (albaObserver *o)
 
- Public Member Functions inherited from albaEventSender
 albaEventSender ()
 
virtual void SetListener (albaObserver *o)
 
virtual albaObserverGetListener ()
 
virtual bool HasListener ()
 
virtual void InvokeEvent (albaEventBase &e)
 
virtual void InvokeEvent (albaEventBase *e)
 
virtual void InvokeEvent (void *sender, albaID id=ID_NO_EVENT, void *data=NULL)
 
- Public Member Functions inherited from albaStorable
 albaStorable ()
 
int Store (albaStorageElement *element)
 
int Restore (albaStorageElement *element)
 
albaObjectCastToObject ()
 
bool IsStorable ()
 

Protected Member Functions

virtual int InternalStore (albaStorageElement *node)
 
virtual int InternalRestore (albaStorageElement *node)
 
 albaInteractorSER ()
 
virtual ~albaInteractorSER ()
 
- Protected Member Functions inherited from albaInteractor
virtual int OnStartInteraction (albaEventInteraction *e)
 
virtual int OnStopInteraction (albaEventInteraction *e)
 
virtual void OnButtonDown (albaEventInteraction *e)
 
virtual void OnButtonUp (albaEventInteraction *e)
 
void ComputeDisplayToWorld (double x, double y, double z, double worldPt[4])
 
void ComputeWorldToDisplay (double x, double y, double z, double displayPt[3])
 
- Protected Member Functions inherited from albaAgent
 albaAgent ()
 
virtual ~albaAgent ()
 
virtual int InternalInitialize ()
 
virtual void InternalShutdown ()
 
void InvokeEvent (albaEventBase &event, albaID channel=-1)
 
void InvokeEvent (albaEventBase *event, albaID channel=-1)
 
void InvokeEvent (void *sender, int id, albaID channel=MCH_UP, void *data=NULL)
 
virtual int InternalStore (albaStorageElement *node)=0
 
virtual int InternalRestore (albaStorageElement *node)=0
 

Protected Attributes

mmuActionsMap m_Actions
 
- Protected Attributes inherited from albaInteractor
albaDevicem_Device
 
bool m_DeviceIsSet
 
albaID m_StartInteractionEvent
 
albaID m_StopInteractionEvent
 
int m_IgnoreTriggerEvents
 
int m_InteractionFlag
 
int m_StartButton
 
unsigned long m_Modifiers
 
int m_CurrentButton
 
unsigned long m_CurrentModifier
 
int m_ButtonMode
 
int m_ButtonsCounter
 
albaVMEm_VME
 
albaViewm_View
 
vtkALBASmartPointer< vtkRenderer > m_Renderer
 
vtkALBASmartPointer< vtkProp3D > m_Prop
 
bool m_TestMode
 
- Protected Attributes inherited from albaAgent
albaString m_Name
 
bool m_Initialized
 
std::vector< albaEventBroadcaster * > m_Channels
 
- Protected Attributes inherited from albaReferenceCounted
int m_ReferenceCount
 
- Protected Attributes inherited from albaObject
bool m_HeapFlag
 
- Protected Attributes inherited from albaEventBroadcaster
albaObserversList m_Observers
 
albaID m_Channel
 
- Protected Attributes inherited from albaEventSender
albaObserverm_Listener
 
- Protected Attributes inherited from albaStorable
bool m_Storable
 

Additional Inherited Members

- Static Public Member Functions inherited from albaObject
static const char * GetStaticTypeName ()
 
static bool IsStaticType (const char *type_name)
 
static bool IsStaticType (const albaTypeID &type_id)
 
static const albaTypeIDGetStaticTypeId ()
 
static albaObjectSafeDownCast (albaObject *o)
 
- Static Public Member Functions inherited from albaStorable
static albaStorableSafeCastToObject (albaObject *o)
 
- Protected Types inherited from albaEventBroadcaster
typedef std::list< albaObserver * > albaObserversList
 

Detailed Description

Class implementing static routing from devices to interactors passing through actions.

This class routes events from input devices to interactors according to a static binding defined by user (or application logic). Devices are connected to "actions", special bridge agents that simply deliver events on the "DeviceInputChannelsEvents" coming from connected devices to any connected interactor, and events coming on the "DeviceOutputChannel", coming from any interactor to all connected devices. This allow the user to define how to use devices connected to the system, and the interactor to ignore which devices are providing inputs. Its clear that an interactor will ignore any event coming from incompatible devices. Currently there is not device type control implementation.

Todo:
  • to implement a type safe static binding mechanims

Definition at line 42 of file albaInteractorSER.h.

Member Typedef Documentation

◆ mmuActionsMap

Definition at line 76 of file albaInteractorSER.h.

Constructor & Destructor Documentation

◆ albaInteractorSER()

albaInteractorSER::albaInteractorSER ( )
protected

◆ ~albaInteractorSER()

virtual albaInteractorSER::~albaInteractorSER ( )
protectedvirtual

Member Function Documentation

◆ albaTypeMacro()

albaInteractorSER::albaTypeMacro ( albaInteractorSER  ,
albaInteractor   
)

◆ BindDeviceToAction() [1/2]

void albaInteractorSER::BindDeviceToAction ( albaDevice device,
albaAction action 
)

Un/Bind a device to an action.

◆ BindDeviceToAction() [2/2]

void albaInteractorSER::BindDeviceToAction ( albaDevice device,
const char *  action_name 
)

Un/Bind a device to an action.

◆ UnBindDeviceFromAction() [1/2]

void albaInteractorSER::UnBindDeviceFromAction ( albaDevice device,
albaAction action 
)

Un/Bind a device to an action.

◆ UnBindDeviceFromAction() [2/2]

void albaInteractorSER::UnBindDeviceFromAction ( albaDevice device,
const char *  action_name 
)

Un/Bind a device to an action.

◆ UnBindDeviceFromAllActions()

void albaInteractorSER::UnBindDeviceFromAllActions ( albaDevice device)

Unbind a device from all actions: used when a device is removed.

◆ GetDeviceBindings()

void albaInteractorSER::GetDeviceBindings ( albaDevice device,
std::vector< albaAction * > &  actions 
)

return list of device bindings to actions

◆ BindAction()

int albaInteractorSER::BindAction ( const char *  action,
albaInteractor agent 
)

Bind an agent to the specified action.

If the action is not present return -1

◆ UnBindAction()

int albaInteractorSER::UnBindAction ( const char *  action,
albaInteractor agent 
)

Unbind an agent from the specified action.

If the action is not present return -1

◆ AddAction() [1/2]

albaAction * albaInteractorSER::AddAction ( const char *  name,
float  priority = 0.0,
int  type = albaAction::SHARED_ACTION 
)

Define a new action router.

◆ AddAction() [2/2]

void albaInteractorSER::AddAction ( albaAction action,
float  priority = 0.0 
)

◆ GetAction()

albaAction * albaInteractorSER::GetAction ( const char *  name)

Get an action router.

◆ GetActions() [1/2]

void albaInteractorSER::GetActions ( std::vector< albaAction * > &  actions)

Return the actions container.

◆ GetActions() [2/2]

const mmuActionsMap * albaInteractorSER::GetActions ( )
inline

Definition at line 80 of file albaInteractorSER.h.

◆ InternalStore()

virtual int albaInteractorSER::InternalStore ( albaStorageElement node)
protectedvirtual

This is called by Store() and must be reimplemented by subclasses.

The node element where the object should store itself is passed as argument.

Implements albaStorable.

◆ InternalRestore()

virtual int albaInteractorSER::InternalRestore ( albaStorageElement node)
protectedvirtual

This is called by Restore() and must be reimplemented by subclasses The element from which the object should restore itself is passed as argument.

Implements albaStorable.

Member Data Documentation

◆ m_Actions

mmuActionsMap albaInteractorSER::m_Actions
protected

takes a list of the active actions

Definition at line 89 of file albaInteractorSER.h.


The documentation for this class was generated from the following file: