Fraxinus  17.12-rc4
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) 2008-2014, SINTEF Department of Medical Technology
5 All rights reserved.
6 
7 Redistribution and use in source and binary forms, with or without
8 modification, are permitted provided that the following conditions are met:
9 
10 1. Redistributions of source code must retain the above copyright notice,
11  this list of conditions and the following disclaimer.
12 
13 2. Redistributions in binary form must reproduce the above copyright notice,
14  this list of conditions and the following disclaimer in the documentation
15  and/or other materials provided with the distribution.
16 
17 3. Neither the name of the copyright holder nor the names of its contributors
18  may be used to endorse or promote products derived from this software
19  without specific prior written permission.
20 
21 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
25 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
27 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
28 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
29 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 =========================================================================*/
32 
33 
34 #ifndef CXGEOMETRICREP_H_
35 #define CXGEOMETRICREP_H_
36 
37 
38 #include "vtkForwardDeclarations.h"
39 #include "cxRepImpl.h"
40 #include "cxVector3D.h"
41 #include "cxGraphicalPrimitives.h"
42 
43 
44 namespace cx
45 {
46 typedef boost::shared_ptr<class Mesh> MeshPtr;
47 typedef boost::shared_ptr<class GeometricRep> GeometricRepPtr;
48 typedef boost::shared_ptr<class GraphicalGeometric> GraphicalGeometricPtr;
49 
59 class cxResourceVisualization_EXPORT GraphicalGeometric : public QObject
60 {
61  Q_OBJECT
62 public:
64  virtual ~GraphicalGeometric();
65 
66  void setMesh(MeshPtr mesh);
67  MeshPtr getMesh();
68  void setRenderer(vtkRendererPtr renderer);
69 
74  void setTransformOffset(Transform3D rMrr);
75 
76 protected:
79  MeshPtr mMesh;
81  void clearClipping();
82 private:
83  void meshChangedSlot();
84  void transformChangedSlot();
85  void clipPlanesChangedSlot();
86 };
87 
88 
89 
99 class cxResourceVisualization_EXPORT GeometricRep : public RepImpl
100 {
101  Q_OBJECT
102 public:
103  virtual ~GeometricRep();
104  static GeometricRepPtr New(const QString& uid="");
105 
106  virtual QString getType() const { return "GeometricRep"; }
107  void setMesh(MeshPtr mesh);
108  MeshPtr getMesh();
109  bool hasMesh(MeshPtr mesh) const;
110 
111 protected:
112  GeometricRep();
113  virtual void addRepActorsToViewRenderer(ViewPtr view);
114  virtual void removeRepActorsFromViewRenderer(ViewPtr view);
115 
116 private:
117  GraphicalGeometricPtr mGraphics;
118 };
119 
120 
121 
122 
123 
124 
125 } // namespace cx
126 
127 #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:63
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.