ALBA
albaInteractorGenericInterface.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: ALBA (Agile Library for Biomedical Applications)
4 Module: albaInteractorGenericInterface
5 Authors: Marco Petrone, 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 __albaInteractorGenericInterface_h
18#define __albaInteractorGenericInterface_h
19
20#include "albaInteractor.h"
22
23//----------------------------------------------------------------------------
24// forward declarations :
25//----------------------------------------------------------------------------
26class albaRefSys;
27class albaTransform;
28class vtkRenderer;
29
60{
61public:
62 //------------------------------------------------------------------------------
63 // Events
64 //------------------------------------------------------------------------------
65
66 ALBA_ID_DEC(MOVE_EVENT);
67
69
81
87 void SetPivotRefSys(albaRefSys &pivot_frame );
88 void SetPivotRefSys(albaRefSys *pivot_frame );
92 albaRefSys *GetPivotRefSys() {return m_PivotRefSys;}
93
94 //----------------------------------------------------------------------------
95 // Transform Enabling:
96 //----------------------------------------------------------------------------
97
101 void EnableTranslation(bool enable);
102 void EnableRotation(bool enable);
103 void EnableScaling(bool enable);
104 void EnableUniformScaling(bool enable);
105
109 bool GetTranslationFlag() {return m_TranslationFlag;}
110 bool GetRotationFlag() {return m_RotationFlag;}
111 bool GetScalingFlag() {return m_ScalingFlag;}
112 bool GetUniformScalingFlag() {return m_UniformScalingFlag;}
113
114
115 //----------------------------------------------------------------------------
116 // Constraint Set/Get:
117 //----------------------------------------------------------------------------
118
121 albaInteractorConstraint *GetTranslationConstraint() {return m_TranslationConstraint;}
122
126
129 albaInteractorConstraint *GetRotationConstraint() {return m_RotationConstraint;}
130
134
137 albaInteractorConstraint *GetScaleConstraint() {return m_ScaleConstraint;}
142
143 //----------------------------------------------------------------------------
144
152
158 albaTransform *GetResultTransform() { return m_ResultTransform; }
159
161 virtual void SetRendererAndView(vtkRenderer *ren, albaView *view);
162
164 virtual void SetVME(albaVME *vme);
165
167 void SetSurfaceSnap(bool flag) {m_SurfaceSnap=flag;}
168 bool GetSurfaceSnap() {return m_SurfaceSnap;}
169 void SurfaceSnapOn() {SetSurfaceSnap(true);}
170 void SurfaceSnapOff() {SetSurfaceSnap(false);}
171
173 void SetSurfaceNormal(bool flag) {m_SurfaceNormal=flag;}
174 bool GetSurfaceNormal() {return m_SurfaceNormal;}
175 void SurfaceNormalOn() {SetSurfaceNormal(true);}
176 void SurfaceNormalOff() {SetSurfaceNormal(false);}
177
178protected:
181
187 virtual void EnableTranslationInternal(bool enable);
188 virtual void EnableRotationInternal(bool enable);
189 virtual void EnableScalingInternal(bool enable);
190 virtual void EnableUniformScalingInternal(bool enable);
191
195
199
204
205 bool m_SurfaceSnap; //< toggle surface snap
206 bool m_SurfaceNormal; //< toggle surface snap
207
208private:
210 void operator=(const albaInteractorGenericInterface&); // Not implemented.
211};
212
213#endif
214
class representing a constraint for the interaction This class is used to store constraint modality p...
Abstract class for general purpose interactor.
albaRefSys * m_PivotRefSys
the pivot point (only position is considered)
virtual void SetVME(albaVME *vme)
Set the node to be transformed.
albaInteractorConstraint * GetTranslationConstraint()
Get the translation constraint.
void SetScaleConstraint(albaInteractorConstraint *constrain)
Set the scaling constraint.
void SetTargetRefSys(albaRefSys *ref_sys)
bool GetTranslationFlag()
Return the translation flag.
albaTransform * m_ResultTransform
store the pointer to the matrix to be updated
void SetResultTransform(albaTransform *result)
The Result Transform is an optional transform to which the interactor concatenates the OutputTransfor...
void SetTranslationConstraint(albaInteractorConstraint *constrain)
Set the translation constraint.
virtual void EnableUniformScalingInternal(bool enable)
void EnableScaling(bool enable)
void EnableTranslation(bool enable)
Set the translation/rotation/scale to on/off.
albaInteractorConstraint * GetScaleConstraint()
Get the scale constraint.
void EnableRotation(bool enable)
albaInteractorConstraint * m_TranslationConstraint
the constrain for translation
albaAbstractTypeMacro(albaInteractorGenericInterface, albaInteractor)
albaRefSys * m_TargetRefSys
the target ref_sys matrix
albaRefSys * GetPivotRefSys()
Return the Pivot frame.
void SetSurfaceNormal(bool flag)
If Surface Snap modifier is on translation and rotation will be constrained to picked surfaces if pos...
virtual void EnableTranslationInternal(bool enable)
Dervived classes should override this methods in order to set internal flags in a consistent way.
albaInteractorConstraint * m_ScaleConstraint
the constrain for scaling
void SetPivotRefSys(albaRefSys *pivot_frame)
void EnableUniformScaling(bool enable)
void SetRotationConstraint(albaInteractorConstraint *constrain)
Set the rotation constraint.
virtual void EnableRotationInternal(bool enable)
virtual void EnableScalingInternal(bool enable)
void SetPivotRefSys(albaRefSys &pivot_frame)
Set the Pivot frame.
void SetTargetRefSys(albaRefSys &ref_sys)
Set the Target reference system, i.e.
albaRefSys * GetTargetRefSys()
Get the Target ref sys, i.e.
albaInteractorConstraint * GetRotationConstraint()
Get the rotation constraint.
virtual void SetRendererAndView(vtkRenderer *ren, albaView *view)
redefined to set the renderer also in the constraint
ALBA_ID_DEC(MOVE_EVENT)
Issued when a move action has been performed.
void SetResultMatrix(albaMatrix *result)
The Result Matrix is an optional matrix to which the interactor concatenates the OutputTransform at e...
albaInteractorConstraint * m_RotationConstraint
the constrain for rotation
void SetSurfaceSnap(bool flag)
If Surface Snap modifier is on translation and rotation will be constrained to picked surfaces if pos...
Abstract class for ALBA interactors This class provides base interface and features of ALBA continuou...
albaMatrix - Time stamped 4x4 Matrix.
Definition: albaMatrix.h:44
class representing reference system
Definition: albaRefSys.h:49
albaTransform - class for homogeneous transformations.
Definition: albaTransform.h:53
albaVME -
Definition: albaVME.h:150
albaView is the base class for Views in alba.
Definition: albaView.h:79