CustusX  22.04-rc5
An IGT application
cxOrientationAnnotation3DRep.h
Go to the documentation of this file.
1 /*=========================================================================
2 This file is part of CustusX, an Image Guided Therapy Application.
3 
4 Copyright (c) SINTEF Department of Medical Technology.
5 All rights reserved.
6 
7 CustusX is released under a BSD 3-Clause license.
8 
9 See Lisence.txt (https://github.com/SINTEFMedtek/CustusX/blob/master/License.txt) for details.
10 =========================================================================*/
11 #ifndef CXORIENTATIONANNOTATION3DREP_H_
12 #define CXORIENTATIONANNOTATION3DREP_H_
13 
14 #include "cxResourceVisualizationExport.h"
15 
16 #include "cxRepImpl.h"
17 #include "cxDefinitions.h"
18 #include "vtkForwardDeclarations.h"
19 #include "cxForwardDeclarations.h"
20 #include "cxVector3D.h"
21 
22 typedef vtkSmartPointer<class vtkOrientationMarkerWidget> vtkOrientationMarkerWidgetPtr;
23 typedef vtkSmartPointer<class vtkAnnotatedCubeActor> vtkAnnotatedCubeActorPtr;
24 typedef vtkSmartPointer<class vtkProp> vtkPropPtr;
25 
26 namespace cx
27 {
28 
29 typedef boost::shared_ptr<class OrientationAnnotation3DRep> OrientationAnnotation3DRepPtr;
30 
35 class cxResourceVisualization_EXPORT OrientationAnnotation3DRep: public RepImpl
36 {
37 Q_OBJECT
38 public:
39  static OrientationAnnotation3DRepPtr New(const QString& uid="");
40  virtual ~OrientationAnnotation3DRep();
41  virtual QString getType() const { return "OrientationAnnotation3DRep"; }
42 
43  bool getVisible() const;
44  void setVisible(bool on);
45  void setMarkerFilename(const QString filename);
46  void setSize(double size);
47 
48 private slots:
49 protected:
51  virtual void addRepActorsToViewRenderer(ViewPtr view);
52  virtual void removeRepActorsFromViewRenderer(ViewPtr view);
53 
54 private:
56  double mSize;
57  Vector3D mColor;
58  std::pair<QString, vtkPropPtr> mMarkerCache;
59 
60  void rebuild(vtkRenderWindowInteractorPtr interactor);
61  vtkAxesActorPtr createAxes();
62  vtkAnnotatedCubeActorPtr createCube();
63  vtkPropPtr readMarkerFromFile(const QString filename);
64 };
65 
66 }
67 
68 #endif /* CXORIENTATIONANNOTATION3DREP_H_ */
vtkSmartPointer< class vtkAxesActor > vtkAxesActorPtr
vtkSmartPointer< class vtkRenderWindowInteractor > vtkRenderWindowInteractorPtr
Class for display of an orientation annotation cube in 3D.
boost::shared_ptr< class View > ViewPtr
vtkSmartPointer< class vtkOrientationMarkerWidget > vtkOrientationMarkerWidgetPtr
vtkSmartPointer< class vtkOrientationMarkerWidget > vtkOrientationMarkerWidgetPtr
vtkSmartPointer< class vtkAnnotatedCubeActor > vtkAnnotatedCubeActorPtr
Default implementation of Rep.
Definition: cxRepImpl.h:42
Eigen::Vector3d Vector3D
Vector3D is a representation of a point or vector in 3D.
Definition: cxVector3D.h:42
boost::shared_ptr< class OrientationAnnotation3DRep > OrientationAnnotation3DRepPtr
vtkSmartPointer< class vtkProp > vtkPropPtr
vtkSmartPointer< class vtkAnnotatedCubeActor > vtkAnnotatedCubeActorPtr
Namespace for all CustusX production code.