ALBA
albaGizmoTranslate.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: ALBA (Agile Library for Biomedical Applications)
4 Module: albaGizmoTranslate
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#ifndef __albaGizmoTranslate_H__
18#define __albaGizmoTranslate_H__
19
20//----------------------------------------------------------------------------
21// Include:
22//----------------------------------------------------------------------------
23#include "albaEvent.h"
24#include "albaGizmoInterface.h"
26
27//----------------------------------------------------------------------------
28// forward references :
29//----------------------------------------------------------------------------
32class albaMatrix;
33
80class ALBA_EXPORT albaGizmoTranslate : public albaGizmoInterface
81{
82public:
83 albaGizmoTranslate(albaVME *input, albaObserver* listener = NULL, bool BuildGUI = true);
85
88 void SetInput(albaVME *vme);
89
91 void SetRenderWindowHeightPercentage(double percentage);
92
94 void SetAutoscale(bool autoscale);
95
97 void SetAlwaysVisible(bool alwaysVisible);
98
99 //----------------------------------------------------------------------------
100 // events handling
101 //----------------------------------------------------------------------------
102
105 void OnEvent(albaEventBase *alba_event);
106
107 //----------------------------------------------------------------------------
108 // show
109 //----------------------------------------------------------------------------
110
113 void Show(bool show);
114
117 void Show(bool showX,bool showY,bool showZ);
118
121 void SetAbsPose(albaMatrix *absPose, albaTimeStamp ts = -1);
123
124 //----------------------------------------------------------------------------
125 // RefSys
126 //----------------------------------------------------------------------------
127
129 void SetRefSys(albaVME *refSys);
131
132 albaGUI *GetGui() {return (m_GuiGizmoTranslate->GetGui());};
133
137 void SetConstraintModality(int axis, int constrainModality);
139
141 void SetStep(int axis, double step);
142 int GetStep(int axis);
143
144protected:
145
147
150
153
156 enum AXIS {X = 0, Y, Z};
157 enum PLANE {XNORMAL = 0, YNORMAL, ZNORMAL};
158 enum ACTIVE_COMPONENT {NONE = -1, X_AXIS = 0, Y_AXIS, Z_AXIS, XN_PLANE, YN_PLANE, ZN_PLANE};
159
162 void Highlight(int component);
163
166
169
173
177
180
183
185 friend class albaGizmoTranslateTest;
186
188 int m_ConstraintModality[3];
189
191 int m_Step[3];
192
193};
194#endif
double albaTimeStamp
type for time varying data timestamps (not for pipelines timestamps!)
Definition: albaDefines.h:57
Implementation of the message object for the Subject/Observer design pattern.
Definition: albaEventBase.h:49
gui class for translation gizmo
albaGUI is a panel with function to easily create GUI.
Definition: albaGUI.h:110
Base class for operations and views gizmos.
Basic gizmo component used to perform constrained translation on one axis.
Basic gizmo component used to perform constrained translation on a plane.
Gizmo used to perform constrained translation along the x, yz axis or the xy, xz, yz plane.
virtual ~albaGizmoTranslate()
albaGUI * GetGui()
Return gui owned by the gizmo.
void OnEvent(albaEventBase *alba_event)
Events handling.
void SetAbsPose(albaMatrix *absPose, albaTimeStamp ts=-1)
Set/Get the gizmo pose.
void SetRenderWindowHeightPercentage(double percentage)
Superclass override.
void SetInput(albaVME *vme)
Set input vme for the gizmo.
int GetConstraintModality(int axis)
void SetStep(int axis, double step)
Set the step value for snap step constraint type for the given axis.
albaMatrix * m_PivotPose
Pivot point position;.
void Show(bool show)
Show the gizmo.
albaGizmoTranslate(albaVME *input, albaObserver *listener=NULL, bool BuildGUI=true)
void SetAutoscale(bool autoscale)
Superclass override.
albaMatrix * GetAbsPose()
Get the gizmo abs pose.
void OnEventGizmoComponents(albaEventBase *alba_event)
Gizmo components events handling.
AXIS
gizmo components enum
bool m_BuildGUI
Build Gizmo GUI.
albaVME * GetRefSys()
void OnEventGizmoGui(albaEventBase *alba_event)
Gizmo components events handling.
int m_ActiveGizmoComponent
Register the active gizmo component at MOUSE_DOWN.
void Highlight(int component)
Highlight one component and dehighlight other components.
void Show(bool showX, bool showY, bool showZ)
Show the gizmo.
int GetStep(int axis)
void SetAlwaysVisible(bool alwaysVisible)
Superclass override.
void SetConstraintModality(int axis, int constrainModality)
Set the constraint modality for the given axis; allowed constraint modality are: LOCK,...
albaGUIGizmoTranslate * m_GuiGizmoTranslate
void SendTransformMatrixFromGui(albaEventBase *alba_event)
Send matrix to postmultiply to listener.
void SetRefSys(albaVME *refSys)
Set the vme to be used as reference system, the vme is referenced; default ref sys is vme abs matrix.
albaMatrix - Time stamped 4x4 Matrix.
Definition: albaMatrix.h:44
Interface implementing the Observer of the Subject/Observer design pattern.
Definition: albaObserver.h:36
albaVME -
Definition: albaVME.h:150