ALBA
albaGizmoScaleAxis.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: ALBA (Agile Library for Biomedical Applications)
4 Module: albaGizmoScaleAxis
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 __albaGizmoScaleAxis_H__
18#define __albaGizmoScaleAxis_H__
19
20//----------------------------------------------------------------------------
21// Include:
22//----------------------------------------------------------------------------
23#include "albaEvent.h"
24#include "albaGizmoInterface.h"
25
26//----------------------------------------------------------------------------
27// forward references :
28//----------------------------------------------------------------------------
31
32class albaVMEGizmo;
33class albaMatrix;
34class albaVME;
35
36class vtkCubeSource;
37class vtkCylinderSource;
38class vtkTransformPolyDataFilter;
39class vtkTransform;
40
45class ALBA_EXPORT albaGizmoScaleAxis: public albaGizmoInterface
46{
47public:
48 albaGizmoScaleAxis(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 AXIS {X = 0, Y, Z};
72
74 void SetAxis(int axis);
75 int GetAxis() const;
76
77 //----------------------------------------------------------------------------
78 // highlight and show
79 //----------------------------------------------------------------------------
80
82 void Highlight(bool highlight);
83
85 void Show(bool show);
86
87
90 void SetAbsPose(albaMatrix *absPose);
92
93 //----------------------------------------------------------------------------
94 // cube stuff
95 //----------------------------------------------------------------------------
96
98 void SetCubeLength(double length);
99 double GetCubeLength() const;
100
101 //----------------------------------------------------------------------------
102 // cylinder stuff
103 //----------------------------------------------------------------------------
104
106 void SetCylinderLength(double length);
107 double GetCylinderLength() const;
108
109protected:
110
113 void SetRefSysMatrix(albaMatrix *constrain);
114
116 albaVMEGizmo *m_CubeGizmo;
117
119 albaVMEGizmo *m_CylGizmo;
120
123
124 enum GIZMOPARTS {CYLINDER = 0, CUBE};
125
128
130 vtkCubeSource *m_Cube;
131
133 vtkCylinderSource *m_Cylinder;
134
136 vtkTransformPolyDataFilter *m_TranslatePDF[2];
137
139 vtkTransform *m_TranslateTr[2];
140
142 vtkTransformPolyDataFilter *m_RotatePDF[2];
143
145 vtkTransform *m_RotationTr;
146
149
151 void CreateISA();
152
155
158
160 void SetColor(int part, double col[3]);
161 void SetColor(int part, double colR, double colG, double colB);
162 void SetColor(double cylCol[3], double coneCol[3]);
163 void SetColor(double cylR, double cylG, double cylB, double coneR, double coneG, double coneB);
164
168
172
175 bool m_Show;
176
178 friend class albaGizmoScaleAxisTest;
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 perform constrained scaling along one axis.
void SetColor(double cylR, double cylG, double cylB, double coneR, double coneG, double coneB)
albaGizmoScaleAxis(albaVME *input, albaObserver *listener=NULL)
albaObserver * m_Listener
Register the event receiver object.
void SetAxis(int axis)
Set/Get gizmo axis, default axis is X.
void CreateISA()
Create isa stuff.
vtkTransform * m_RotationTr
rotation transform for cylinder and cube
void CreatePipeline()
Create vtk objects needed.
void SetCubeLength(double length)
Set/Get the length of the cone.
void SetListener(albaObserver *Listener)
Set the event receiver object.
albaVMEGizmo * m_CubeGizmo
Cube gizmo.
int GetAxis() const
void SetInput(albaVME *vme)
Set the gizmo generating vme; the gizmo will be centered on this vme.
void SetAbsPose(albaMatrix *absPose)
Set the abs pose.
bool m_Highlight
Register the highlight status.
virtual void OnEvent(albaEventBase *alba_event)
Events handling.
void SetColor(int part, double col[3])
Gizmo color setting facilities; part can be CYLINDER or CUBE.
void Show(bool show)
Show the gizmo.
albaMatrix * GetAbsPose()
Get the gizmo abs pose.
double GetCubeLength() const
void SetRefSysMatrix(albaMatrix *constrain)
Set the constrain ref sys.
double GetCylinderLength() const
void SetColor(int part, double colR, double colG, double colB)
void Highlight(bool highlight)
Highlight the gizmo.
vtkCubeSource * m_Cube
Cube source.
albaVME * m_InputVme
Register input vme.
bool m_Show
register the show status
void SetColor(double cylCol[3], double coneCol[3])
albaVMEGizmo * m_CylGizmo
cylinder gizmo
int m_Axis
Register the gizmo axis.
vtkCylinderSource * m_Cylinder
Cylinder source.
void SetCylinderLength(double length)
Set/Get the length of the cylinder.
virtual ~albaGizmoScaleAxis()
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