CustusX  2023.01.05-dev+develop.0da12
An IGT application
cxGeometricRep.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 
12 
13 #ifndef CXGEOMETRICREP_H_
14 #define CXGEOMETRICREP_H_
15 
16 
17 #include "vtkForwardDeclarations.h"
18 #include "cxRepImpl.h"
19 #include "cxVector3D.h"
20 #include "cxGraphicalPrimitives.h"
21 
22 
23 namespace cx
24 {
25 typedef boost::shared_ptr<class Mesh> MeshPtr;
26 typedef boost::shared_ptr<class GeometricRep> GeometricRepPtr;
27 typedef boost::shared_ptr<class GraphicalGeometric> GraphicalGeometricPtr;
28 
38 class cxResourceVisualization_EXPORT GraphicalGeometric : public QObject
39 {
40  Q_OBJECT
41 public:
43  virtual ~GraphicalGeometric();
44 
45  void setMesh(MeshPtr mesh);
46  MeshPtr getMesh();
47  void setRenderer(vtkRendererPtr renderer);
48 
53  void setTransformOffset(Transform3D rMrr);
54 
55 protected:
58  MeshPtr mMesh;
60  void clearClipping();
61 private:
62  void meshChangedSlot();
63  void transformChangedSlot();
64  void clipPlanesChangedSlot();
65 };
66 
67 
68 
78 class cxResourceVisualization_EXPORT GeometricRep : public RepImpl
79 {
80  Q_OBJECT
81 public:
82  virtual ~GeometricRep();
83  static GeometricRepPtr New(const QString& uid="");
84 
85  virtual QString getType() const { return "GeometricRep"; }
86  void setMesh(MeshPtr mesh);
87  MeshPtr getMesh();
88  bool hasMesh(MeshPtr mesh) const;
89 
90 protected:
91  GeometricRep();
92  virtual void addRepActorsToViewRenderer(ViewPtr view);
93  virtual void removeRepActorsFromViewRenderer(ViewPtr view);
94 
95 private:
96  GraphicalGeometricPtr mGraphics;
97 };
98 
99 
100 
101 
102 
103 
104 } // namespace cx
105 
106 #endif /*CXGEOMETRICREP_H_*/
Display one Mesh in 3D.
Transform3D Transform3D
Transform3D is a representation of an affine 3D transform.
boost::shared_ptr< GraphicalGlyph3DData > GraphicalGlyph3DDataPtr
boost::shared_ptr< class View > ViewPtr
boost::shared_ptr< class GraphicalGeometric > GraphicalGeometricPtr
vtkSmartPointer< class vtkRenderer > vtkRendererPtr
GraphicalPolyData3DPtr mGraphicalPolyDataPtr
Default implementation of Rep.
Definition: cxRepImpl.h:42
Display one Mesh in 3D.
boost::shared_ptr< GraphicalPolyData3D > GraphicalPolyData3DPtr
GraphicalGlyph3DDataPtr mGraphicalGlyph3DDataPtr
boost::shared_ptr< class Mesh > MeshPtr
virtual QString getType() const
gives this reps type
boost::shared_ptr< class GeometricRep > GeometricRepPtr
Namespace for all CustusX production code.