Computer Assited Medical Intervention Tool Kit  version 3.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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;
84  virtual const vtkSmartPointer<vtkTransform> getTransformFromWorld() const;
86 
88  virtual const vtkSmartPointer<vtkTransform> getTransform() const;
89 
91  virtual const vtkSmartPointer<vtkTransform> getTransformFromFrame(InterfaceFrame * frame) const;
92 
97  virtual void setTransform(vtkSmartPointer<vtkTransform> transform);
98 
103  virtual void resetTransform();
104 
105 
109  virtual void translate(double x, double y, double z);
110 
114  virtual void rotate(double aroundX, double aroundY, double aroundZ);
115 
121  virtual void setTransformTranslation(double x, double y, double z);
122 
128  virtual void setTransformRotation(double aroundX, double aroundY, double aroundZ);
129 
135  virtual vtkSmartPointer<vtkAxesActor> getFrameAxisActor();
136 
140  virtual void setFrameVisibility(Viewer * viewer, bool visible);
141 
145  virtual bool getFrameVisibility(Viewer * viewer) const;
146 
147 
148 
153  virtual void removeFrameChild(InterfaceFrame * frame);
154 
157  void initAttributes();
159 
160 protected:
161 
165  QString frameName;
166 
172 
177  vtkSmartPointer<vtkTransform> transformParentToMe;
178 
186  vtkSmartPointer<vtkTransform> transformWorldToMe;
187 
191  vtkSmartPointer<vtkTransformPolyDataFilter> representationTransformFilter;
192 
196  QVector<InterfaceFrame *> childrenFrame;
197 
201  QVector<InterfaceFrame *> computeDescendants(InterfaceFrame *);
202 
203 private:
204 
206  virtual void addFrameChild(InterfaceFrame * frame);
207 
209  static int nbTotalFrames;
210 
212  vtkSmartPointer<vtkAxesActor> axes;
213 
215  QMap<Viewer *, bool> frameViewers;
216 
217 };
218 }
219 #endif // FRAME_H
QVector< InterfaceFrame * > childrenFrame
List of children Frames to keep track of Frame hierarchy.
Definition: Frame.h:196
vtkSmartPointer< vtkTransformPolyDataFilter > representationTransformFilter
Transform Filter to store the transformation for the Frame's 3D representation.
Definition: Frame.h:191
static int nbTotalFrames
To be able to give a default unique identifier to each created frame.
Definition: Frame.h:209
Viewer is an abstract viewer.
Definition: Viewer.h:55
string name
Definition: select.cpp:111
vtkSmartPointer< vtkTransform > transformWorldToMe
Transformation to represent my points (expressed in my frame) in the world's frame.
Definition: Frame.h:186
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:215
vtkSmartPointer< vtkTransform > transformParentToMe
Transformation to represent my points (expressed in my frame) in my parent's frame.
Definition: Frame.h:177
vtkSmartPointer< vtkAxesActor > axes
Geometric representation of the frame (vtkAxes)
Definition: Frame.h:212
InterfaceFrame * parentFrame
The Parent Frame.
Definition: Frame.h:171
Represents a hierarchy of frames.
Definition: Frame.h:30
QString frameName
Frame unique identifier.
Definition: Frame.h:165