ALBA
albaGizmoTranslateAxis.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: ALBA (Agile Library for Biomedical Applications)
4 Module: albaGizmoTranslateAxis
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 __albaGizmoTranslateAxis_H__
18#define __albaGizmoTranslateAxis_H__
19
20//----------------------------------------------------------------------------
21// Include:
22//----------------------------------------------------------------------------
23#include "albaEvent.h"
24#include "albaGizmoInterface.h"
25
26//----------------------------------------------------------------------------
27// forward references :
28//----------------------------------------------------------------------------
30class albaVMEGizmo;
31class albaMatrix;
32class albaVME;
33class vtkConeSource;
34class vtkCylinderSource;
35class vtkTransformPolyDataFilter;
36class vtkTransform;
37
43{
44public:
45 albaGizmoTranslateAxis(albaVME *input, albaObserver *listener = NULL, albaString name = "");
47
50 void SetInput(albaVME *vme);
51 albaVME *GetInput() {return this->m_InputVme;};
52
53 //----------------------------------------------------------------------------
54 // events handling
55 //----------------------------------------------------------------------------
56
58 void SetListener(albaObserver *Listener) {m_Listener = Listener;};
59
61 virtual void OnEvent(albaEventBase *alba_event);
62
63 //----------------------------------------------------------------------------
64 // axis setting
65 //----------------------------------------------------------------------------
66
68 enum AXIS {X = 0, Y, Z};
69
71 void SetAxis(int axis);
72 int GetAxis() {return m_Axis;};
73
74 //----------------------------------------------------------------------------
75 // highlight and show
76 //----------------------------------------------------------------------------
77
79 void Highlight(bool highlight);
80
82 void Show(bool show);
83
84 //----------------------------------------------------------------------------
85 // cone stuff
86 //----------------------------------------------------------------------------
87
89 void SetConeLength(double length);
90 double GetConeLength() {return m_ConeLength;};
91
92 //----------------------------------------------------------------------------
93 // cylinder stuff
94 //----------------------------------------------------------------------------
95
97 void SetCylinderLength(double length);
98 double GetCylinderLength() {return m_CylinderLength;};
99
102 void SetAbsPose(albaMatrix *absPose);
104
108 void SetConstraintModality(int axis, int constrainModality);
109
111 void SetStep(int axis, double step);
112
113protected:
116 void SetRefSysMatrix(albaMatrix *constrain);
117
119 albaVMEGizmo *m_ConeGizmo;
120
122 albaVMEGizmo *m_CylGizmo;
123
126
127 enum GIZMOPARTS {CYLINDER = 0, CONE};
128
131
133 vtkConeSource *m_Cone;
134
137
139 vtkCylinderSource *m_Cylinder;
140
143
145 //albaVmeData *GizmoData[2];
146
148 vtkTransformPolyDataFilter *m_TranslatePDF[2];
149
151 vtkTransform *m_TranslateTr[2];
152
154 vtkTransformPolyDataFilter *m_RotatePDF[2];
155
157 vtkTransform *m_RotationTr;
158
161
163 void CreateISA();
164
165
168
170 void SetColor(int part, double col[3]);
171 void SetColor(int part, double colR, double colG, double colB);
172 void SetColor(double cylCol[3], double coneCol[3]);
173 void SetColor(double cylR, double cylG, double cylB, double coneR, double coneG, double coneB);
174
178
180 friend class albaGizmoTranslateAxisTest;
181};
182#endif
Constrained interaction with mouse device: the left button moves the VME (see OnLeftButtonDown).
Implementation of the message object for the Subject/Observer design pattern.
Definition: albaEventBase.h:49
Base class for operations and views gizmos.
Basic gizmo component used to perform constrained translation on one axis.
albaVMEGizmo * m_ConeGizmo
Cone gizmo.
void SetColor(int part, double col[3])
Gizmo color setting facilities; part can be CYLINDER or CONE.
void SetListener(albaObserver *Listener)
Set the event receiver object.
void SetCylinderLength(double length)
Set/Get the length of the cylinder.
void CreateISA()
Create isa stuff.
void SetRefSysMatrix(albaMatrix *constrain)
Set the constrain ref sys.
void SetAbsPose(albaMatrix *absPose)
Set the abs pose.
double m_ConeLength
Cone length.
virtual ~albaGizmoTranslateAxis()
albaVMEGizmo * m_CylGizmo
cylinder gizmo
void SetStep(int axis, double step)
Set the step value for snap step constraint type for the given axis.
void SetColor(double cylR, double cylG, double cylB, double coneR, double coneG, double coneB)
void SetConeLength(double length)
Set/Get the length of the cone.
void SetInput(albaVME *vme)
Set the gizmo generating vme; the gizmo will be centered on this vme.
void SetConstraintModality(int axis, int constrainModality)
Set the constraint modality for the given axis; allowed constraint modality are: LOCK,...
virtual void OnEvent(albaEventBase *alba_event)
Events handling.
void Show(bool show)
Show the gizmo.
void SetColor(double cylCol[3], double coneCol[3])
vtkConeSource * m_Cone
Cone source.
vtkCylinderSource * m_Cylinder
Cylinder source.
albaGizmoTranslateAxis(albaVME *input, albaObserver *listener=NULL, albaString name="")
void SetColor(int part, double colR, double colG, double colB)
albaMatrix * GetAbsPose()
Get the gizmo abs pose.
void Highlight(bool highlight)
Highlight the gizmo.
int m_Axis
Register the gizmo axis.
albaVME * m_InputVme
Register input vme.
albaObserver * m_Listener
Register the event receiver object.
void CreatePipeline()
Create vtk objects needed.
void SetAxis(int axis)
Set/Get gizmo axis, default axis is X.
double m_CylinderLength
Cylinder length.
vtkTransform * m_RotationTr
rotation transform for cylinder and cone
albaMatrix - Time stamped 4x4 Matrix.
Definition: albaMatrix.h:45
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