ALBA
albaGizmoInterface.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: ALBA (Agile Library for Biomedical Applications)
4 Module: albaGizmoInterface
5 Authors: Stefano Perticoni
6
7 Copyright (c) BIC
8 All rights reserved. See Copyright.txt or
9
10
11 This software is distributed WITHOUT ANY WARRANTY; without even
12 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
13 PURPOSE. See the above copyright notice for more information.
14
15=========================================================================*/
16
17
18#ifndef __albaGizmoInterface_H__
19#define __albaGizmoInterface_H__
20
21//----------------------------------------------------------------------------
22// Include:
23//----------------------------------------------------------------------------
24#include "albaEvent.h"
25#include "albaObserver.h"
26#include "albaServiceClient.h"
27#include "albaAbsLogicManager.h"
28
29//----------------------------------------------------------------------------
30// forward references :
31//----------------------------------------------------------------------------
32class albaGUI;
33class albaVME;
34class albaMatrix;
35
36//----------------------------------------------------------------------------
45class ALBA_EXPORT albaGizmoInterface : public albaObserver, public albaServiceClient
46{
47public:
48
51 void SetName(albaString name) {m_Name = name;};
52
55 albaString GetName() {return m_Name;}
56
60 virtual void SetInput(albaVME *vme);
62
71 void SetMediator(albaObserver *mediator) {m_Mediator = mediator;};
72
74 albaObserver *GetMediator() {return m_Mediator;};
75
78 void SetAutoscale(bool autoscale) {m_Autoscale = autoscale;};
79
81 bool GetAutoscale() {return m_Autoscale;};
82
85 void SetRenderWindowHeightPercentage(double percentage) {m_RenderWindowHeightPercentage = percentage;};
86 double GetRenderWindowHeightPercentage() {return m_RenderWindowHeightPercentage;};
87
89 void SetAlwaysVisible(bool alwaysVisible) {m_AlwaysVisible = alwaysVisible;};
90 bool GetAlwaysVisible() {return m_AlwaysVisible;};
91
92 //----------------------------------------------------------------------------
93 // events handling
94 //----------------------------------------------------------------------------
95
98 void SetListener(albaObserver *listener);
100
103 virtual void OnEvent(albaEventBase *alba_event);
104
105 //----------------------------------------------------------------------------
106 // show
107 //----------------------------------------------------------------------------
108
111 virtual void Show(bool show);
112
113 //----------------------------------------------------------------------------
114 // Gizmo modality: defaul is G_LOCAL
115 //----------------------------------------------------------------------------
118 enum MODALITY {G_LOCAL = 0, G_GLOBAL};
119
124
127
130
131 //----------------------------------------------------------------------------
134 virtual void SetAbsPose(albaMatrix *absPose);
135
139
140 //----------------------------------------------------------------------------
141 // Gizmo gui
142 //----------------------------------------------------------------------------
143
145 virtual albaGUI *GetGui();
146
147protected:
148
151
153
155
159
163
167
171
174
177
180
183
184 void SendTransformMatrix(albaMatrix* matrix, int eventId, long arg);
185
187 virtual void OnEventGizmoGui(albaEventBase *alba_event) {};
188
190 virtual void OnEventGizmoComponents(albaEventBase *alba_event) {};
191
193 friend class albaGizmoInterfaceTest;
194
195};
196#endif
Implementation of the message object for the Subject/Observer design pattern.
Definition: albaEventBase.h:49
albaGUI is a panel with function to easily create GUI.
Definition: albaGUI.h:110
Base class for operations and views gizmos.
albaString GetName()
Get the gizmo name.
double GetRenderWindowHeightPercentage()
void SendTransformMatrix(albaMatrix *matrix, int eventId, long arg)
void SetModalityToGlobal()
Modality to be used when gizmo reference frame is different from input vme abs pose.
void SetRenderWindowHeightPercentage(double percentage)
Set the size of the gizmo when autoscale is enabled.
void SetModalityToLocal()
(default) Modality to be used when gizmo reference frame is the input vme abs pose: using this modali...
albaVME * m_InputVME
The input vme.
virtual albaGUI * GetGui()
Return gui owned by the gizmo.
double m_RenderWindowHeightPercentage
gizmoHeight / RenderWindowHeight in autoscale mode
albaVME * GetInput()
albaVME * m_RefSysVME
Vme to be used as reference system.
albaObserver * GetListener()
bool m_Autoscale
Gizmo autoscale.
MODALITY
Set the gizmo working modality.
virtual void Show(bool show)
Show the gizmo (not implemented)
void SetName(albaString name)
Set the gizmo name.
virtual ~albaGizmoInterface()
int m_Modality
The gizmo interaction mode.
virtual void SetAbsPose(albaMatrix *absPose)
Set the gizmo abs pose (not implemented)
void SetListener(albaObserver *listener)
Set the event receiver object.
virtual void OnEventGizmoComponents(albaEventBase *alba_event)
Gizmo components events handling.
void SetMediator(albaObserver *mediator)
Set the orchestrator object: albaGizmo's are used togetheter in more complex objects like albaGizmoRo...
void SetAlwaysVisible(bool alwaysVisible)
Put the gizmo on the superimposed layer ie make it always visible (default to false)
albaObserver * m_Listener
Register the event receiver object.
albaObserver * m_Mediator
bool GetAutoscale()
Get if gizmo autoscaling is enabled.
void SetAutoscale(bool autoscale)
Enable/Disable gizmo autoscaling (default is false ie no autoscaling): if autoscale is enabled the gi...
albaObserver * GetMediator()
Return the meditor object.
int GetModality()
Return the working modality.
virtual albaMatrix * GetAbsPose()
Get the gizmo abs pose.
virtual void OnEventGizmoGui(albaEventBase *alba_event)
Gizmo components events handling.
virtual void OnEvent(albaEventBase *alba_event)
Events handling (not implemented)
bool m_AlwaysVisible
Gimzo always visible ie on the superimposed layer.
virtual void SetInput(albaVME *vme)
Set input vme for the gizmo: gizmo are tools used to manipulate VMEs and this variable holds a refere...
albaMatrix - Time stamped 4x4 Matrix.
Definition: albaMatrix.h:44
Interface implementing the Observer of the Subject/Observer design pattern.
Definition: albaObserver.h:36
albaString - performs common string operations on c-strings.
Definition: albaString.h:43
albaVME -
Definition: albaVME.h:150