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//----------------------------------------------------------------------------
32class albaVMEGizmo;
33class albaMatrix;
34class albaVME;
35class vtkConeSource;
36class vtkCylinderSource;
37class vtkTransformPolyDataFilter;
38class vtkTransform;
39class vtkAppendPolyData;
40
46{
47public:
50
53 void SetInput(albaVME *vme);
54 albaVME *GetInput() {return this->m_InputVme;};
55
56 //----------------------------------------------------------------------------
57 // events handling
58 //----------------------------------------------------------------------------
59
61 void SetListener(albaObserver *Listener) {m_Listener = Listener;};
62
64 virtual void OnEvent(albaEventBase *alba_event);
65
66 //----------------------------------------------------------------------------
67 // axis setting
68 //----------------------------------------------------------------------------
69
71 enum AXIS {X = 0, Y, Z};
72
74 void SetAxis(int axis);
75 int GetAxis() {return m_Axis;};
76
77 //----------------------------------------------------------------------------
78 // highlight and show
79 //----------------------------------------------------------------------------
80
82 void Highlight(bool highlight);
83
85 void Show(bool show);
86
89 //----------------------------------------------------------------------------
90 // cylinder stuff
91 //----------------------------------------------------------------------------
92
94 void SetCylinderLength(double length);
96
99 void SetAbsPose(albaMatrix *absPose);
101
105 void SetConstraintModality(int axis, int constrainModality);
106
108 void SetStep(int axis, double step);
109
111 void SetColor(double col[3]);
112 void SetColor(double cylR, double cylG, double cylB);
113
114protected:
115
118
119
120 double m_Color[3];
121 double m_LastColor[3];
122
125
126 vtkConeSource *m_FeedbackConeSource;
127
132
133 vtkCylinderSource *m_FeedbackCylinderSource;
134
137
138 vtkTransformPolyDataFilter *m_LeftUpFeedbackConeTransformPDF;
139 vtkTransformPolyDataFilter *m_LeftDownFeedbackConeTransformPDF;
140 vtkTransformPolyDataFilter *m_RightUpFeedbackConeTransformPDF;
141 vtkTransformPolyDataFilter *m_RightDownFeedbackConeTransformPDF;
142
143 vtkTransformPolyDataFilter *m_LeftFeedbackCylinderTransformPDF;
144 vtkTransformPolyDataFilter *m_RightFeedbackCylinderTransformPDF;
145
147
150 void SetRefSysMatrix(albaMatrix *constrain);
151
154
157
159 vtkCylinderSource *m_RightCylinder;
160
163
165 //albaVmeData *GizmoData[2];
166
168 vtkTransformPolyDataFilter *m_RightTranslatePDF;
169
171 vtkTransform *m_RightTranslateTr;
172
174 vtkTransformPolyDataFilter *m_RightCylinderRotatePDF;
175
178
180 vtkCylinderSource *m_LeftCylinder;
181
183 vtkTransformPolyDataFilter *m_LeftTranslatePDF;
184
186 vtkTransform *m_LeftTranslateTr;
187
189 vtkTransformPolyDataFilter *m_LeftCylinderRotatePDF;
190
193
195 vtkAppendPolyData *m_Append;
196
199
201 void CreateISA();
202
205
206
209
213
216};
217#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
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
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.
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.
albaBehaviorTransform * m_IsaGen
isa generic
friend class albaGizmoTranslateAxisTest
test friend
Base class for operations and views gizmos.
albaMatrix - Time stamped 4x4 Matrix.
Definition: albaMatrix.h:45
Interface implementing the Observer of the Subject/Observer design pattern.
Definition: albaObserver.h:36
albaVME -
Definition: albaVME.h:150