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//----------------------------------------------------------------------------
31class albaVME;
32class albaVMEGizmo;
33class albaMatrix;
34class vtkLineSource;
35class vtkPlaneSource;
36class vtkTransformPolyDataFilter;
37class vtkTransform;
38class vtkTubeFilter;
39//----------------------------------------------------------------------------
40
46{
47public:
48 albaGizmoTranslatePlane(albaVME *input, albaObserver *listener = NULL);
50
53 void SetInput(albaVME *vme);
54 albaVME *GetInput() {return this->m_InputVme;};
55
56 //----------------------------------------------------------------------------
57 // events handling
58 //----------------------------------------------------------------------------
59
61 void SetListener(albaObserver *Listener) {m_Listener = Listener;};
62
64 virtual void OnEvent(albaEventBase *alba_event);
65
66 //----------------------------------------------------------------------------
67 // axis setting
68 //----------------------------------------------------------------------------
69
71 enum PLANE {YZ = 0, XZ, XY};
72
74 void SetPlane(int axis);
75
77 int GetPlane() {return m_ActivePlane;};
78
79 //----------------------------------------------------------------------------
80 // highlight and show
81 //----------------------------------------------------------------------------
82
84 void Highlight(bool highlight);
85
87 void Show(bool show);
88
89
90 //----------------------------------------------------------------------------
91 // size setting
92 //----------------------------------------------------------------------------
93
95 void SetSizeLength(double length);
96 double GetSizeLength() {return m_Length;};
97
98
99 //----------------------------------------------------------------------------
100 // activation status
101 //----------------------------------------------------------------------------
102
105 void SetIsActive(bool highlight) {m_IsActive = highlight;};
106 bool GetIsActive() {return m_IsActive;}
107
110 void SetAbsPose(albaMatrix *absPose);
112
116
120 void SetConstraintModality(int axis, int constrainModality);
121
123 void SetStep(int axis, double step);
124
125protected:
127 albaVMEGizmo *m_Gizmo[3];
128
131
152 enum GIZMOPARTS {S1 = 0, S2, SQ};
153 enum GIZMO_STATUS {SELECTED = 0, NOT_SELECTED};
154
157
159 double m_Length;
160
162 vtkLineSource *m_Line[2];
163
165 vtkTubeFilter *m_LineTF[2];
166
168 vtkPlaneSource *m_Plane;
169
171 //albaVmeData *GizmoData[3];
172
174 vtkTransformPolyDataFilter *m_RotatePDF[3];
175
177 vtkTransform *m_RotationTr;
178
181
183 void CreateISA();
184
187
190
192 vtkTransform *m_PivotTransform;
193
195 void SetColor(int part, double col[3]);
196 void SetColor(int part, double colR, double colG, double colB);
200
202 void ShowSquare(bool show);
203
206
207 friend class albaGizmoTranslatePlaneTest;
208};
209#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 perform constrained translation on a plane.
vtkTransform * m_PivotTransform
Used by albaInteractorGenericMouse.
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.
Associates instances of albaInteractorGenericMouse to mouse buttons and ctrl/shift keys combinations.
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
albaVME -
Definition: albaVME.h:150