ALBA
albaGizmoTranslatePlane.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: ALBA (Agile Library for Biomedical Applications)
4 Module: albaGizmoTranslatePlane
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 __albaGizmoTranslatePlane_H__
18#define __albaGizmoTranslatePlane_H__
19
20//----------------------------------------------------------------------------
21// Include:
22//----------------------------------------------------------------------------
23#include "albaEvent.h"
24#include "albaGizmoInterface.h"
25
26//----------------------------------------------------------------------------
27// forward references :
28//----------------------------------------------------------------------------
30class albaVME;
31class albaVMEGizmo;
32class albaMatrix;
33class vtkLineSource;
34class vtkPlaneSource;
35class vtkTransformPolyDataFilter;
36class vtkTransform;
37class vtkTubeFilter;
38//----------------------------------------------------------------------------
39
45{
46public:
47 albaGizmoTranslatePlane(albaVME *input, albaObserver *listener = NULL);
49
52 void SetInput(albaVME *vme);
53 albaVME *GetInput() {return this->m_InputVme;};
54
55 //----------------------------------------------------------------------------
56 // events handling
57 //----------------------------------------------------------------------------
58
60 void SetListener(albaObserver *Listener) {m_Listener = Listener;};
61
63 virtual void OnEvent(albaEventBase *alba_event);
64
65 //----------------------------------------------------------------------------
66 // axis setting
67 //----------------------------------------------------------------------------
68
70 enum PLANE {YZ = 0, XZ, XY};
71
73 void SetPlane(int axis);
74
76 int GetPlane() {return m_ActivePlane;};
77
78 //----------------------------------------------------------------------------
79 // highlight and show
80 //----------------------------------------------------------------------------
81
83 void Highlight(bool highlight);
84
86 void Show(bool show);
87
88
89 //----------------------------------------------------------------------------
90 // size setting
91 //----------------------------------------------------------------------------
92
94 void SetSizeLength(double length);
95 double GetSizeLength() {return m_Length;};
96
97
98 //----------------------------------------------------------------------------
99 // activation status
100 //----------------------------------------------------------------------------
101
104 void SetIsActive(bool highlight) {m_IsActive = highlight;};
105 bool GetIsActive() {return m_IsActive;}
106
109 void SetAbsPose(albaMatrix *absPose);
111
115
119 void SetConstraintModality(int axis, int constrainModality);
120
122 void SetStep(int axis, double step);
123
124protected:
126 albaVMEGizmo *m_Gizmo[3];
127
130
151 enum GIZMOPARTS {S1 = 0, S2, SQ};
152 enum GIZMO_STATUS {SELECTED = 0, NOT_SELECTED};
153
156
158 double m_Length;
159
161 vtkLineSource *m_Line[2];
162
164 vtkTubeFilter *m_LineTF[2];
165
167 vtkPlaneSource *m_Plane;
168
170 //albaVmeData *GizmoData[3];
171
173 vtkTransformPolyDataFilter *m_RotatePDF[3];
174
176 vtkTransform *m_RotationTr;
177
180
182 void CreateISA();
183
184
187
189 vtkTransform *m_PivotTransform;
190
192 void SetColor(int part, double col[3]);
193 void SetColor(int part, double colR, double colG, double colB);
197
199 void ShowSquare(bool show);
200
203
204 friend class albaGizmoTranslatePlaneTest;
205};
206#endif
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 translation on a plane.
vtkTransform * m_PivotTransform
Used by albaBehaviorTransform.
void CreatePipeline()
Create vtk objects needed.
void SetPlane(int axis)
Set/Get gizmo plane, default plane is YZ.
void ShowSquare(bool show)
Hide/show the square.
void SetIsActive(bool highlight)
Set/Get the activation status of the gizmo, When the gizmo is active it is sending pose matrices to t...
void CreateISA()
Create isa stuff.
void SetSizeLength(double length)
Set/Get the side length of the gizmo.
albaGizmoTranslatePlane(albaVME *input, albaObserver *listener=NULL)
void SetAbsPose(albaMatrix *absPose)
Set the abs pose.
void Show(bool show)
Show gizmo.
albaVME * m_InputVme
Register input vme.
void SetStep(int axis, double step)
Set the step value for snap step constraint type for the given axis.
bool m_IsActive
Register Gizmo status.
void Highlight(bool highlight)
Highlight gizmo.
void SetListener(albaObserver *Listener)
Set the event receiver object.
void SetColor(int part, double colR, double colG, double colB)
void SetConstraintModality(int axis, int constrainModality)
Set the constraint modality for the given axis; allowed constraint modality are: LOCK,...
virtual ~albaGizmoTranslatePlane()
void SetInput(albaVME *vme)
Set the gizmo generating vme; the gizmo will be centered on this vme.
vtkTransform * m_RotationTr
rotation transform for cylinder and cone
int m_ActivePlane
Register the gizmo plane.
int GetPlane()
Get gizmo Plane.
vtkPlaneSource * m_Plane
Plane source.
albaMatrix * GetAbsPose()
Get the gizmo abs pose.
void SetConstrainRefSys(albaMatrix *constrain)
Set the constrain ref sys.
void SetColor(int part, double col[3])
Gizmo color setting facilities for gizmo segments;.
double m_Length
Register the gizmo square plane side length.
virtual void OnEvent(albaEventBase *alba_event)
Events handling.
albaObserver * m_Listener
Register the event receiver object.
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