17#ifndef __albaEventInteraction_h
18#define __albaEventInteraction_h
69 unsigned char GetKey() {
return m_Key;}
102 albaEventBase(sender,id),m_Button(button),m_Modifiers(modifiers),m_Key(0),m_X(0),m_Y(0),m_XYFlag(false) {ResetPick();}
106 albaEventBase(sender,id),m_Button(button),m_Modifiers(modifiers),m_Key(0),m_Matrix(matrix),m_X(0),m_Y(0),m_XYFlag(false) {ResetPick();}
110 albaEventBase(sender,id),m_X(x),m_Y(y),m_XYFlag(true),m_Button(button),m_Modifiers(modifiers),m_Key(0) {ResetPick();}
122 double m_PickedPosition[3];
long albaID
type for IDs inside ALBA
Hold a reference to a T instance.
This abstract class manages function calls coming from devices and issue specific events to interacto...
Implementation of the message object for the Subject/Observer design pattern.
Event class to transport a triggering button and a position from pointing devices.
void Set2DPosition(const double pos[2])
Set screen position, for 2D tracking devices.
albaEventInteraction(void *sender, albaID id, albaMatrix *matrix, int button=0, unsigned long modifiers=0)
overloaded constructor
albaView * m_PickView
View used by the cached picking.
albaDevice * m_PickDevice
Device used by the cached picking.
albaInteractor * m_PickedBehavior
Cached behavior of the picked VME.
void ResetPick()
Discard the cached picking, to be called when the scene or the camera has been changed.
void SetMatrix(albaMatrix *matrix)
Set the pose matrix, for 3D tracking devices.
void SetKey(unsigned char key)
Set the optional key argument.
void SetModifiers(unsigned long modifiers)
Set the given modifiers value.
void SetModifier(unsigned long idx, bool value=true)
Set the given modifier value.
void Get2DPosition(double pos[2])
Get screen position, for 2D tracking devices.
virtual ~albaEventInteraction()
unsigned char m_Key
Optional Key.
double m_X
X coordinate, used by mouse device.
albaEventInteraction(void *sender=NULL, albaID id=-1, int button=0, unsigned long modifiers=0)
overloaded constructor
albaVME * m_PickedVme
Cached picked VME.
bool m_XYFlag
Used to signal a 2D coordinate is present.
virtual void DeepCopy(const albaEventBase *event)
Deep Copy of the object (the cached picking is not copied)
bool GetXYFlag()
get the flag for 2D coords
void Set2DPosition(double x, double y)
Set screen position, for 2D tracking devices.
unsigned long GetModifiers()
Get the given modifiers value.
bool m_Picked
True if the cached picking found a VME.
vtkProp3D * m_PickedProp
Cached picked prop.
albaAutoPointer< albaMatrix > m_Matrix
Pose matrix, used by 3D trackers.
albaEventInteraction(void *sender, albaID id, double x, double y, int button=0, unsigned long modifiers=0)
overloaded constructor
albaTypeMacro(albaEventInteraction, albaEventBase)
RTTI macro.
void SetXYFlag(bool val)
set the flag for 2D coords
bool m_PickDone
True if the picking has been performed for this event.
double m_Y
Y coordinate, used by mouse device.
unsigned long m_Modifiers
Optional modifiers for the button.
void GetPickedPosition(double pos[3])
Return the position picked by FindPokedVme, meaningful only if a VME has been picked.
void SetButton(int button)
Set the triggering button.
bool GetModifier(unsigned long idx)
Get the given modifier value.
int GetButton()
Get the triggering button.
albaMatrix * GetMatrix()
Get the pose matrix, for 3D tracking devices.
int m_Button
Optional button which triggered the event.
unsigned char GetKey()
Get the optional key argument.
bool FindPokedVme(albaView *view, albaDevice *device, vtkProp3D *&pickedProp, albaVME *&pickedVme, albaInteractor *&pickedBehavior)
Find the VME picked by the device at the event position on the given view.
Abstract class for ALBA interactors This class provides base interface and features of ALBA continuou...
albaMatrix - Time stamped 4x4 Matrix.
albaView is the base class for Views in alba.