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

#include <albaInteractionManager.h>

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

Public Types

typedef std::map< albaString, albaAutoPointer< albaAvatar > > mmuAvatarsMap
 
typedef std::vector< albaAvatar * > mmuAvatarsVector
 

Public Member Functions

 albaInteractionManager ()
 
virtual ~albaInteractionManager ()
 
 albaTypeMacro (albaInteractionManager, albaObject)
 
void EnableSelect (bool enable)
 
virtual void OnEvent (albaEventBase *event)
 
albaDeviceManagerGetDeviceManager ()
 
albaDeviceButtonsPadMouseGetMouseDevice ()
 
albaActionAddAction (const char *name, float priority=0.0)
 
int BindAction (const char *action, albaInteractor *agent)
 
int UnBindAction (const char *action, albaInteractor *agent)
 
void AddAvatar (albaAvatar *avatar)
 
int RemoveAvatar (albaAvatar *avatar)
 
albaAvatarGetAvatar (const char *name)
 
const mmuAvatarsMapGetAvatars ()
 
void GetAvatars (mmuAvatarsVector &avatars)
 
albaActionGetAction (const char *name)
 
void ViewSelected (albaView *view)
 
albaViewGetSelectedView (albaView *view)
 
void SetCurrentRenderer (vtkRenderer *ren)
 
vtkRenderer * GetCurrentRenderer ()
 
void PreResetCamera (vtkRenderer *ren)
 
void PostResetCamera (vtkRenderer *ren)
 
void VmeSelected (albaVME *vme)
 
int Store (const char *filename)
 
int Restore (const char *filename)
 
void CameraUpdate (albaView *view=NULL)
 
albaInteractorPERGetPER ()
 
void SetPER (albaInteractorPER *per)
 
void PushPER (albaInteractorPER *per)
 
bool PopPER ()
 
albaInteractorSERGetSER ()
 
void CameraFlyToMode ()
 
albaTimeStamp GetIntraFrameTime ()
 
void SetIntraFrameTime (albaTimeStamp iftime)
 
int DeviceChooser (wxString &dev_name, wxString &dev_type)
 
void AddDeviceToTree (albaDevice *device, albaDeviceSet *parent=NULL)
 
void RemoveDeviceFromTree (albaDevice *device)
 
void UpdateDevice (albaDevice *device)
 
void UpdateBindings ()
 
albaGUIGetGui ()
 
albaInteractorSERGetStaticEventRouter ()
 
- 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 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)
 
virtual void OnStartDispatching ()
 
virtual void OnEndDispatching ()
 
virtual void OnCameraUpdate (albaEventBase *e)
 
virtual void OnViewSelected (albaEvent *event)
 
virtual void OnDeviceAdded (albaEventBase *event)
 
virtual void OnDeviceRemoving (albaEventBase *event)
 
virtual void OnDeviceNameChanged (albaEventBase *event)
 
virtual void OnBindDeviceToAction (albaEvent *e)
 
virtual void OnAddAvatar (albaEventBase *event)
 
virtual void OnRemoveAvatar (albaEventBase *event)
 
void CreateGUI ()
 
virtual int InternalStore (albaStorageElement *node)=0
 
virtual int InternalRestore (albaStorageElement *node)=0
 

Protected Attributes

albaGUIm_Gui
 
wxFrame * m_Frame
 
albaGUIm_Devices
 
albaGUITreem_DeviceTree
 
albaGUICheckListBoxm_ActionsList
 
albaGUIHolderm_SettingsPanel
 
albaGUIm_Bindings
 
albaDevicem_CurrentDevice
 
albaString m_SettingFileName
 
albaDeviceManagerm_DeviceManager
 
albaInteractorPERm_PositionalEventRouter
 
albaInteractorSERm_StaticEventRouter
 
mmuAvatarsMap m_Avatars
 
std::list< albaInteractorPER * > m_PERList
 
std::set< albaView * > m_CameraUpdateRequests
 
albaViewm_SelectedView
 
vtkRenderer * m_CurrentRenderer
 
int m_LockRenderingFlag
 
albaTimeStamp m_LastRenderTime
 
albaTimeStamp m_IntraFrameTime
 
- Protected Attributes inherited from albaObject
bool m_HeapFlag
 
- 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)
 

Detailed Description

This class takes care of mastering the interaction inside views.

This class is responsible to coordinate interaction, i.e. resources necessary for interaction (currently devices, actions and avatars) and to manage communication routing for interaction. Management of devices is delegated to the DeviceManager object, picking and routing of events to picked VME is delegated to PER (positional event router) object, and low level routing from devices to actions is delegated to the SER (static event router) object.

See also
albaDeviceManager albaInteractorPER albaInteractorSER
Todo:
  • check the renderer to be RenFront

Definition at line 84 of file albaInteractionManager.h.

Member Typedef Documentation

◆ mmuAvatarsMap

Definition at line 129 of file albaInteractionManager.h.

◆ mmuAvatarsVector

Definition at line 130 of file albaInteractionManager.h.

Constructor & Destructor Documentation

◆ albaInteractionManager()

albaInteractionManager::albaInteractionManager ( )

◆ ~albaInteractionManager()

virtual albaInteractionManager::~albaInteractionManager ( )
virtual

Member Function Documentation

◆ albaTypeMacro()

albaInteractionManager::albaTypeMacro ( albaInteractionManager  ,
albaObject   
)

◆ EnableSelect()

void albaInteractionManager::EnableSelect ( bool  enable)

Enable/Disable VME selection by picking.

◆ OnEvent()

virtual void albaInteractionManager::OnEvent ( albaEventBase event)
virtual

Process incoming events.

Implements albaObserver.

◆ GetDeviceManager()

albaDeviceManager * albaInteractionManager::GetDeviceManager ( )
inline

Get the device manager object.

Definition at line 99 of file albaInteractionManager.h.

◆ GetMouseDevice()

albaDeviceButtonsPadMouse * albaInteractionManager::GetMouseDevice ( )

return the mouse device

◆ AddAction()

albaAction * albaInteractionManager::AddAction ( const char *  name,
float  priority = 0.0 
)

return the mouse action, an action to which mouse is bound by default

Define a new action router.

◆ BindAction()

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

Bind an agent to the specified action.

If the action is not present return -1

◆ UnBindAction()

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

Unbind an agent from the specified action.

If the action is not present return -1

◆ AddAvatar()

void albaInteractionManager::AddAvatar ( albaAvatar avatar)

Define a new avatar.

◆ RemoveAvatar()

int albaInteractionManager::RemoveAvatar ( albaAvatar avatar)

Remove an avatar.

◆ GetAvatar()

albaAvatar * albaInteractionManager::GetAvatar ( const char *  name)

Get an avatar given its name.

◆ GetAvatars() [1/2]

const mmuAvatarsMap & albaInteractionManager::GetAvatars ( )

Return the avatars container.

◆ GetAvatars() [2/2]

void albaInteractionManager::GetAvatars ( mmuAvatarsVector avatars)

return an array with the list of avatars currently connected

◆ GetAction()

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

Get an action router.

◆ ViewSelected()

void albaInteractionManager::ViewSelected ( albaView view)

Set the selected view.

This makes all dynamic avatars and interactors to be informed of the current renderer.

◆ GetSelectedView()

albaView * albaInteractionManager::GetSelectedView ( albaView view)
inline

Return the currently selected view.

Definition at line 146 of file albaInteractionManager.h.

◆ SetCurrentRenderer()

void albaInteractionManager::SetCurrentRenderer ( vtkRenderer *  ren)

Set the selected VTK renderer.

◆ GetCurrentRenderer()

vtkRenderer * albaInteractionManager::GetCurrentRenderer ( )
inline

Return the renderer of the currently selected view, if its a VTK based view otherwise return NULL.

Definition at line 153 of file albaInteractionManager.h.

◆ PreResetCamera()

void albaInteractionManager::PreResetCamera ( vtkRenderer *  ren)

used to propagate PreReset camera event

◆ PostResetCamera()

void albaInteractionManager::PostResetCamera ( vtkRenderer *  ren)

used to propagate PostReset camera event

◆ VmeSelected()

void albaInteractionManager::VmeSelected ( albaVME vme)

propagate VME_SELECTED event

◆ Store()

int albaInteractionManager::Store ( const char *  filename)

store all interaction settings to an XML file (Multimod Interaction Settings - MIS - format)

◆ Restore()

int albaInteractionManager::Restore ( const char *  filename)

restore interaction settings from an XML file (Multimod Interaction Settings - MIS - format)

◆ CameraUpdate()

void albaInteractionManager::CameraUpdate ( albaView view = NULL)

propagate a request for rendering the specified window or all the windows (rw==NULL).

Requests arriving within a single event dispatching cycle are are fused into a single request Queue a request for rendering for the specified view. Default is render all views

◆ GetPER()

albaInteractorPER * albaInteractionManager::GetPER ( )
inline

return the positional event router

Definition at line 181 of file albaInteractionManager.h.

◆ SetPER()

void albaInteractionManager::SetPER ( albaInteractorPER per)

used to override the default PER.

To be called before initializations

◆ PushPER()

void albaInteractionManager::PushPER ( albaInteractorPER per)

set a new PER and keep the old one in a list

◆ PopPER()

bool albaInteractionManager::PopPER ( )

restore previous PER instance

◆ GetSER()

albaInteractorSER * albaInteractionManager::GetSER ( )
inline

return the static event router

Definition at line 193 of file albaInteractionManager.h.

◆ CameraFlyToMode()

void albaInteractionManager::CameraFlyToMode ( )

Set the FlyTo mode for the selected view.

◆ GetIntraFrameTime()

albaTimeStamp albaInteractionManager::GetIntraFrameTime ( )
inline

return the minimum time to elapse between two subsequent renderings

Definition at line 199 of file albaInteractionManager.h.

◆ SetIntraFrameTime()

void albaInteractionManager::SetIntraFrameTime ( albaTimeStamp  iftime)
inline

set the minimum time to elapse between two subsequent renderings

Definition at line 201 of file albaInteractionManager.h.

◆ DeviceChooser()

int albaInteractionManager::DeviceChooser ( wxString &  dev_name,
wxString &  dev_type 
)

Open a dialog to choose among available devices.

◆ AddDeviceToTree()

void albaInteractionManager::AddDeviceToTree ( albaDevice device,
albaDeviceSet parent = NULL 
)

This is used to allow also external objects to add devices.

◆ RemoveDeviceFromTree()

void albaInteractionManager::RemoveDeviceFromTree ( albaDevice device)

◆ UpdateDevice()

void albaInteractionManager::UpdateDevice ( albaDevice device)

Update names in device list.

Update the name of a device

◆ UpdateBindings()

void albaInteractionManager::UpdateBindings ( )

update bindings check list

◆ GetGui()

albaGUI * albaInteractionManager::GetGui ( )

Show in modal configuration the settings dialog.

◆ GetStaticEventRouter()

albaInteractorSER * albaInteractionManager::GetStaticEventRouter ( )
inline

Definition at line 223 of file albaInteractionManager.h.

◆ InternalStore()

virtual int albaInteractionManager::InternalStore ( albaStorageElement node)
protectedvirtual

This is called by Store() to store information of this object.


Implements albaStorable.

◆ InternalRestore()

virtual int albaInteractionManager::InternalRestore ( albaStorageElement node)
protectedvirtual

This is called by Restore() to restore information of this object.

Implements albaStorable.

◆ OnStartDispatching()

virtual void albaInteractionManager::OnStartDispatching ( )
protectedvirtual

◆ OnEndDispatching()

virtual void albaInteractionManager::OnEndDispatching ( )
protectedvirtual

◆ OnCameraUpdate()

virtual void albaInteractionManager::OnCameraUpdate ( albaEventBase e)
protectedvirtual

◆ OnViewSelected()

virtual void albaInteractionManager::OnViewSelected ( albaEvent event)
protectedvirtual

◆ OnDeviceAdded()

virtual void albaInteractionManager::OnDeviceAdded ( albaEventBase event)
protectedvirtual

◆ OnDeviceRemoving()

virtual void albaInteractionManager::OnDeviceRemoving ( albaEventBase event)
protectedvirtual

◆ OnDeviceNameChanged()

virtual void albaInteractionManager::OnDeviceNameChanged ( albaEventBase event)
protectedvirtual

◆ OnBindDeviceToAction()

virtual void albaInteractionManager::OnBindDeviceToAction ( albaEvent e)
protectedvirtual

◆ OnAddAvatar()

virtual void albaInteractionManager::OnAddAvatar ( albaEventBase event)
protectedvirtual

◆ OnRemoveAvatar()

virtual void albaInteractionManager::OnRemoveAvatar ( albaEventBase event)
protectedvirtual

◆ CreateGUI()

void albaInteractionManager::CreateGUI ( )
protected

Create the GUI dialog.

Member Data Documentation

◆ m_Gui

albaGUI* albaInteractionManager::m_Gui
protected

Definition at line 246 of file albaInteractionManager.h.

◆ m_Frame

wxFrame* albaInteractionManager::m_Frame
protected

Definition at line 247 of file albaInteractionManager.h.

◆ m_Devices

albaGUI* albaInteractionManager::m_Devices
protected

Definition at line 249 of file albaInteractionManager.h.

◆ m_DeviceTree

albaGUITree* albaInteractionManager::m_DeviceTree
protected

Definition at line 250 of file albaInteractionManager.h.

◆ m_ActionsList

albaGUICheckListBox* albaInteractionManager::m_ActionsList
protected

Definition at line 251 of file albaInteractionManager.h.

◆ m_SettingsPanel

albaGUIHolder* albaInteractionManager::m_SettingsPanel
protected

Definition at line 252 of file albaInteractionManager.h.

◆ m_Bindings

albaGUI* albaInteractionManager::m_Bindings
protected

Definition at line 254 of file albaInteractionManager.h.

◆ m_CurrentDevice

albaDevice* albaInteractionManager::m_CurrentDevice
protected

Definition at line 256 of file albaInteractionManager.h.

◆ m_SettingFileName

albaString albaInteractionManager::m_SettingFileName
protected

Definition at line 257 of file albaInteractionManager.h.

◆ m_DeviceManager

albaDeviceManager* albaInteractionManager::m_DeviceManager
protected

Definition at line 259 of file albaInteractionManager.h.

◆ m_PositionalEventRouter

albaInteractorPER* albaInteractionManager::m_PositionalEventRouter
protected

Definition at line 260 of file albaInteractionManager.h.

◆ m_StaticEventRouter

albaInteractorSER* albaInteractionManager::m_StaticEventRouter
protected

Definition at line 261 of file albaInteractionManager.h.

◆ m_Avatars

mmuAvatarsMap albaInteractionManager::m_Avatars
protected

keeps a list of visible avatars

Definition at line 263 of file albaInteractionManager.h.

◆ m_PERList

std::list<albaInteractorPER *> albaInteractionManager::m_PERList
protected

the interactor devoted to Positional Event Routing

Definition at line 264 of file albaInteractionManager.h.

◆ m_CameraUpdateRequests

std::set<albaView *> albaInteractionManager::m_CameraUpdateRequests
protected

requests for Camera update of single views

Definition at line 266 of file albaInteractionManager.h.

◆ m_SelectedView

albaView* albaInteractionManager::m_SelectedView
protected

the view currently selected

Definition at line 268 of file albaInteractionManager.h.

◆ m_CurrentRenderer

vtkRenderer* albaInteractionManager::m_CurrentRenderer
protected

the renderer of selected view: to be removed!

Definition at line 269 of file albaInteractionManager.h.

◆ m_LockRenderingFlag

int albaInteractionManager::m_LockRenderingFlag
protected

Definition at line 270 of file albaInteractionManager.h.

◆ m_LastRenderTime

albaTimeStamp albaInteractionManager::m_LastRenderTime
protected

used to avoid overloading of the GUI process due to rendering

Definition at line 271 of file albaInteractionManager.h.

◆ m_IntraFrameTime

albaTimeStamp albaInteractionManager::m_IntraFrameTime
protected

the minimum time to elapse between two subsequent renderings

Definition at line 272 of file albaInteractionManager.h.


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