ALBA
Classes | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
albaInteractorPER Class Reference

#include <albaInteractorPER.h>

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

Classes

class  DeviceItem
 

Public Types

enum  modalities { SINGLE_BUTTON =0 , MULTI_BUTTON }
 
- Public Types inherited from albaInteractor
enum  modalities { SINGLE_BUTTON_MODE =0 , MULTI_BUTTON_MODE }
 

Public Member Functions

 albaTypeMacro (albaInteractorPER, albaInteractor)
 
virtual void EnableSelect (bool enable)
 
virtual void FlyToMode ()
 
bool IsInteracting (albaDevice *device, int button=-1)
 
virtual int StartInteraction (albaDevice *device, int button)
 
virtual int StopInteraction (albaDevice *device, int button)
 
virtual void OnEvent (albaEventBase *event)
 
void OnVmeSelected (albaVME *vme)
 
void SetMode (int mode)
 
int GetMode ()
 
void SetModeToSingleButton ()
 
void SetModeToMultiButton ()
 
albaInteractorGetCameraMouseInteractor ()
 
albaInteractorGetCameraInteractor ()
 
- 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)
 

Protected Member Functions

 albaInteractorPER ()
 
virtual ~albaInteractorPER ()
 
virtual int OnStartInteraction (albaEventInteraction *e)
 
virtual int OnStopInteraction (albaEventInteraction *e)
 
virtual void OnButtonDown (albaEventInteraction *e)
 
virtual void OnButtonUp (albaEventInteraction *e)
 
virtual void OnLeftButtonDown (albaEventInteraction *e)
 
virtual void OnLeftButtonUp (albaEventInteraction *e)
 
virtual void OnMiddleButtonDown (albaEventInteraction *e)
 
virtual void OnMiddleButtonUp (albaEventInteraction *e)
 
virtual void OnRightButtonDown (albaEventInteraction *e)
 
virtual void OnRightButtonUp (albaEventInteraction *e)
 
virtual void OnMove (albaEventInteraction *e)
 
virtual void OnChar (albaEventInteraction *e)
 
virtual void FlyTo (albaEventInteraction *e, int numstep=20, double zoom=1)
 
void InsertDevice (albaDevice *device, int button)
 
void RemoveDevice (albaDevice *device)
 
void SetCurrentBehavior (albaDevice *device, albaInteractor *inter)
 
albaInteractorGetCurrentBehavior (albaDevice *device)
 
void SetPickedVME (albaDevice *device, albaVME *vme)
 
albaVMEGetPickedVME (albaDevice *device)
 
- 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)
 

Protected Attributes

bool m_FlyToFlag
 
bool m_DraggingLeft
 
bool m_CanSelect
 
bool m_ShowContextMenu
 
int m_Mode
 
int m_FirstTime
 
albaInteractorm_CameraBehavior
 
albaInteractorm_CameraMouseBehavior
 
std::map< albaID, DeviceItemm_Devices
 
- 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
 

Friends

class albaInteractorPERTest
 

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)
 
- Protected Types inherited from albaEventBroadcaster
typedef std::list< albaObserver * > albaObserversList
 

Detailed Description

Class implementing routing of events based on picking.

This class routes events from input devices depending on picking information. After first picking events are routed to interactor assigned to picked node until interaction is finished. To be completed... This is a refactoring of albaISV class by Silvano Imboden

Todo:
  • complete documentation
  • create interactor for CameraBehavior
  • manage sending events to logic (VME_SELECT, CAMERA_FIT the

Definition at line 39 of file albaInteractorPER.h.

Member Enumeration Documentation

◆ modalities

Enumerator
SINGLE_BUTTON 
MULTI_BUTTON 

Definition at line 65 of file albaInteractorPER.h.

Constructor & Destructor Documentation

◆ albaInteractorPER()

albaInteractorPER::albaInteractorPER ( )
protected

◆ ~albaInteractorPER()

virtual albaInteractorPER::~albaInteractorPER ( )
protectedvirtual

Member Function Documentation

◆ albaTypeMacro()

albaInteractorPER::albaTypeMacro ( albaInteractorPER  ,
albaInteractor   
)

◆ EnableSelect()

virtual void albaInteractorPER::EnableSelect ( bool  enable)
inlinevirtual

Definition at line 44 of file albaInteractorPER.h.

◆ FlyToMode()

virtual void albaInteractorPER::FlyToMode ( )
inlinevirtual

Enable fly to mode: next click will select where to fly to.

Definition at line 47 of file albaInteractorPER.h.

◆ IsInteracting()

bool albaInteractorPER::IsInteracting ( albaDevice device,
int  button = -1 
)

return true if device is in the set of devices currently interacting the optional parameter can be used in SINGLE_BUTTON mode to know if interaction has been started by a specific button.

◆ StartInteraction()

virtual int albaInteractorPER::StartInteraction ( albaDevice device,
int  button 
)
virtual

Redefined to support multiple input devices.

◆ StopInteraction()

virtual int albaInteractorPER::StopInteraction ( albaDevice device,
int  button 
)
virtual

Redefined to support multiple input devices.

◆ OnEvent()

virtual void albaInteractorPER::OnEvent ( albaEventBase event)
virtual

◆ OnVmeSelected()

void albaInteractorPER::OnVmeSelected ( albaVME vme)
inline

Definition at line 63 of file albaInteractorPER.h.

References albaInteractor::GetDevice().

Here is the call graph for this function:

◆ SetMode()

void albaInteractorPER::SetMode ( int  mode)
inline

Definition at line 67 of file albaInteractorPER.h.

◆ GetMode()

int albaInteractorPER::GetMode ( )
inline

Definition at line 68 of file albaInteractorPER.h.

◆ SetModeToSingleButton()

void albaInteractorPER::SetModeToSingleButton ( )
inline

Definition at line 69 of file albaInteractorPER.h.

◆ SetModeToMultiButton()

void albaInteractorPER::SetModeToMultiButton ( )
inline

Definition at line 70 of file albaInteractorPER.h.

◆ GetCameraMouseInteractor()

albaInteractor * albaInteractorPER::GetCameraMouseInteractor ( )
inline

Definition at line 72 of file albaInteractorPER.h.

◆ GetCameraInteractor()

albaInteractor * albaInteractorPER::GetCameraInteractor ( )
inline

Definition at line 74 of file albaInteractorPER.h.

◆ OnStartInteraction()

virtual int albaInteractorPER::OnStartInteraction ( albaEventInteraction e)
protectedvirtual

redefined to support the three buttons

Reimplemented from albaInteractor.

◆ OnStopInteraction()

virtual int albaInteractorPER::OnStopInteraction ( albaEventInteraction e)
protectedvirtual

redefined to support the three buttons

Reimplemented from albaInteractor.

◆ OnButtonDown()

virtual void albaInteractorPER::OnButtonDown ( albaEventInteraction e)
protectedvirtual

Perform a pick on start of interaction to find if the user pointed an object in the scene, and in case forward all the following events to its behavior.

if the user pointed to the background forward events to the camera interactor.

Reimplemented from albaInteractor.

Reimplemented in albaInteractor2DAngle, and albaInteractor2DIndicator.

◆ OnButtonUp()

virtual void albaInteractorPER::OnButtonUp ( albaEventInteraction e)
protectedvirtual

◆ OnLeftButtonDown()

virtual void albaInteractorPER::OnLeftButtonDown ( albaEventInteraction e)
protectedvirtual

◆ OnLeftButtonUp()

virtual void albaInteractorPER::OnLeftButtonUp ( albaEventInteraction e)
protectedvirtual

◆ OnMiddleButtonDown()

virtual void albaInteractorPER::OnMiddleButtonDown ( albaEventInteraction e)
protectedvirtual

◆ OnMiddleButtonUp()

virtual void albaInteractorPER::OnMiddleButtonUp ( albaEventInteraction e)
protectedvirtual

◆ OnRightButtonDown()

virtual void albaInteractorPER::OnRightButtonDown ( albaEventInteraction e)
protectedvirtual

◆ OnRightButtonUp()

virtual void albaInteractorPER::OnRightButtonUp ( albaEventInteraction e)
protectedvirtual

◆ OnMove()

virtual void albaInteractorPER::OnMove ( albaEventInteraction e)
protectedvirtual

◆ OnChar()

virtual void albaInteractorPER::OnChar ( albaEventInteraction e)
protectedvirtual

◆ FlyTo()

virtual void albaInteractorPER::FlyTo ( albaEventInteraction e,
int  numstep = 20,
double  zoom = 1 
)
protectedvirtual

internally used to fly to a clicked point

◆ InsertDevice()

void albaInteractorPER::InsertDevice ( albaDevice device,
int  button 
)
protected

insert a device in the set of devices currently interacting

◆ RemoveDevice()

void albaInteractorPER::RemoveDevice ( albaDevice device)
protected

remove a device in the set of devices currently interacting

◆ SetCurrentBehavior()

void albaInteractorPER::SetCurrentBehavior ( albaDevice device,
albaInteractor inter 
)
protected

internally used to set which behavior was picked by device

◆ GetCurrentBehavior()

albaInteractor * albaInteractorPER::GetCurrentBehavior ( albaDevice device)
protected

◆ SetPickedVME()

void albaInteractorPER::SetPickedVME ( albaDevice device,
albaVME vme 
)
protected

internally used to set VME picked by device at button down

◆ GetPickedVME()

albaVME * albaInteractorPER::GetPickedVME ( albaDevice device)
protected

internally used to return the picked VME for given device

Friends And Related Function Documentation

◆ albaInteractorPERTest

friend class albaInteractorPERTest
friend

test friend

Definition at line 145 of file albaInteractorPER.h.

Member Data Documentation

◆ m_FlyToFlag

bool albaInteractorPER::m_FlyToFlag
protected

Definition at line 121 of file albaInteractorPER.h.

◆ m_DraggingLeft

bool albaInteractorPER::m_DraggingLeft
protected

Definition at line 122 of file albaInteractorPER.h.

◆ m_CanSelect

bool albaInteractorPER::m_CanSelect
protected

Definition at line 123 of file albaInteractorPER.h.

◆ m_ShowContextMenu

bool albaInteractorPER::m_ShowContextMenu
protected

flag for showing the context menu

Definition at line 124 of file albaInteractorPER.h.

◆ m_Mode

int albaInteractorPER::m_Mode
protected

Definition at line 126 of file albaInteractorPER.h.

◆ m_FirstTime

int albaInteractorPER::m_FirstTime
protected

Definition at line 127 of file albaInteractorPER.h.

◆ m_CameraBehavior

albaInteractor* albaInteractorPER::m_CameraBehavior
protected

the camera interactor

Definition at line 128 of file albaInteractorPER.h.

◆ m_CameraMouseBehavior

albaInteractor* albaInteractorPER::m_CameraMouseBehavior
protected

the mouse camera interactor

Definition at line 129 of file albaInteractorPER.h.

◆ m_Devices

std::map<albaID,DeviceItem> albaInteractorPER::m_Devices
protected

Stores the list of devices currently interacting.

Definition at line 138 of file albaInteractorPER.h.


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