Computer Assited Medical Intervention Tool Kit  version 4.0
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 = NULL, Frame *parentFrame = NULL);
42 
44  virtual ~Frame();
45 
50  virtual const QString & getFrameName() const;
52 
54  virtual void setFrameName(QString name);
55 
57  virtual InterfaceFrame * getParentFrame() const;
58 
70  virtual void setParentFrame(InterfaceFrame * parent, bool keepTransform = true);
71 
76  virtual const QVector<InterfaceFrame *> & getChildrenFrame() const;
83  virtual const vtkSmartPointer<vtkTransform> getTransformFromWorld() const;
85 
87  virtual const vtkSmartPointer<vtkTransform> getTransform() const;
88 
90  virtual const vtkSmartPointer<vtkTransform> getTransformFromFrame(InterfaceFrame * frame) const;
91 
96  virtual void setTransform(vtkSmartPointer<vtkTransform> transform);
97 
102  virtual void resetTransform();
103 
107  virtual void translate(double x, double y, double z);
108 
114  virtual void rotate(double aroundX, double aroundY, double aroundZ);
115 
120  virtual void rotateVTK(double aroundX, double aroundY, double aroundZ);
121 
127  virtual void setTransformTranslation(double x, double y, double z);
128 
135  virtual void setTransformTranslationVTK(double x, double y, double z);
136 
142  virtual void setTransformRotation(double aroundX, double aroundY, double aroundZ);
143 
150  virtual void setTransformRotationVTK(double aroundX, double aroundY, double aroundZ);
151 
157  virtual vtkSmartPointer<vtkAxesActor> getFrameAxisActor();
158 
162  virtual void setFrameVisibility(Viewer * viewer, bool visible);
163 
167  virtual bool getFrameVisibility(Viewer * viewer) const;
168 
173  virtual void removeFrameChild(InterfaceFrame * frame);
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  virtual void addFrameChild(InterfaceFrame * frame);
227 
229  static int nbTotalFrames;
230 
232  vtkSmartPointer<vtkAxesActor> axes;
233 
235  QMap<Viewer *, bool> frameViewers;
236 
237 };
238 }
239 #endif // FRAME_H
QVector< InterfaceFrame * > childrenFrame
List of children Frames to keep track of Frame hierarchy.
Definition: Frame.h:216
vtkSmartPointer< vtkTransformPolyDataFilter > representationTransformFilter
Transform Filter to store the transformation for the Frame&#39;s 3D representation.
Definition: Frame.h:211
static int nbTotalFrames
To be able to give a default unique identifier to each created frame.
Definition: Frame.h:229
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:40
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
QMap< Viewer *, bool > frameViewers
List of Viewers in which the frame is visible.
Definition: Frame.h:235
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
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