Computer Assited Medical Intervention Tool Kit  version 4.1
InterfaceFrame.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * $CAMITK_LICENCE_BEGIN$
3  *
4  * CamiTK - Computer Assisted Medical Intervention ToolKit
5  * (c) 2001-2018 Univ. Grenoble Alpes, CNRS, TIMC-IMAG UMR 5525 (GMCAO)
6  *
7  * Visit http://camitk.imag.fr for more information
8  *
9  * This file is part of CamiTK.
10  *
11  * CamiTK is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * CamiTK is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU Lesser General Public License version 3 for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public License
21  * version 3 along with CamiTK. If not, see <http://www.gnu.org/licenses/>.
22  *
23  * $CAMITK_LICENCE_END$
24  ****************************************************************************/
25 
26 #ifndef INTERFACEFRAME_H
27 #define INTERFACEFRAME_H
28 
29 #include <QString>
30 #include <QVector>
31 
32 // -- std stuff
33 #include <vector>
34 
35 // -- vtk stuff
36 #include <vtkType.h>
37 #include <vtkSmartPointer.h>
38 
39 // -- vtk stuff classes
40 class vtkAxesActor;
41 class vtkTransform;
42 
43 namespace camitk {
44 
45 class Viewer;
46 
65 
66 public:
68  virtual ~InterfaceFrame() = default;
69 
74  virtual const QString& getFrameName() const = 0;
76 
78  virtual void setFrameName(QString name) = 0;
79 
81  virtual InterfaceFrame* getParentFrame() const = 0;
82 
88  virtual void setParentFrame(InterfaceFrame* parent, bool keepTransform = true) = 0;
89 
94  virtual const QVector<InterfaceFrame*>& getChildrenFrame() const = 0;
95 
102  virtual const vtkSmartPointer<vtkTransform> getTransformFromWorld() const = 0;
104 
106  virtual const vtkSmartPointer<vtkTransform> getTransform() const = 0;
107 
111  virtual const vtkSmartPointer<vtkTransform> getTransformFromFrame(InterfaceFrame* frame) const = 0;
112 
117  virtual void setTransform(vtkSmartPointer<vtkTransform> transform) = 0;
118 
123  virtual void resetTransform() = 0;
124 
125 
129  virtual void translate(double x, double y, double z) = 0;
130 
136  virtual void rotate(double aroundX, double aroundY, double aroundZ) = 0;
137 
142  virtual void rotateVTK(double aroundX, double aroundY, double aroundZ) = 0;
143 
153  virtual void setTransformTranslation(double x, double y, double z) = 0;
154 
163  virtual void setTransformTranslationVTK(double x, double y, double z) = 0;
164 
173  virtual void setTransformRotation(double aroundX, double aroundY, double aroundZ) = 0;
174 
183  virtual void setTransformRotationVTK(double aroundX, double aroundY, double aroundZ) = 0;
184 
190  virtual vtkSmartPointer<vtkAxesActor> getFrameAxisActor() = 0;
191 
195  virtual void setFrameVisibility(Viewer* viewer, bool visible) = 0;
196 
201  virtual bool getFrameVisibility(Viewer* viewer) const = 0;
202 
207  virtual void addFrameChild(InterfaceFrame* frame) = 0;
208 
213  virtual void removeFrameChild(InterfaceFrame* frame) = 0;
214 
215 };
216 
217 }
218 
219 #endif // INTERFACEFRAME_H
virtual void rotate(double aroundX, double aroundY, double aroundZ)=0
Apply rotations relative to the current position in the alphabetical order (X, Y, Z)...
virtual const QVector< InterfaceFrame * > & getChildrenFrame() const =0
Get the Children Frames from the current Frame in the Frame Hierarchy The Frame hierarchy may not be ...
virtual void addFrameChild(InterfaceFrame *frame)=0
Add the input frame as a child of the current frame.
virtual const vtkSmartPointer< vtkTransform > getTransformFromFrame(InterfaceFrame *frame) const =0
Compute the transformation from any other frame to the current frame.
virtual void setTransformRotation(double aroundX, double aroundY, double aroundZ)=0
Set the rotation part of the 3D space transformation of the current frame.
virtual void translate(double x, double y, double z)=0
Apply a translation relative to the current position.
Viewer is an abstract viewer.
Definition: Viewer.h:55
virtual void rotateVTK(double aroundX, double aroundY, double aroundZ)=0
Apply a rotation relative to the current position, using the VTK rotation order (Z, X, Y)
Definition: Action.cpp:36
virtual InterfaceFrame * getParentFrame() const =0
Get the parent frame.
virtual void setParentFrame(InterfaceFrame *parent, bool keepTransform=true)=0
Set the parent frame and update or not its transform during the parent transition.
virtual void setFrameVisibility(Viewer *viewer, bool visible)=0
Set the Component Frame visible for a given viewer.
This class describes what are the methods to implement in order to manage a Component position in spa...
Definition: InterfaceFrame.h:64
virtual ~InterfaceFrame()=default
empty virtual destructor, to avoid memory leak
virtual bool getFrameVisibility(Viewer *viewer) const =0
Get the Component Frame visibility for a given viewer.
virtual void setTransformTranslation(double x, double y, double z)=0
Set the translation part of the 3D space transformation of the current frame.
virtual void setTransform(vtkSmartPointer< vtkTransform > transform)=0
Set the current input frame position (according to its parent Frame)
virtual const vtkSmartPointer< vtkTransform > getTransformFromWorld() const =0
Transforms accessors / Modifyers.
virtual vtkSmartPointer< vtkAxesActor > getFrameAxisActor()=0
Gives the 3D representation of the frame (based on xyz arrows)
virtual const vtkSmartPointer< vtkTransform > getTransform() const =0
Get the transformation with respect to the parent frame.
virtual void setFrameName(QString name)=0
Set the Frame Unique identifyer.
virtual void setTransformTranslationVTK(double x, double y, double z)=0
Set the translation part of the 3D space transformation of the current frame.
virtual void setTransformRotationVTK(double aroundX, double aroundY, double aroundZ)=0
Set the rotation part of the 3D space transformation of the current frame.
virtual const QString & getFrameName() const =0
Hierarchy accessors / Modifyers.
virtual void resetTransform()=0
Set the current frame transform to identity.
virtual void removeFrameChild(InterfaceFrame *frame)=0
Remove the input frame as a child of the current frame.