Carna  Version 3.3.2
Geometry.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2010 - 2015 Leonid Kostrykin
3  *
4  * Chair of Medical Engineering (mediTEC)
5  * RWTH Aachen University
6  * Pauwelsstr. 20
7  * 52074 Aachen
8  * Germany
9  *
10  */
11 
12 #ifndef GEOMETRY_H_6014714286
13 #define GEOMETRY_H_6014714286
14 
15 #include <Carna/Carna.h>
16 #include <Carna/base/Spatial.h>
17 #include <memory>
18 
23 namespace Carna
24 {
25 
26 namespace base
27 {
28 
29 
30 
31 // ----------------------------------------------------------------------------------
32 // Geometry
33 // ----------------------------------------------------------------------------------
34 
59 class CARNA_LIB Geometry : public Spatial
60 {
61 
62  struct Details;
63  const std::unique_ptr< Details > pimpl;
64 
65 public:
66 
70  const unsigned int geometryType;
71 
80  explicit Geometry( unsigned int geometryType, const std::string& tag = "" );
81 
85  virtual ~Geometry();
86 
102  void putFeature( unsigned int role, GeometryFeature& feature );
103 
112  void removeFeature( GeometryFeature& feature );
113 
121  void removeFeature( unsigned int role );
122 
129  void clearFeatures();
130 
135  bool hasFeature( const GeometryFeature& feature ) const;
136 
141  bool hasFeature( unsigned int role ) const;
142 
149  GeometryFeature& feature( unsigned int role ) const;
150 
154  std::size_t featuresCount() const;
155 
160  void visitFeatures( const std::function< void( GeometryFeature& gf, unsigned int role ) >& visit ) const;
161 
166  void setBoundingVolume( BoundingVolume* boundingVolume );
167 
171  bool hasBoundingVolume() const;
172 
179  BoundingVolume& boundingVolume();
180 
183  const BoundingVolume& boundingVolume() const;
184 
185 }; // Geometry
186 
187 
188 
189 } // namespace Carna :: base
190 
191 } // namespace Carna
192 
193 #endif // GEOMETRY_H_6014714286
Defines scene graph leafs. Instances of this class represent visible geometry that can be rendered...
Definition: Geometry.h:59
Defines Carna::base::Spatial.
Represents "components" that are aggregated by Geometry objects. Closer description is given here...
const unsigned int geometryType
Holds the geometry type of this geometry node.
Definition: Geometry.h:70
Represents a spatial scene element. It&#39;s location is determined relatively to another spatial that is...
Definition: Spatial.h:44
Represents a Geometry minimal boundary volume of simple geometric shape. The volume is centered withi...