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//----------------------------------------------------------------------------
31class albaVMEGizmo;
32class albaMatrix;
33class albaVME;
34class vtkConeSource;
35class vtkCylinderSource;
36class vtkTransformPolyDataFilter;
37class vtkTransform;
38
44{
45public:
46 albaGizmoTranslateAxis(albaVME *input, albaObserver *listener = NULL, albaString name = "");
48
51 void SetInput(albaVME *vme);
52 albaVME *GetInput() {return this->m_InputVme;};
53
54 //----------------------------------------------------------------------------
55 // events handling
56 //----------------------------------------------------------------------------
57
59 void SetListener(albaObserver *Listener) {m_Listener = Listener;};
60
62 virtual void OnEvent(albaEventBase *alba_event);
63
64 //----------------------------------------------------------------------------
65 // axis setting
66 //----------------------------------------------------------------------------
67
69 enum AXIS {X = 0, Y, Z};
70
72 void SetAxis(int axis);
73 int GetAxis() {return m_Axis;};
74
75 //----------------------------------------------------------------------------
76 // highlight and show
77 //----------------------------------------------------------------------------
78
80 void Highlight(bool highlight);
81
83 void Show(bool show);
84
85 //----------------------------------------------------------------------------
86 // cone stuff
87 //----------------------------------------------------------------------------
88
90 void SetConeLength(double length);
91 double GetConeLength() {return m_ConeLength;};
92
93 //----------------------------------------------------------------------------
94 // cylinder stuff
95 //----------------------------------------------------------------------------
96
98 void SetCylinderLength(double length);
99 double GetCylinderLength() {return m_CylinderLength;};
100
103 void SetAbsPose(albaMatrix *absPose);
105
109 void SetConstraintModality(int axis, int constrainModality);
110
112 void SetStep(int axis, double step);
113
114protected:
117 void SetRefSysMatrix(albaMatrix *constrain);
118
120 albaVMEGizmo *m_ConeGizmo;
121
123 albaVMEGizmo *m_CylGizmo;
124
127
128 enum GIZMOPARTS {CYLINDER = 0, CONE};
129
132
134 vtkConeSource *m_Cone;
135
138
140 vtkCylinderSource *m_Cylinder;
141
144
146 //albaVmeData *GizmoData[2];
147
149 vtkTransformPolyDataFilter *m_TranslatePDF[2];
150
152 vtkTransform *m_TranslateTr[2];
153
155 vtkTransformPolyDataFilter *m_RotatePDF[2];
156
158 vtkTransform *m_RotationTr;
159
162
164 void CreateISA();
165
168
171
173 void SetColor(int part, double col[3]);
174 void SetColor(int part, double colR, double colG, double colB);
175 void SetColor(double cylCol[3], double coneCol[3]);
176 void SetColor(double cylR, double cylG, double cylB, double coneR, double coneG, double coneB);
177
181
183 friend class albaGizmoTranslateAxisTest;
184};
185#endif
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
Associates instances of albaInteractorGenericMouse to mouse buttons and ctrl/shift keys combinations.
Constrained interaction with mouse device.
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