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//----------------------------------------------------------------------------
49class albaVMEGizmo;
50class albaMatrix;
51class albaVME;
52class vtkLineSource;
53class vtkCleanPolyData;
54class vtkTubeFilter;
55class vtkTransformPolyDataFilter;
56class vtkTransform;
57class vtkAppendPolyData;
58
63{
64public:
67
70 void SetInput(albaVME *vme);
72
73 //----------------------------------------------------------------------------
74 // events handling
75 //----------------------------------------------------------------------------
76
78 void SetListener(albaObserver *Listener);
79
81 virtual void OnEvent(albaEventBase *alba_event);
82
83 //----------------------------------------------------------------------------
84 // axis setting
85 //----------------------------------------------------------------------------
86
88 enum AXIS {X = 0, Y, Z};
89
91 void SetRotationAxis(int axis);
92
94 int GetAxis();
95
96 enum GIZMO_DIRECTION {EW = 0, NS = 1 };
97
98
110 void SetGizmoDirection(int direction);
112
113 //----------------------------------------------------------------------------
114 // highlight and show
115 //----------------------------------------------------------------------------
116
118 void Highlight(bool highlight);
119
121 void Show(bool show);
122
125
126 //----------------------------------------------------------------------------
127 // radius setting
128 //----------------------------------------------------------------------------
129
131 double GetRadius();
132
133 //----------------------------------------------------------------------------
134 // activation status
135 //----------------------------------------------------------------------------
136
139 void SetIsActive(bool isActive);
141
144 void SetAbsPose(albaMatrix *absPose);
146
150
152 void SetColor(double col[3]);
153 void SetColor(double colR, double colG, double colB);
154
155protected:
156
157 double m_Color[3];
158 double m_LastColor[3];
159
164
166
168 albaVMEGizmo *m_GizmoCross;
169
172
186
187
189
192
194 vtkLineSource *m_LineSourceEast;
195 vtkLineSource *m_LineSourceWest;
196 vtkLineSource *m_LineSourceNorth;
197 vtkLineSource *m_LineSourceSouth;
198
199 vtkCleanPolyData *m_LinesCleanCircle;
200
201 vtkTubeFilter *m_LinesTubeFilter;
202 vtkAppendPolyData *m_LinesAppendPolyData;
203
205 vtkTransformPolyDataFilter *m_LinesRotatePDF;
206
209
212
215
217 void CreateISA();
218
219
222
226
229
231 double m_Radius;
232
233 vtkConeSource *m_FeedbackConeSource;
234
239
240 vtkTransformPolyDataFilter *m_LeftUpFeedbackConeTransformPDF;
241 vtkTransformPolyDataFilter *m_LeftDownFeedbackConeTransformPDF;
242 vtkTransformPolyDataFilter *m_RightUpFeedbackConeTransformPDF;
243 vtkTransformPolyDataFilter *m_RightDownFeedbackConeTransformPDF;
244
245 vtkDiskSource *m_FGCircle;
246 vtkCleanPolyData *m_FGCleanCircle;
247 vtkTubeFilter *m_FGCircleTubeFilter;
249 vtkTransformPolyDataFilter *m_FGRotatePDF;
250 vtkTubeFilter *m_FGCircleTF;
251 vtkTransform *m_FGRotationTr;
252
255
256};
257#endif
Hold a reference to a T instance.
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 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.
albaBehaviorTransform * GetInteractor()
Get the gizmo interactor.
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
albaBehaviorTransform * m_IsaGen
isa generic
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()
bool m_IsActive
Register Gizmo status.
vtkTransform * m_LeftDownFeedbackConeTransform
vtkTransformPolyDataFilter * m_LinesRotatePDF
rotate PDF for gizmo
double m_Radius
Register gizmo radius.
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.
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