ALBA
albaGizmoCrossTranslatePlane.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: ALBA (Agile Library for Biomedical Applications)
4 Module: albaGizmoCrossTranslatePlane
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//======================== WORK IN PROGRESS !!!!! ========================
19//======================== WORK IN PROGRESS !!!!! ========================
20//======================== WORK IN PROGRESS !!!!! ========================
21//======================== WORK IN PROGRESS !!!!! ========================
22//======================== WORK IN PROGRESS !!!!! ========================
23//======================== WORK IN PROGRESS !!!!! ========================
24//======================== WORK IN PROGRESS !!!!! ========================
25//======================== WORK IN PROGRESS !!!!! ========================
26//======================== WORK IN PROGRESS !!!!! ========================
27
28#ifndef __albaGizmoCrossTranslatePlane_H__
29#define __albaGizmoCrossTranslatePlane_H__
30
31//----------------------------------------------------------------------------
32// Include:
33//----------------------------------------------------------------------------
34#include "albaEvent.h"
35#include "albaGizmoInterface.h"
36#include "vtkConeSource.h"
37#include "vtkTransform.h"
38#include "vtkTransformPolyDataFilter.h"
39#include "vtkCylinderSource.h"
40#include "vtkAppendPolyData.h"
41
42//----------------------------------------------------------------------------
43// forward references :
44//----------------------------------------------------------------------------
46class albaVME;
47class albaVMEGizmo;
48class albaMatrix;
49class vtkLineSource;
50class vtkPlaneSource;
51class vtkTransformPolyDataFilter;
52class vtkTransform;
53class vtkTubeFilter;
54//----------------------------------------------------------------------------
55
61{
62public:
65
68 void SetInput(albaVME *vme);
69 albaVME *GetInput() {return this->m_InputVme;};
70
71 //----------------------------------------------------------------------------
72 // events handling
73 //----------------------------------------------------------------------------
74
76 void SetListener(albaObserver *Listener) {m_Listener = Listener;};
77
79 virtual void OnEvent(albaEventBase *alba_event);
80
81 //----------------------------------------------------------------------------
82 // axis setting
83 //----------------------------------------------------------------------------
84
87
89 void SetPlane(int axis);
90
92 int GetPlane() {return m_ActivePlane;};
93
94 //----------------------------------------------------------------------------
95 // highlight and show
96 //----------------------------------------------------------------------------
97
99 void Highlight(bool highlight);
100
102 void Show(bool show);
103
106
107 //----------------------------------------------------------------------------
108 // activation status
109 //----------------------------------------------------------------------------
110
113 void SetIsActive(bool highlight) {m_IsActive = highlight;};
114 bool GetIsActive() {return m_IsActive;}
115
118 void SetAbsPose(albaMatrix *absPose);
120
124
128 void SetConstraintModality(int axis, int constrainModality);
129
131 void SetStep(int axis, double step);
132
134 void SetColor(int part, double col[3]);
135 void SetColor(int part, double colR, double colG, double colB);
136
159
160protected:
161
163 void SetSizeLength(double length);
164 double GetSizeLength() {return m_Length;};
165
166 double m_Color[3][2];
167 double m_LastColor[3][2];
168
170 albaVMEGizmo *m_Gizmo[3];
171
174
175
178
180 double m_Length;
181
183 vtkLineSource *m_Line[2];
184
186 vtkTubeFilter *m_LineTF[2];
187
189 vtkTransformPolyDataFilter *m_RotatePDF[3];
190
192 vtkTransform *m_RotationTr;
193
196
199
201 void CreateISA();
202
203
206
208 vtkTransform *m_PivotTransform;
209
213
216
219
220 vtkConeSource *m_FeedbackConeSource;
221
226
227 vtkTransformPolyDataFilter *m_LeftFeedbackConeTransformPDF;
228 vtkTransformPolyDataFilter *m_RightFeedbackConeTransformPDF;
229 vtkTransformPolyDataFilter *m_UpFeedbackConeTransformPDF;
230 vtkTransformPolyDataFilter *m_DownFeedbackConeTransformPDF;
231
232 vtkCylinderSource *m_FeedbackCylinderSource;
233
236
237 vtkTransformPolyDataFilter *m_VerticalFeedbackCylinderTransformPDF;
238 vtkTransformPolyDataFilter *m_HorizontalFeedbackCylinderTransformPDF;
239
241
243};
244#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 a plane.
vtkTransform * m_RotationTr
rotation transform for cylinder and cone
void SetInput(albaVME *vme)
Set the gizmo generating vme; the gizmo will be centered on this vme.
albaBehaviorTransform * m_IsaGen[2]
isa generic
void SetStep(int axis, double step)
Set the step value for snap step constraint type for the given axis.
void CreateISA()
Create isa stuff.
albaVMEGizmo * m_Gizmo[3]
Segments gizmo.
albaGizmoCrossTranslatePlane(albaVME *input, albaObserver *listener=NULL)
virtual void OnEvent(albaEventBase *alba_event)
Events handling.
vtkTransformPolyDataFilter * m_HorizontalFeedbackCylinderTransformPDF
void SetColor(int part, double col[3])
Gizmo color setting facilities for gizmo segments;.
void ShowTranslationFeedbackArrows(bool show)
Show the translation feedback arrows
void SetAbsPose(albaMatrix *absPose)
Set the abs pose.
vtkTransformPolyDataFilter * m_LeftFeedbackConeTransformPDF
void SetConstrainRefSys(albaMatrix *constrain)
Set the constrain ref sys.
void SetIsActive(bool highlight)
Set/Get the activation status of the gizmo, When the gizmo is active it is sending pose matrices to t...
vtkTransformPolyDataFilter * m_RotatePDF[3]
rotate PDF for gizmo parts
vtkTransformPolyDataFilter * m_RightFeedbackConeTransformPDF
vtkTubeFilter * m_LineTF[2]
Tube filter for lines.
void Show(bool show)
Show plane translation gizmo.
void SetPlane(int axis)
Set/Get gizmo plane, default plane is X_NORMAL.
void SetSizeLength(double length)
Set/Get the side length of the gizmo.
albaObserver * m_Listener
Register the event receiver object.
vtkTransformPolyDataFilter * m_DownFeedbackConeTransformPDF
vtkTransformPolyDataFilter * m_UpFeedbackConeTransformPDF
albaMatrix * GetAbsPose()
Get the gizmo abs pose.
void CreateFeedbackGizmoPipeline()
Create feedback gizmo vtk objects.
void CreatePipeline()
Create vtk objects needed.
void SetColor(int part, double colR, double colG, double colB)
albaVME * m_InputVme
Register input vme.
void SetConstraintModality(int axis, int constrainModality)
Set the constraint modality for the given axis; allowed constraint modality are: LOCK,...
albaVMEGizmo * m_TranslationFeedbackGizmo
Translation feedback arrows gizmo.
void SetListener(albaObserver *Listener)
Set the event receiver object.
vtkLineSource * m_Line[2]
Line source.
double m_Length
Register the gizmo square plane side length.
int m_ActivePlane
Register the gizmo plane.
void Highlight(bool highlight)
Highlight gizmo.
vtkTransform * m_PivotTransform
Used by albaBehaviorTransform.
vtkTransformPolyDataFilter * m_VerticalFeedbackCylinderTransformPDF
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