ALBA
albaGizmoRotateCircle.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: ALBA (Agile Library for Biomedical Applications)
4 Module: albaGizmoRotateCircle
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 __albaGRotateCircle_H__
18#define __albaGRotateCircle_H__
19
20//----------------------------------------------------------------------------
21// Include:
22//----------------------------------------------------------------------------
23#include "albaEvent.h"
24#include "albaGizmoInterface.h"
25#include "albaSmartPointer.h"
26
27//----------------------------------------------------------------------------
28// forward references :
29//----------------------------------------------------------------------------
33class albaVMEGizmo;
34class albaMatrix;
35class albaVME;
36class vtkDiskSource;
37class vtkCleanPolyData;
38class vtkTubeFilter;
39class vtkTransformPolyDataFilter;
40class vtkTransform;
41
42template class ALBA_EXPORT albaAutoPointer<albaMatrix>;
43
44//----------------------------------------------------------------------------
50{
51public:
52 albaGizmoRotateCircle(albaVME *input, albaObserver *listener = NULL, albaString name = "Circle");
54
57 void SetInput(albaVME *vme);
59
60 //----------------------------------------------------------------------------
61 // events handling
62 //----------------------------------------------------------------------------
63
65 void SetListener(albaObserver *Listener);
66
68 virtual void OnEvent(albaEventBase *alba_event);
69
70 //----------------------------------------------------------------------------
71 // axis setting
72 //----------------------------------------------------------------------------
73
75 enum AXIS {X = 0, Y, Z};
76
78 void SetAxis(int axis);
79
81 int GetAxis();
82
83 //----------------------------------------------------------------------------
84 // highlight and show
85 //----------------------------------------------------------------------------
86
88 void Highlight(bool highlight);
89
91 void Show(bool show);
92
93 //----------------------------------------------------------------------------
94 // radius setting
95 //----------------------------------------------------------------------------
96
98 void SetRadius(double radius);
99 double GetRadius();
100
101 //----------------------------------------------------------------------------
102 // activation status
103 //----------------------------------------------------------------------------
104
107 void SetIsActive(bool highlight);
109
112 void SetAbsPose(albaMatrix *absPose);
114
118
120 void SetMediator(albaObserver *mediator);
121
122protected:
123
128
130
132 albaVMEGizmo *m_GizmoCircle;
133
136
149 enum GIZMO_STATUS {SELECTED = 0, NOT_SELECTED};
150
153
155 vtkDiskSource *m_Circle;
156
158 vtkCleanPolyData *m_CleanCircle;
159
161 vtkTubeFilter *m_CircleTF;
162
164 vtkTransformPolyDataFilter *m_RotatePDF;
165
167 vtkTransform *m_RotationTr;
168
171
173 void CreateISA();
174
177
180
182 void SetColor(double col[3]);
183 void SetColor(double colR, double colG, double colB);
184
188
191
193 double m_Radius;
194
197};
198
199#endif
Hold a reference to a T instance.
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 perform constrained rotation around an axis.
albaVMEGizmo * m_GizmoCircle
Circle gizmo.
void CreateISA()
Create isa stuff.
void SetColor(double col[3])
Gizmo color setting facilities for gizmo segments;.
void SetAxis(int axis)
Set/Get gizmo axis, default axis is X.
void Show(bool show)
Show gizmo.
double m_Radius
Register gizmo radius.
virtual ~albaGizmoRotateCircle()
void SetInput(albaVME *vme)
Set the gizmo generating vme; the gizmo will be centered on this vme.
vtkDiskSource * m_Circle
Create the circle polydata.
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
rotate PDF for gizmo
albaVME * m_InputVme
Register input vme.
void SetListener(albaObserver *Listener)
Set the event receiver object.
albaInteractorGenericInterface * GetInteractor()
Get the gizmo interactor.
void SetRadius(double radius)
Set/Get the radius of the gizmo.
albaInteractorCompositorMouse * m_IsaComp
isa compositor
friend class albaGizmoRotateCircleTest
friend test
void SetAbsPose(albaMatrix *absPose)
Set the abs pose.
vtkTransform * m_RotationTr
rotation transform
vtkTubeFilter * m_CircleTF
Tube filter for circle.
albaGizmoRotateCircle(albaVME *input, albaObserver *listener=NULL, albaString name="Circle")
void SetColor(double colR, double colG, double colB)
void CreatePipeline()
Create vtk objects needed.
albaAutoPointer< albaMatrix > m_AbsInputMatrix
albaObserver * m_Listener
Register the event receiver object.
int GetAxis()
Get egizmo axis.
virtual void OnEvent(albaEventBase *alba_event)
Events handling.
void Highlight(bool highlight)
Highlight gizmo.
bool m_IsActive
Register Gizmo status.
vtkCleanPolyData * m_CleanCircle
Clean the circle polydata.
int m_ActiveAxis
Register the gizmo axis.
void SetRefSysMatrix(albaMatrix *matrix)
Set the reference system matrix and the Pivot ref sys matrix.
albaMatrix * GetAbsPose()
Get the gizmo abs pose.
albaInteractorGenericMouse * m_IsaGen
isa generic
void SetMediator(albaObserver *mediator)
Superclass override.
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
albaString - performs common string operations on c-strings.
Definition: albaString.h:43
albaVME -
Definition: albaVME.h:150