ALBA
albaGizmoCrossRotateAxis.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: ALBA (Agile Library for Biomedical Applications)
4 Module: albaGizmoCrossRotateAxis
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 __albaGizmoCrossRotateAxis_H__
29#define __albaGizmoCrossRotateAxis_H__
30
31//----------------------------------------------------------------------------
32// Include:
33//----------------------------------------------------------------------------
34#include "albaEvent.h"
35#include "albaGizmoInterface.h"
36#include "albaSmartPointer.h"
37#include "vtkConeSource.h"
38#include "vtkTransform.h"
39#include "vtkTransformPolyDataFilter.h"
40#include "vtkDiskSource.h"
41#include "vtkCleanPolyData.h"
42#include "vtkTubeFilter.h"
43
44//----------------------------------------------------------------------------
45// forward references :
46//----------------------------------------------------------------------------
50class albaVMEGizmo;
51class albaMatrix;
52class albaVME;
53class vtkLineSource;
54class vtkCleanPolyData;
55class vtkTubeFilter;
56class vtkTransformPolyDataFilter;
57class vtkTransform;
58class vtkAppendPolyData;
59
64{
65public:
68
71 void SetInput(albaVME *vme);
73
74 //----------------------------------------------------------------------------
75 // events handling
76 //----------------------------------------------------------------------------
77
79 void SetListener(albaObserver *Listener);
80
82 virtual void OnEvent(albaEventBase *alba_event);
83
84 //----------------------------------------------------------------------------
85 // axis setting
86 //----------------------------------------------------------------------------
87
89 enum AXIS {X = 0, Y, Z};
90
92 void SetRotationAxis(int axis);
93
95 int GetAxis();
96
97 enum GIZMO_DIRECTION {EW = 0, NS = 1 };
98
99
111 void SetGizmoDirection(int direction);
113
114 //----------------------------------------------------------------------------
115 // highlight and show
116 //----------------------------------------------------------------------------
117
119 void Highlight(bool highlight);
120
122 void Show(bool show);
123
126
127 //----------------------------------------------------------------------------
128 // radius setting
129 //----------------------------------------------------------------------------
130
132 double GetRadius();
133
134 //----------------------------------------------------------------------------
135 // activation status
136 //----------------------------------------------------------------------------
137
140 void SetIsActive(bool isActive);
142
145 void SetAbsPose(albaMatrix *absPose);
147
151
153 void SetColor(double col[3]);
154 void SetColor(double colR, double colG, double colB);
155
156protected:
157
158 double m_Color[3];
159 double m_LastColor[3];
160
165
167
169 albaVMEGizmo *m_GizmoCross;
170
173
187
188
190
193
195 vtkLineSource *m_LineSourceEast;
196 vtkLineSource *m_LineSourceWest;
197 vtkLineSource *m_LineSourceNorth;
198 vtkLineSource *m_LineSourceSouth;
199
200 vtkCleanPolyData *m_LinesCleanCircle;
201
202 vtkTubeFilter *m_LinesTubeFilter;
203 vtkAppendPolyData *m_LinesAppendPolyData;
204
206 vtkTransformPolyDataFilter *m_LinesRotatePDF;
207
210
213
216
218 void CreateISA();
219
222
225
229
232
234 double m_Radius;
235
236 vtkConeSource *m_FeedbackConeSource;
237
242
243 vtkTransformPolyDataFilter *m_LeftUpFeedbackConeTransformPDF;
244 vtkTransformPolyDataFilter *m_LeftDownFeedbackConeTransformPDF;
245 vtkTransformPolyDataFilter *m_RightUpFeedbackConeTransformPDF;
246 vtkTransformPolyDataFilter *m_RightDownFeedbackConeTransformPDF;
247
248 vtkDiskSource *m_FGCircle;
249 vtkCleanPolyData *m_FGCleanCircle;
250 vtkTubeFilter *m_FGCircleTubeFilter;
252 vtkTransformPolyDataFilter *m_FGRotatePDF;
253 vtkTubeFilter *m_FGCircleTF;
254 vtkTransform *m_FGRotationTr;
255
258
259};
260#endif
Hold a reference to a T instance.
Implementation of the message object for the Subject/Observer design pattern.
Definition: albaEventBase.h:49
Basic gizmo component used to perform constrained rotation around an axis.
void SetListener(albaObserver *Listener)
Set the event receiver object.
vtkTransformPolyDataFilter * m_RightUpFeedbackConeTransformPDF
virtual void OnEvent(albaEventBase *alba_event)
Events handling.
albaGizmoCrossRotateAxis(albaVME *input, albaObserver *listener=NULL)
void SetGizmoDirection(int direction)
Set the gizmo visual representation: NS vs EW.
void SetColor(double colR, double colG, double colB)
vtkAppendPolyData * m_FeedbackStuffAppendPolydata
void SetInput(albaVME *vme)
Set the gizmo generating vme; the gizmo will be centered on this vme.
void CreateFeedbackGizmoPipeline()
Create motion feedback gizmo vtk objects.
albaVME * m_InputVme
Register input vme.
albaVMEGizmo * m_GizmoCross
Circle gizmo.
void ShowTranslationFeedbackArrows(bool show)
Show the translation feedback arrows
vtkTransform * m_RightDownFeedbackConeTransform
int GetAxis()
Get the gizmo axis.
albaMatrix * GetAbsPose()
Get the gizmo abs pose.
void SetRotationAxis(int axis)
Set/Get the gizmo axis, default axis is X.
void SetColor(double col[3])
Gizmo color setting facilities for gizmo segments;.
double GetRadius()
Get the radius of the gizmo.
vtkAppendPolyData * m_LinesAppendPolyData
albaAutoPointer< albaMatrix > m_AbsInputMatrix
vtkLineSource * m_LineSourceEast
Create the circle polydata.
vtkTransform * m_LinesRotationTransform
rotation transform
void Show(bool show)
Show the translation gizmo.
vtkTransformPolyDataFilter * m_RightDownFeedbackConeTransformPDF
virtual ~albaGizmoCrossRotateAxis()
albaInteractorGenericMouse * m_IsaGen
isa generic
bool m_IsActive
Register Gizmo status.
vtkTransform * m_LeftDownFeedbackConeTransform
vtkTransformPolyDataFilter * m_LinesRotatePDF
rotate PDF for gizmo
albaInteractorGenericInterface * GetInteractor()
Get the gizmo interactor.
double m_Radius
Register gizmo radius.
albaInteractorCompositorMouse * m_IsaComp
isa compositor
vtkTransformPolyDataFilter * m_LeftDownFeedbackConeTransformPDF
void Highlight(bool highlight)
Highlight gizmo.
int m_RotationAxis
Register the gizmo axis.
albaObserver * m_Listener
Register the event receiver object.
void SetRefSysMatrix(albaMatrix *matrix)
Set the reference system matrix and the Pivot ref sys matrix.
vtkTransformPolyDataFilter * m_FGRotatePDF
void CreatePipeline()
Create moving gizmo vtk objects.
void CreateISA()
Create isa stuff.
void SetAbsPose(albaMatrix *absPose)
Set the abs pose.
vtkTransformPolyDataFilter * m_LeftUpFeedbackConeTransformPDF
void SetIsActive(bool isActive)
Set/Get the activation status of the gizmo, When the gizmo is active it is sending pose matrices to t...
Base class for operations and views gizmos.
Associates instances of albaInteractorGenericMouse to mouse buttons and ctrl/shift keys combinations.
Abstract class for general purpose interactor.
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