ALBA
albaGizmoCrossTranslateAxis.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: ALBA (Agile Library for Biomedical Applications)
4 Module: albaGizmoCrossTranslateAxis
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 __albaGizmoCrossTranslateAxis_H__
19#define __albaGizmoCrossTranslateAxis_H__
20
21//----------------------------------------------------------------------------
22// Include:
23//----------------------------------------------------------------------------
24#include "albaEvent.h"
25#include "albaGizmoInterface.h"
26#include "vtkConeSource.h"
27
28//----------------------------------------------------------------------------
29// forward references :
30//----------------------------------------------------------------------------
33class albaVMEGizmo;
34class albaMatrix;
35class albaVME;
36class vtkConeSource;
37class vtkCylinderSource;
38class vtkTransformPolyDataFilter;
39class vtkTransform;
40class vtkAppendPolyData;
41
47{
48public:
51
54 void SetInput(albaVME *vme);
55 albaVME *GetInput() {return this->m_InputVme;};
56
57 //----------------------------------------------------------------------------
58 // events handling
59 //----------------------------------------------------------------------------
60
62 void SetListener(albaObserver *Listener) {m_Listener = Listener;};
63
65 virtual void OnEvent(albaEventBase *alba_event);
66
67 //----------------------------------------------------------------------------
68 // axis setting
69 //----------------------------------------------------------------------------
70
72 enum AXIS {X = 0, Y, Z};
73
75 void SetAxis(int axis);
76 int GetAxis() {return m_Axis;};
77
78 //----------------------------------------------------------------------------
79 // highlight and show
80 //----------------------------------------------------------------------------
81
83 void Highlight(bool highlight);
84
86 void Show(bool show);
87
90 //----------------------------------------------------------------------------
91 // cylinder stuff
92 //----------------------------------------------------------------------------
93
95 void SetCylinderLength(double length);
97
100 void SetAbsPose(albaMatrix *absPose);
102
106 void SetConstraintModality(int axis, int constrainModality);
107
109 void SetStep(int axis, double step);
110
112 void SetColor(double col[3]);
113 void SetColor(double cylR, double cylG, double cylB);
114
115protected:
116
119
120
121 double m_Color[3];
122 double m_LastColor[3];
123
126
127 vtkConeSource *m_FeedbackConeSource;
128
133
134 vtkCylinderSource *m_FeedbackCylinderSource;
135
138
139 vtkTransformPolyDataFilter *m_LeftUpFeedbackConeTransformPDF;
140 vtkTransformPolyDataFilter *m_LeftDownFeedbackConeTransformPDF;
141 vtkTransformPolyDataFilter *m_RightUpFeedbackConeTransformPDF;
142 vtkTransformPolyDataFilter *m_RightDownFeedbackConeTransformPDF;
143
144 vtkTransformPolyDataFilter *m_LeftFeedbackCylinderTransformPDF;
145 vtkTransformPolyDataFilter *m_RightFeedbackCylinderTransformPDF;
146
148
151 void SetRefSysMatrix(albaMatrix *constrain);
152
155
158
160 vtkCylinderSource *m_RightCylinder;
161
164
166 //albaVmeData *GizmoData[2];
167
169 vtkTransformPolyDataFilter *m_RightTranslatePDF;
170
172 vtkTransform *m_RightTranslateTr;
173
175 vtkTransformPolyDataFilter *m_RightCylinderRotatePDF;
176
179
181 vtkCylinderSource *m_LeftCylinder;
182
184 vtkTransformPolyDataFilter *m_LeftTranslatePDF;
185
187 vtkTransform *m_LeftTranslateTr;
188
190 vtkTransformPolyDataFilter *m_LeftCylinderRotatePDF;
191
194
196 vtkAppendPolyData *m_Append;
197
200
202 void CreateISA();
203
206
209
212
216
219};
220#endif
Implementation of the message object for the Subject/Observer design pattern.
Definition: albaEventBase.h:49
Basic gizmo component used to perform constrained translation on one axis.
vtkTransformPolyDataFilter * m_LeftDownFeedbackConeTransformPDF
vtkCylinderSource * m_LeftCylinder
Cylinder source.
void CreateTranslationGizmoPipeline()
Create vtk objects needed.
void SetAbsPose(albaMatrix *absPose)
Set the abs pose.
vtkAppendPolyData * m_Append
append two cylinders
void SetColor(double col[3])
Gizmo color setting facilities; part can be CYLINDER or CONE.
albaObserver * m_Listener
Register the event receiver object.
vtkTransform * m_RightTranslateTr
translation transform for cylinder and cone
albaInteractorGenericMouse * m_IsaGen
isa generic
void CreateISA()
Create isa stuff.
int m_Axis
Register the gizmo axis.
void SetConstraintModality(int axis, int constrainModality)
Set the constraint modality for the given axis; allowed constraint modality are: LOCK,...
vtkTransform * m_RightCylinderRotationTr
rotation transform for cylinder and cone
vtkTransformPolyDataFilter * m_RightFeedbackCylinderTransformPDF
vtkTransformPolyDataFilter * m_RightUpFeedbackConeTransformPDF
vtkAppendPolyData * m_FeedbackStuffAppendPolydata
void SetAxis(int axis)
Set/Get gizmo axis, default axis is X.
void SetCylinderLength(double length)
Set/Get the length of the cylinder.
albaGizmoCrossTranslateAxis(albaVME *input, albaObserver *listener=NULL)
void SetColor(double cylR, double cylG, double cylB)
vtkTransformPolyDataFilter * m_LeftTranslatePDF
translate PDF for cylinder and cone
void SetInput(albaVME *vme)
Set the gizmo generating vme; the gizmo will be centered on this vme.
void SetStep(int axis, double step)
Set the step value for snap step constraint type for the given axis.
virtual void OnEvent(albaEventBase *alba_event)
Events handling.
albaInteractorCompositorMouse * m_IsaComp
isa compositor
void SetRefSysMatrix(albaMatrix *constrain)
Set the constrain ref sys.
albaVMEGizmo * m_TranslationCylinderGizmo
Pickable translation cylinder gizmo.
albaVMEGizmo * m_TranslationFeedbackGizmo
Translation feedback arrows gizmo.
vtkTransformPolyDataFilter * m_RightCylinderRotatePDF
rotate PDF for cylinder and cone
void Highlight(bool highlight)
Highlight the gizmo.
vtkTransformPolyDataFilter * m_RightDownFeedbackConeTransformPDF
albaVME * m_InputVme
Register input vme.
vtkTransformPolyDataFilter * m_LeftUpFeedbackConeTransformPDF
vtkTransformPolyDataFilter * m_LeftCylinderRotatePDF
rotate PDF for cylinder and cone
vtkCylinderSource * m_RightCylinder
Cylinder source.
void ShowTranslationFeedbackArrows(bool show)
Show the translation feedback arrows
vtkTransformPolyDataFilter * m_LeftFeedbackCylinderTransformPDF
void SetListener(albaObserver *Listener)
Set the event receiver object.
void Show(bool show)
Show the gizmo.
vtkTransformPolyDataFilter * m_RightTranslatePDF
Cylinder and cone gizmo vme data.
virtual ~albaGizmoCrossTranslateAxis()
vtkTransform * m_LeftCylinderRotationTr
rotation transform for cylinder and cone
void CreateFeedbackGizmoPipeline()
Create translation feedback arrows stuff.
vtkTransform * m_LeftTranslateTr
translation transform for cylinder and cone
albaMatrix * GetAbsPose()
Get the gizmo abs pose.
friend class albaGizmoTranslateAxisTest
test friend
Base class for operations and views gizmos.
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
albaVME -
Definition: albaVME.h:150