ALBA
albaGizmoRotateFan.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: ALBA (Agile Library for Biomedical Applications)
4 Module: albaGizmoRotateFan
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#ifndef __albaGizmoRotateFan_H__
18#define __albaGizmoRotateFan_H__
19
20//----------------------------------------------------------------------------
21// Include:
22//----------------------------------------------------------------------------
23#include "albaEvent.h"
24#include "albaGizmoInterface.h"
25
26//----------------------------------------------------------------------------
27// forward references :
28//----------------------------------------------------------------------------
29class vtkSphereSource;
30class vtkTransformPolyDataFilter;
31class vtkTransform;
32class albaVME;
33class albaVMEGizmo;
34class albaMatrix;
35class albaRefSys;
36
58class ALBA_EXPORT albaGizmoRotateFan : public albaGizmoInterface
59{
60public:
61 albaGizmoRotateFan(albaVME *input, albaObserver *listener = NULL);
63
66 void SetInput(albaVME *vme);
67 albaVME *GetInput() {return this->m_InputVme;};
68
69 //----------------------------------------------------------------------------
70 // events handling
71 //----------------------------------------------------------------------------
72
74 void SetListener(albaObserver *Listener) {m_Listener = Listener;};
75
77 virtual void OnEvent(albaEventBase *alba_event);
78
79 //----------------------------------------------------------------------------
80 // axis setting
81 //----------------------------------------------------------------------------
82
84 enum AXIS {X = 0, Y, Z};
85
87 void SetAxis(int axis);
88
90 int GetAxis();
91
92 //----------------------------------------------------------------------------
93 // show/ hide the gizmo
94 //----------------------------------------------------------------------------
95
97 void Show(bool show);
98
99 //----------------------------------------------------------------------------
100 // radius setting
101 //----------------------------------------------------------------------------
102
104 void SetRadius(double radius);
105 double GetRadius();
106
109 void SetAbsPose(albaMatrix *absPose);
110
112 void SetMediator(albaObserver *mediator);
113
114protected:
115
116
119
123
126
128 vtkSphereSource *m_Sphere;
129
132 vtkTransform *m_RotateFanTransform;
133
134 vtkTransformPolyDataFilter *m_RotateFanTPDF;
135
138
140 vtkTransformPolyDataFilter *m_ChangeFanAxisTPDF;
141
143 albaVMEGizmo *m_GizmoFan;
144
146 //albaVmeData *GizmoData;
147
150
152 void SetColor(double col[3]);
153 void SetColor(double colR, double colG, double colB);
154
158
159 enum MIRROR_STATUS {OFF = 0, ON};
160
163
164 vtkTransform *m_MirrorTr;
165 vtkTransform *m_BufferTr;
166 vtkTransformPolyDataFilter *m_MirrorTPDF;
167
169 double PointPickedToStartTheta(double xp, double yp, double zp);
170
174
176
178 friend class albaGizmoRotateFanTest;
179};
180#endif
Implementation of the message object for the Subject/Observer design pattern.
Definition: albaEventBase.h:49
Base class for operations and views gizmos.
Basic gizmo component used to give rotation angle feedback.
virtual ~albaGizmoRotateFan()
double m_StartTheta
Start angle and end angle.
void CreatePipeline()
gizmo data
void Show(bool show)
Show gizmo.
vtkTransform * m_BufferTr
double PointPickedToStartTheta(double xp, double yp, double zp)
Get the start theta from abs pick coordinates.
void SetRadius(double radius)
Set/Get the radius of the gizmo.
albaVMEGizmo * m_GizmoFan
Fan gizmo.
albaObserver * m_Listener
Register the event receiver object.
void SetListener(albaObserver *Listener)
Set the event receiver object.
void SetColor(double col[3])
m_Gizmo color setting facilities for gizmo segments;
int m_MirrorStatus
Register the mirror status of the fan; default status is off.
void SetAxis(int axis)
Set/Get gizmo axis, default axis is X.
virtual void OnEvent(albaEventBase *alba_event)
Events handling.
vtkTransform * m_MirrorTr
vtkTransformPolyDataFilter * m_ChangeFanAxisTPDF
rotate PDF for sphere
void SetAbsPose(albaMatrix *absPose)
Set the abs pose.
void SetColor(double colR, double colG, double colB)
void SetInput(albaVME *vme)
Set the gizmo generating vme; the gizmo will be centered on this vme.
vtkTransformPolyDataFilter * m_RotateFanTPDF
albaGizmoRotateFan(albaVME *input, albaObserver *listener=NULL)
int m_ActiveAxis
Register the gizmo axis.
vtkSphereSource * m_Sphere
Create the sphere.
void SetMediator(albaObserver *mediator)
Superclass override.
albaVME * m_InputVme
Register input vme.
vtkTransform * m_RotateFanTransform
Transform to rotate the fan around Z axis after creation to match new m_StartTheta angle.
int GetAxis()
Get gizmo axis.
vtkTransform * m_ChangeFanAxisTransform
sphere transform
void SetRefSysMatrix(albaMatrix *matrix)
Set the reference system matrix.
vtkTransformPolyDataFilter * m_MirrorTPDF
albaMatrix - Time stamped 4x4 Matrix.
Definition: albaMatrix.h:44
Interface implementing the Observer of the Subject/Observer design pattern.
Definition: albaObserver.h:36
class representing reference system
Definition: albaRefSys.h:49
albaVME -
Definition: albaVME.h:150