ALBA
|
#include <albaInteractionManager.h>
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) |
albaDeviceManager * | GetDeviceManager () |
albaDeviceButtonsPadMouse * | GetMouseDevice () |
albaAction * | AddAction (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) |
albaAvatar * | GetAvatar (const char *name) |
const mmuAvatarsMap & | GetAvatars () |
void | GetAvatars (mmuAvatarsVector &avatars) |
albaAction * | GetAction (const char *name) |
void | ViewSelected (albaView *view) |
albaView * | GetSelectedView (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) |
albaInteractorPER * | GetPER () |
void | SetPER (albaInteractorPER *per) |
void | PushPER (albaInteractorPER *per) |
bool | PopPER () |
albaInteractorSER * | GetSER () |
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 () |
albaGUI * | GetGui () |
albaInteractorSER * | GetStaticEventRouter () |
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 albaObject * | NewObjectInstance () const =0 |
virtual const albaTypeID & | GetTypeId () 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 albaObserver * | GetListener () |
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) |
albaObject * | CastToObject () |
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 | |
albaGUI * | m_Gui |
wxFrame * | m_Frame |
albaGUI * | m_Devices |
albaGUITree * | m_DeviceTree |
albaGUICheckListBox * | m_ActionsList |
albaGUIHolder * | m_SettingsPanel |
albaGUI * | m_Bindings |
albaDevice * | m_CurrentDevice |
albaString | m_SettingFileName |
albaDeviceManager * | m_DeviceManager |
albaInteractorPER * | m_PositionalEventRouter |
albaInteractorSER * | m_StaticEventRouter |
mmuAvatarsMap | m_Avatars |
std::list< albaInteractorPER * > | m_PERList |
std::set< albaView * > | m_CameraUpdateRequests |
albaView * | m_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 | |
albaObserver * | m_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 albaTypeID & | GetStaticTypeId () |
static albaObject * | SafeDownCast (albaObject *o) |
Static Public Member Functions inherited from albaStorable | |
static albaStorable * | SafeCastToObject (albaObject *o) |
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.
Definition at line 84 of file albaInteractionManager.h.
typedef std::map<albaString,albaAutoPointer<albaAvatar> > albaInteractionManager::mmuAvatarsMap |
Definition at line 129 of file albaInteractionManager.h.
typedef std::vector<albaAvatar *> albaInteractionManager::mmuAvatarsVector |
Definition at line 130 of file albaInteractionManager.h.
albaInteractionManager::albaInteractionManager | ( | ) |
|
virtual |
albaInteractionManager::albaTypeMacro | ( | albaInteractionManager | , |
albaObject | |||
) |
void albaInteractionManager::EnableSelect | ( | bool | enable | ) |
Enable/Disable VME selection by picking.
|
virtual |
Process incoming events.
Implements albaObserver.
|
inline |
Get the device manager object.
Definition at line 99 of file albaInteractionManager.h.
albaDeviceButtonsPadMouse * albaInteractionManager::GetMouseDevice | ( | ) |
return the mouse device
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.
int albaInteractionManager::BindAction | ( | const char * | action, |
albaInteractor * | agent | ||
) |
Bind an agent to the specified action.
If the action is not present return -1
int albaInteractionManager::UnBindAction | ( | const char * | action, |
albaInteractor * | agent | ||
) |
Unbind an agent from the specified action.
If the action is not present return -1
void albaInteractionManager::AddAvatar | ( | albaAvatar * | avatar | ) |
Define a new avatar.
int albaInteractionManager::RemoveAvatar | ( | albaAvatar * | avatar | ) |
Remove an avatar.
albaAvatar * albaInteractionManager::GetAvatar | ( | const char * | name | ) |
Get an avatar given its name.
const mmuAvatarsMap & albaInteractionManager::GetAvatars | ( | ) |
Return the avatars container.
void albaInteractionManager::GetAvatars | ( | mmuAvatarsVector & | avatars | ) |
return an array with the list of avatars currently connected
albaAction * albaInteractionManager::GetAction | ( | const char * | name | ) |
Get an action router.
void albaInteractionManager::ViewSelected | ( | albaView * | view | ) |
Set the selected view.
This makes all dynamic avatars and interactors to be informed of the current renderer.
Return the currently selected view.
Definition at line 146 of file albaInteractionManager.h.
void albaInteractionManager::SetCurrentRenderer | ( | vtkRenderer * | ren | ) |
Set the selected VTK renderer.
|
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.
void albaInteractionManager::PreResetCamera | ( | vtkRenderer * | ren | ) |
used to propagate PreReset camera event
void albaInteractionManager::PostResetCamera | ( | vtkRenderer * | ren | ) |
used to propagate PostReset camera event
void albaInteractionManager::VmeSelected | ( | albaVME * | vme | ) |
propagate VME_SELECTED event
int albaInteractionManager::Store | ( | const char * | filename | ) |
store all interaction settings to an XML file (Multimod Interaction Settings - MIS - format)
int albaInteractionManager::Restore | ( | const char * | filename | ) |
restore interaction settings from an XML file (Multimod Interaction Settings - MIS - format)
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
|
inline |
return the positional event router
Definition at line 181 of file albaInteractionManager.h.
void albaInteractionManager::SetPER | ( | albaInteractorPER * | per | ) |
used to override the default PER.
To be called before initializations
void albaInteractionManager::PushPER | ( | albaInteractorPER * | per | ) |
set a new PER and keep the old one in a list
bool albaInteractionManager::PopPER | ( | ) |
restore previous PER instance
|
inline |
return the static event router
Definition at line 193 of file albaInteractionManager.h.
void albaInteractionManager::CameraFlyToMode | ( | ) |
Set the FlyTo mode for the selected view.
|
inline |
return the minimum time to elapse between two subsequent renderings
Definition at line 199 of file albaInteractionManager.h.
|
inline |
set the minimum time to elapse between two subsequent renderings
Definition at line 201 of file albaInteractionManager.h.
int albaInteractionManager::DeviceChooser | ( | wxString & | dev_name, |
wxString & | dev_type | ||
) |
Open a dialog to choose among available devices.
void albaInteractionManager::AddDeviceToTree | ( | albaDevice * | device, |
albaDeviceSet * | parent = NULL |
||
) |
This is used to allow also external objects to add devices.
void albaInteractionManager::RemoveDeviceFromTree | ( | albaDevice * | device | ) |
void albaInteractionManager::UpdateDevice | ( | albaDevice * | device | ) |
Update names in device list.
Update the name of a device
void albaInteractionManager::UpdateBindings | ( | ) |
update bindings check list
albaGUI * albaInteractionManager::GetGui | ( | ) |
Show in modal configuration the settings dialog.
|
inline |
Definition at line 223 of file albaInteractionManager.h.
|
protectedvirtual |
|
protectedvirtual |
This is called by Restore() to restore information of this object.
Implements albaStorable.
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protected |
Create the GUI dialog.
|
protected |
Definition at line 246 of file albaInteractionManager.h.
|
protected |
Definition at line 247 of file albaInteractionManager.h.
|
protected |
Definition at line 249 of file albaInteractionManager.h.
|
protected |
Definition at line 250 of file albaInteractionManager.h.
|
protected |
Definition at line 251 of file albaInteractionManager.h.
|
protected |
Definition at line 252 of file albaInteractionManager.h.
|
protected |
Definition at line 254 of file albaInteractionManager.h.
|
protected |
Definition at line 256 of file albaInteractionManager.h.
|
protected |
Definition at line 257 of file albaInteractionManager.h.
|
protected |
Definition at line 259 of file albaInteractionManager.h.
|
protected |
Definition at line 260 of file albaInteractionManager.h.
|
protected |
Definition at line 261 of file albaInteractionManager.h.
|
protected |
keeps a list of visible avatars
Definition at line 263 of file albaInteractionManager.h.
|
protected |
the interactor devoted to Positional Event Routing
Definition at line 264 of file albaInteractionManager.h.
|
protected |
requests for Camera update of single views
Definition at line 266 of file albaInteractionManager.h.
|
protected |
the view currently selected
Definition at line 268 of file albaInteractionManager.h.
|
protected |
the renderer of selected view: to be removed!
Definition at line 269 of file albaInteractionManager.h.
|
protected |
Definition at line 270 of file albaInteractionManager.h.
|
protected |
used to avoid overloading of the GUI process due to rendering
Definition at line 271 of file albaInteractionManager.h.
|
protected |
the minimum time to elapse between two subsequent renderings
Definition at line 272 of file albaInteractionManager.h.