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

#include <albaAvatar.h>

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

Public Types

enum  AVATAR_GUI_ID { ID_NAME =MINID , ID_LAST }
 
enum  AvatarModality { MODE_2D =0 , MODE_3D }
 
- Public Types inherited from albaInteractor
enum  modalities { SINGLE_BUTTON_MODE =0 , MULTI_BUTTON_MODE }
 

Public Member Functions

 albaAbstractTypeMacro (albaAvatar, albaInteractor)
 
virtual void SetRendererAndView (vtkRenderer *ren, albaView *view)
 
void SetActor3D (vtkProp3D *avatar)
 
vtkProp3D * GetActor3D ()
 
void SetActor2D (vtkActor2D *avatar)
 
vtkActor2D * GetActor2D ()
 
virtual void Hide ()
 
virtual void Show ()
 
virtual void HideCursor3D ()
 
virtual void ShowCursor3D ()
 
virtual void HideCursor2D ()
 
virtual void ShowCursor2D ()
 
virtual int Pick (albaMatrix &pose)
 
virtual int Pick (double X, double Y)
 
virtual void OnEvent (albaEventBase *event)
 
albaDeviceButtonsPadTrackerGetTracker ()
 
virtual void SetTracker (albaDeviceButtonsPadTracker *tracker)
 
void SetMode (int mode)
 
int GetMode ()
 
void SetModeTo2D ()
 
void SetModeTo3D ()
 
virtual vtkAbstractPropPicker * GetPicker ()
 
albaGUIGetGui ()
 
virtual void CreateGui ()
 
virtual void UpdateGui ()
 
 ALBA_ID_DEC (AVATAR_SCREEN_PLANE_SETTINGS)
 
 ALBA_ID_DEC (AVATAR_WORKING_BOX_SETTINGS)
 
- 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

 albaAvatar ()
 
virtual ~albaAvatar ()
 
virtual int InternalStore (albaStorageElement *node)
 
virtual int InternalRestore (albaStorageElement *node)
 
virtual int InternalInitialize ()
 
virtual void InternalShutdown ()
 
virtual void OnPreResetCamera (albaEventBase *event)
 
virtual void OnPostResetCamera (albaEventBase *event)
 
virtual void OnViewSelected (albaEvent *e)
 
- 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

vtkALBASmartPointer< vtkProp3D > m_Actor3D
 
vtkALBASmartPointer< vtkActor2D > m_Actor2D
 
albaGUIm_Gui
 
int m_Mode
 
int m_Cursor3DHideCounter
 
int m_Cursor2DHideCounter
 
- 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

Avatars are entities moving in the virtual world according to user's movements, and thus representing their presence in the virtual world.

Specialized classes must set the Avatar variable with a vtkProp3D, this class will take care of adding it to the current renderer, moving, hiding and showing it at the right time. The Avatar moves according to an interactor, which must also be set by subclasses.

Definition at line 47 of file albaAvatar.h.

Member Enumeration Documentation

◆ AVATAR_GUI_ID

Enumerator
ID_NAME 
ID_LAST 

Definition at line 59 of file albaAvatar.h.

◆ AvatarModality

Enumerator
MODE_2D 
MODE_3D 

Definition at line 65 of file albaAvatar.h.

Constructor & Destructor Documentation

◆ albaAvatar()

albaAvatar::albaAvatar ( )
protected

◆ ~albaAvatar()

virtual albaAvatar::~albaAvatar ( )
protectedvirtual

Member Function Documentation

◆ albaAbstractTypeMacro()

albaAvatar::albaAbstractTypeMacro ( albaAvatar  ,
albaInteractor   
)

◆ SetRendererAndView()

virtual void albaAvatar::SetRendererAndView ( vtkRenderer *  ren,
albaView view 
)
virtual

Set the renderer this avatar is attached to.

When the rederer is changed, all props created by this avatar are moved to the new renderer and the interaction is changed accordingly

Reimplemented from albaInteractor.

Reimplemented in albaAvatar3D.

◆ SetActor3D()

void albaAvatar::SetActor3D ( vtkProp3D *  avatar)

Set the actor used to display the 3D cursor.

Attention
In case of ActivePositioning The initial vtkProp3D pose matrix is intended as relative to the camera, thus its stored in the AvatarTransform member and a new pose continuously changed according to the camera position is set to the vtkProp3D. Thus to change the pose of the graphics object visually representing the avatar the AvatarsTransform.

◆ GetActor3D()

vtkProp3D * albaAvatar::GetActor3D ( )
inline

Return the prop3D used for this avatar.

Definition at line 85 of file albaAvatar.h.

◆ SetActor2D()

void albaAvatar::SetActor2D ( vtkActor2D *  avatar)

Set the actor used to display the 2D cursor.

◆ GetActor2D()

vtkActor2D * albaAvatar::GetActor2D ( )
inline

Return the prop3D used for this avatar.

Definition at line 92 of file albaAvatar.h.

◆ Hide()

virtual void albaAvatar::Hide ( )
virtual

Hide all the Avatar's graphics actors, i.e.

remove actor from renderer's list. This is usually used to compute bounding box without considering avatars

Reimplemented in albaAvatar3D.

◆ Show()

virtual void albaAvatar::Show ( )
virtual

Show all the Avatar's graphics actors.

This function is conditional, in the sense the old visibility state is retained when showing back.

Reimplemented in albaAvatar3D.

◆ HideCursor3D()

virtual void albaAvatar::HideCursor3D ( )
virtual

Hide the Avatar's 3D cursor actor, i.e.

remove its actor from renderer's list.

◆ ShowCursor3D()

virtual void albaAvatar::ShowCursor3D ( )
virtual

Show the Avatar's 3D cursor actor.

This function is conditional, in the sense the old visibility state is retained when showing back.

◆ HideCursor2D()

virtual void albaAvatar::HideCursor2D ( )
virtual

Hide the Avatar's 2D cursor actor, i.e.

remove its actor from renderer's list.

◆ ShowCursor2D()

virtual void albaAvatar::ShowCursor2D ( )
virtual

Show the Avatar's 2D cursor actor.

This function is conditional, in the sense the old visibility state is retained when showing back.

◆ Pick() [1/2]

virtual int albaAvatar::Pick ( albaMatrix pose)
inlinevirtual

pick in the scene with this avatar, give the avatar pose

Reimplemented in albaAvatar3DCone.

Definition at line 123 of file albaAvatar.h.

◆ Pick() [2/2]

virtual int albaAvatar::Pick ( double  X,
double  Y 
)
inlinevirtual

Definition at line 124 of file albaAvatar.h.

◆ OnEvent()

virtual void albaAvatar::OnEvent ( albaEventBase event)
virtual

Process events coming from tracker.

Reimplemented from albaInteractor.

Reimplemented in albaAvatar3D.

◆ GetTracker()

albaDeviceButtonsPadTracker * albaAvatar::GetTracker ( )

Return settings object for this Avatar, and if not yet allocated create it.

Settings objects usually include a GUI for interactive settings. return the tracker attached to this avatar: the avatar usually follows the movements of the tracker

◆ SetTracker()

virtual void albaAvatar::SetTracker ( albaDeviceButtonsPadTracker tracker)
virtual

set the tracker attached to this avatar: the avatar usually follows the movements of the tracker

Reimplemented in albaAvatar3D.

◆ SetMode()

void albaAvatar::SetMode ( int  mode)
inline

Set Avatar modality: MODE_2D or MODE_3D.

Definition at line 144 of file albaAvatar.h.

◆ GetMode()

int albaAvatar::GetMode ( )
inline

return the current avatar modality.

This is used by avatars with a double bhavior.

Definition at line 147 of file albaAvatar.h.

◆ SetModeTo2D()

void albaAvatar::SetModeTo2D ( )
inline

Set Avatar modality to MODE_2D.

Definition at line 150 of file albaAvatar.h.

◆ SetModeTo3D()

void albaAvatar::SetModeTo3D ( )
inline

Set Avatar modality to MODE_3D.

Definition at line 153 of file albaAvatar.h.

◆ GetPicker()

virtual vtkAbstractPropPicker * albaAvatar::GetPicker ( )
inlinevirtual

return the picker used by this avatar: from the picker is possible to obtain information about the picked object.

Reimplemented in albaAvatar3D.

Definition at line 158 of file albaAvatar.h.

◆ GetGui()

albaGUI * albaAvatar::GetGui ( )

Return pointer to the GUI.

◆ CreateGui()

virtual void albaAvatar::CreateGui ( )
virtual

internal function to create device GUI for settings

Reimplemented in albaAvatar3D.

◆ UpdateGui()

virtual void albaAvatar::UpdateGui ( )
virtual

force GUI update

◆ InternalStore()

virtual int albaAvatar::InternalStore ( albaStorageElement node)
protectedvirtual

This is used to allow nested serialization of subclasses.

This function is called by Store and is reimplemented in subclasses. Each subclass can Open/Close its own subelements which are closed inside the "Device" XML element.

Implements albaStorable.

Reimplemented in albaAvatar3D.

◆ InternalRestore()

virtual int albaAvatar::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.

Reimplemented in albaAvatar3D.

◆ InternalInitialize()

virtual int albaAvatar::InternalInitialize ( )
protectedvirtual

redefined to add the Cursor actor into the selected renderer

Reimplemented from albaAgent.

Reimplemented in albaAvatar3D.

◆ InternalShutdown()

virtual void albaAvatar::InternalShutdown ( )
protectedvirtual

redefined to remove Cursor from renderer

Reimplemented from albaAgent.

Reimplemented in albaAvatar3D.

◆ OnPreResetCamera()

virtual void albaAvatar::OnPreResetCamera ( albaEventBase event)
protectedvirtual

process event sent before a camera reset

◆ OnPostResetCamera()

virtual void albaAvatar::OnPostResetCamera ( albaEventBase event)
protectedvirtual

process event sent after a camera reset

Reimplemented in albaAvatar3D.

◆ OnViewSelected()

virtual void albaAvatar::OnViewSelected ( albaEvent e)
protectedvirtual

process event sent when a view has been selected

Member Data Documentation

◆ m_Actor3D

vtkALBASmartPointer<vtkProp3D> albaAvatar::m_Actor3D
protected

3D representation of the avatar

Definition at line 197 of file albaAvatar.h.

◆ m_Actor2D

vtkALBASmartPointer<vtkActor2D> albaAvatar::m_Actor2D
protected

2D representation of the avatar

Definition at line 198 of file albaAvatar.h.

◆ m_Gui

albaGUI* albaAvatar::m_Gui
protected

the settings Gui

Definition at line 200 of file albaAvatar.h.

◆ m_Mode

int albaAvatar::m_Mode
protected

Avatar modality, either 2D or 3D

Definition at line 201 of file albaAvatar.h.

◆ m_Cursor3DHideCounter

int albaAvatar::m_Cursor3DHideCounter
protected

counter of the HideCursor3D() calls, used to manage concurrent calls

Definition at line 203 of file albaAvatar.h.

◆ m_Cursor2DHideCounter

int albaAvatar::m_Cursor2DHideCounter
protected

counter of the HideCursor2D() calls, used to manage concurrent calls

Definition at line 204 of file albaAvatar.h.


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