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//----------------------------------------------------------------------------
47class albaVME;
48class albaVMEGizmo;
49class albaMatrix;
50class vtkLineSource;
51class vtkPlaneSource;
52class vtkTransformPolyDataFilter;
53class vtkTransform;
54class vtkTubeFilter;
55//----------------------------------------------------------------------------
56
62{
63public:
66
69 void SetInput(albaVME *vme);
70 albaVME *GetInput() {return this->m_InputVme;};
71
72 //----------------------------------------------------------------------------
73 // events handling
74 //----------------------------------------------------------------------------
75
77 void SetListener(albaObserver *Listener) {m_Listener = Listener;};
78
80 virtual void OnEvent(albaEventBase *alba_event);
81
82 //----------------------------------------------------------------------------
83 // axis setting
84 //----------------------------------------------------------------------------
85
88
90 void SetPlane(int axis);
91
93 int GetPlane() {return m_ActivePlane;};
94
95 //----------------------------------------------------------------------------
96 // highlight and show
97 //----------------------------------------------------------------------------
98
100 void Highlight(bool highlight);
101
103 void Show(bool show);
104
107
108 //----------------------------------------------------------------------------
109 // activation status
110 //----------------------------------------------------------------------------
111
114 void SetIsActive(bool highlight) {m_IsActive = highlight;};
115 bool GetIsActive() {return m_IsActive;}
116
119 void SetAbsPose(albaMatrix *absPose);
121
125
129 void SetConstraintModality(int axis, int constrainModality);
130
132 void SetStep(int axis, double step);
133
135 void SetColor(int part, double col[3]);
136 void SetColor(int part, double colR, double colG, double colB);
137
160
161protected:
162
164 void SetSizeLength(double length);
165 double GetSizeLength() {return m_Length;};
166
167 double m_Color[3][2];
168 double m_LastColor[3][2];
169
171 albaVMEGizmo *m_Gizmo[3];
172
175
176
179
181 double m_Length;
182
184 vtkLineSource *m_Line[2];
185
187 vtkTubeFilter *m_LineTF[2];
188
190 vtkTransformPolyDataFilter *m_RotatePDF[3];
191
193 vtkTransform *m_RotationTr;
194
197
200
202 void CreateISA();
203
206
209
211 vtkTransform *m_PivotTransform;
212
216
219
222
223 vtkConeSource *m_FeedbackConeSource;
224
229
230 vtkTransformPolyDataFilter *m_LeftFeedbackConeTransformPDF;
231 vtkTransformPolyDataFilter *m_RightFeedbackConeTransformPDF;
232 vtkTransformPolyDataFilter *m_UpFeedbackConeTransformPDF;
233 vtkTransformPolyDataFilter *m_DownFeedbackConeTransformPDF;
234
235 vtkCylinderSource *m_FeedbackCylinderSource;
236
239
240 vtkTransformPolyDataFilter *m_VerticalFeedbackCylinderTransformPDF;
241 vtkTransformPolyDataFilter *m_HorizontalFeedbackCylinderTransformPDF;
242
244
246};
247#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 a plane.
albaInteractorCompositorMouse * m_IsaComp[2]
isa compositor
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.
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.
albaInteractorGenericMouse * m_IsaGen[2]
isa generic
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 albaInteractorGenericMouse.
vtkTransformPolyDataFilter * m_VerticalFeedbackCylinderTransformPDF
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