Computer Assited Medical Intervention Tool Kit  version 4.1
Frame.h
Go to the documentation of this file.
1 #ifndef FRAME_H
2 #define FRAME_H
3 
4 #include "CamiTKAPI.h"
5 
6 #include "InterfaceFrame.h"
7 #include <QObject>
8 
9 
10 class vtkTransformPolyDataFilter;
11 class vtkAxesActor;
12 
13 namespace camitk {
31 
32 
33 public:
41  Frame(vtkSmartPointer<vtkTransform> transform = nullptr, Frame* parentFrame = nullptr);
42 
44  ~Frame() override;
45 
50  const QString& getFrameName() const override;
52 
54  void setFrameName(QString name) override;
55 
57  InterfaceFrame* getParentFrame() const override;
58 
70  void setParentFrame(InterfaceFrame* parent, bool keepTransform = true) override;
71 
76  const QVector<InterfaceFrame*>& getChildrenFrame() const override;
83  const vtkSmartPointer<vtkTransform> getTransformFromWorld() const override;
85 
87  const vtkSmartPointer<vtkTransform> getTransform() const override;
88 
90  const vtkSmartPointer<vtkTransform> getTransformFromFrame(InterfaceFrame* frame) const override;
91 
96  void setTransform(vtkSmartPointer<vtkTransform> transform) override;
97 
102  void resetTransform() override;
103 
107  void translate(double x, double y, double z) override;
108 
114  void rotate(double aroundX, double aroundY, double aroundZ) override;
115 
120  void rotateVTK(double aroundX, double aroundY, double aroundZ) override;
121 
127  void setTransformTranslation(double x, double y, double z) override;
128 
135  void setTransformTranslationVTK(double x, double y, double z) override;
136 
142  void setTransformRotation(double aroundX, double aroundY, double aroundZ) override;
143 
150  void setTransformRotationVTK(double aroundX, double aroundY, double aroundZ) override;
151 
157  vtkSmartPointer<vtkAxesActor> getFrameAxisActor() override;
158 
162  void setFrameVisibility(Viewer* viewer, bool visible) override;
163 
167  bool getFrameVisibility(Viewer* viewer) const override;
168 
173  void removeFrameChild(InterfaceFrame* frame) override;
174 
177  void initAttributes();
179 
180 protected:
181 
185  QString frameName;
186 
192 
197  vtkSmartPointer<vtkTransform> transformParentToMe;
198 
206  vtkSmartPointer<vtkTransform> transformWorldToMe;
207 
211  vtkSmartPointer<vtkTransformPolyDataFilter> representationTransformFilter;
212 
216  QVector<InterfaceFrame*> childrenFrame;
217 
221  QVector<InterfaceFrame*> computeDescendants(InterfaceFrame*);
222 
223 private:
224 
226  void addFrameChild(InterfaceFrame* frame) override;
227 
229  static int nbTotalFrames;
230 
232  vtkSmartPointer<vtkAxesActor> axes;
233 
235  QMap<Viewer*, bool> frameViewers;
236 
237 };
238 }
239 #endif // FRAME_H
static int nbTotalFrames
To be able to give a default unique identifier to each created frame.
Definition: Frame.h:229
vtkSmartPointer< vtkTransformPolyDataFilter > representationTransformFilter
Transform Filter to store the transformation for the Frame&#39;s 3D representation.
Definition: Frame.h:211
Viewer is an abstract viewer.
Definition: Viewer.h:55
vtkSmartPointer< vtkTransform > transformWorldToMe
Transformation to represent my points (expressed in my frame) in the world&#39;s frame.
Definition: Frame.h:206
Definition: Action.cpp:36
This class describes what are the methods to implement in order to manage a Component position in spa...
Definition: InterfaceFrame.h:64
#define CAMITK_API
Definition: CamiTKAPI.h:49
vtkSmartPointer< vtkTransform > transformParentToMe
Transformation to represent my points (expressed in my frame) in my parent&#39;s frame.
Definition: Frame.h:197
vtkSmartPointer< vtkAxesActor > axes
Geometric representation of the frame (vtkAxes)
Definition: Frame.h:232
QVector< InterfaceFrame * > childrenFrame
List of children Frames to keep track of Frame hierarchy.
Definition: Frame.h:216
QMap< Viewer *, bool > frameViewers
List of Viewers in which the frame is visible.
Definition: Frame.h:235
InterfaceFrame * parentFrame
The Parent Frame.
Definition: Frame.h:191
Represents a hierarchy of frames.
Definition: Frame.h:30
QString frameName
Frame unique identifier.
Definition: Frame.h:185