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//----------------------------------------------------------------------------
32class albaVMEGizmo;
33class albaMatrix;
34class albaVME;
35class vtkDiskSource;
36class vtkCleanPolyData;
37class vtkTubeFilter;
38class vtkTransformPolyDataFilter;
39class vtkTransform;
40
41template class ALBA_EXPORT albaAutoPointer<albaMatrix>;
42
43//----------------------------------------------------------------------------
49{
50public:
51 albaGizmoRotateCircle(albaVME *input, albaObserver *listener = NULL, albaString name = "Circle");
53
56 void SetInput(albaVME *vme);
58
59 //----------------------------------------------------------------------------
60 // events handling
61 //----------------------------------------------------------------------------
62
64 void SetListener(albaObserver *Listener);
65
67 virtual void OnEvent(albaEventBase *alba_event);
68
69 //----------------------------------------------------------------------------
70 // axis setting
71 //----------------------------------------------------------------------------
72
74 enum AXIS {X = 0, Y, Z};
75
77 void SetAxis(int axis);
78
80 int GetAxis();
81
82 //----------------------------------------------------------------------------
83 // highlight and show
84 //----------------------------------------------------------------------------
85
87 void Highlight(bool highlight);
88
90 void Show(bool show);
91
92 //----------------------------------------------------------------------------
93 // radius setting
94 //----------------------------------------------------------------------------
95
97 void SetRadius(double radius);
98 double GetRadius();
99
100 //----------------------------------------------------------------------------
101 // activation status
102 //----------------------------------------------------------------------------
103
106 void SetIsActive(bool highlight);
108
111 void SetAbsPose(albaMatrix *absPose);
113
117
119 void SetMediator(albaObserver *mediator);
120
121protected:
122
127
129
131 albaVMEGizmo *m_GizmoCircle;
132
135
148 enum GIZMO_STATUS {SELECTED = 0, NOT_SELECTED};
149
152
154 vtkDiskSource *m_Circle;
155
157 vtkCleanPolyData *m_CleanCircle;
158
160 vtkTubeFilter *m_CircleTF;
161
163 vtkTransformPolyDataFilter *m_RotatePDF;
164
166 vtkTransform *m_RotationTr;
167
170
172 void CreateISA();
173
174
177
179 void SetColor(double col[3]);
180 void SetColor(double colR, double colG, double colB);
181
185
188
190 double m_Radius;
191
194};
195
196#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
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.
albaBehaviorTransform * m_IsaGen
isa generic
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
albaBehaviorTransform * GetInteractor()
Get the gizmo interactor.
albaVME * m_InputVme
Register input vme.
void SetListener(albaObserver *Listener)
Set the event receiver object.
void SetRadius(double radius)
Set/Get the radius of the gizmo.
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.
void SetMediator(albaObserver *mediator)
Superclass override.
albaMatrix - Time stamped 4x4 Matrix.
Definition: albaMatrix.h:45
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