Computer Assited Medical Intervention Tool Kit  version 5.0
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-2021 Univ. Grenoble Alpes, CNRS, Grenoble INP, TIMC, 38000 Grenoble, France
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
40class vtkAxesActor;
41class vtkTransform;
42
43namespace camitk {
44
45class Viewer;
46
65
66public:
68 virtual ~InterfaceFrame() = default;
69
75 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
103 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
193
203 CAMITK_API_DEPRECATED("Please use InterfaceFrame::setFrameVisibility(QString viewerName, bool) instead") virtual void setFrameVisibility(Viewer*, bool) = 0;
204
208 CAMITK_API_DEPRECATED("Please use InterfaceFrame::getFrameVisibility(QString viewerName, bool) instead") virtual bool getFrameVisibility(Viewer*) const = 0;
210
214 virtual void setFrameVisibility(QString, bool) = 0;
215
219 virtual bool getFrameVisibility(QString) const = 0;
220
225 virtual void addFrameChild(InterfaceFrame* frame) = 0;
226
231 virtual void removeFrameChild(InterfaceFrame* frame) = 0;
232
233};
234
235}
236
237#endif // INTERFACEFRAME_H
#define CAMITK_API_DEPRECATED(X)
Definition: CamiTKAPI.h:94
This class describes what are the methods to implement in order to manage a Component position in spa...
Definition: InterfaceFrame.h:64
virtual const vtkSmartPointer< vtkTransform > getTransform() const =0
Get the transformation with respect to the parent frame.
virtual bool getFrameVisibility(QString) const =0
Get the Component Frame visibility for a given viewer.
virtual void rotateVTK(double aroundX, double aroundY, double aroundZ)=0
Apply a rotation relative to the current position, using the VTK rotation order (Z,...
virtual void addFrameChild(InterfaceFrame *frame)=0
Add the input frame as a child of the current 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(QString, bool)=0
Set the Component Frame visible for a given viewer.
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 setTransformRotation(double aroundX, double aroundY, double aroundZ)=0
Set the rotation part of the 3D space transformation of the current frame.
virtual void resetTransform()=0
Set the current frame transform to identity.
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 rotate(double aroundX, double aroundY, double aroundZ)=0
Apply rotations relative to the current position in the alphabetical order (X, Y, Z).
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 setTransformRotationVTK(double aroundX, double aroundY, double aroundZ)=0
Set the rotation part of the 3D space transformation 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 removeFrameChild(InterfaceFrame *frame)=0
Remove the input frame as a child of the current frame.
virtual void setFrameName(QString name)=0
Set the Frame Unique identifyer.
virtual const vtkSmartPointer< vtkTransform > getTransformFromWorld() const =0
Transforms accessors / Modifyers.
virtual ~InterfaceFrame()=default
empty virtual destructor, to avoid memory leak
virtual const QString & getFrameName() const =0
Hierarchy accessors / Modifyers.
virtual vtkSmartPointer< vtkAxesActor > getFrameAxisActor()=0
Gives the 3D representation of the frame (based on xyz arrows)
virtual InterfaceFrame * getParentFrame() const =0
Get the parent frame.
virtual void translate(double x, double y, double z)=0
Apply a translation relative to the current position.
virtual void setTransform(vtkSmartPointer< vtkTransform > transform)=0
Set the current input frame position (according to its parent Frame)
Viewer is an abstract class that is the base class for all viewers.
Definition: Viewer.h:180
Definition: Action.cpp:35
vtkSmartPointer< vtkTransform > transform
Definition: RendererWidget.cpp:390