LibCarna Version 3.4.0
Loading...
Searching...
No Matches
Geometry.hpp
Go to the documentation of this file.
1/*
2 * Copyright (C) 2010 - 2016 Leonid Kostrykin
3 *
4 * Chair of Medical Engineering (mediTEC)
5 * RWTH Aachen University
6 * Pauwelsstr. 20
7 * 52074 Aachen
8 * Germany
9 *
10 *
11 * Copyright (C) 2021 - 2025 Leonid Kostrykin
12 *
13 */
14
15#ifndef GEOMETRY_H_6014714286
16#define GEOMETRY_H_6014714286
17
18#include <LibCarna/LibCarna.hpp>
20#include <memory>
21
27namespace LibCarna
28{
29
30namespace base
31{
32
33
34
35// ----------------------------------------------------------------------------------
36// Geometry
37// ----------------------------------------------------------------------------------
38
62class LIBCARNA Geometry : public Spatial
63{
64
65 struct Details;
66 const std::unique_ptr< Details > pimpl;
67
68public:
69
73 const unsigned int geometryType;
74
83 explicit Geometry( unsigned int geometryType, const std::string& tag = "" );
84
88 virtual ~Geometry();
89
105 void putFeature( unsigned int role, GeometryFeature& feature );
106
116
124 void removeFeature( unsigned int role );
125
133
138 bool hasFeature( const GeometryFeature& feature ) const;
139
144 bool hasFeature( unsigned int role ) const;
145
152 GeometryFeature& feature( unsigned int role ) const;
153
157 std::size_t featuresCount() const;
158
163 void visitFeatures( const std::function< void( GeometryFeature& gf, unsigned int role ) >& visit ) const;
164
169 void setBoundingVolume( BoundingVolume* boundingVolume );
170
174 bool hasBoundingVolume() const;
175
183
187
188}; // Geometry
189
190
191
192} // namespace LibCarna :: base
193
194} // namespace LibCarna
195
196#endif // GEOMETRY_H_6014714286
Contains forward-declarations.
Defines LibCarna::base::Spatial.
Represents an association.
Represents a Geometry minimal boundary volume of simple geometric shape. The volume is centered withi...
Represents "components" that are aggregated by Geometry objects. Closer description is given here.
Defines scene graph leafs. Instances of this class represent visible geometry that can be rendered....
Definition Geometry.hpp:63
Geometry(unsigned int geometryType, const std::string &tag="")
Instantiates.
const unsigned int geometryType
Holds the geometry type of this geometry node.
Definition Geometry.hpp:73
BoundingVolume & boundingVolume()
References the previously set minimum boundary volume.
const BoundingVolume & boundingVolume() const
bool hasBoundingVolume() const
Tells whether a minimum boundary volume is set on this node.
void removeFeature(GeometryFeature &feature)
Removes feature from this geometry node in . The concept of geometry features and roles is explained ...
std::size_t featuresCount() const
Tells number of geometry features attached.
GeometryFeature & feature(unsigned int role) const
References the feature with role attached to this node in .
void visitFeatures(const std::function< void(GeometryFeature &gf, unsigned int role) > &visit) const
Invokes visit once on each attached geometry feature.
bool hasFeature(unsigned int role) const
Tells whether this node has a feature with role attached in .
void removeFeature(unsigned int role)
Removes the geometry feature from this node that is associated with role in .
virtual ~Geometry()
Deletes.
void setBoundingVolume(BoundingVolume *boundingVolume)
Sets boundingVolume as the minimum boundary volume of this node. Supply nullptr for boundingVolume to...
void clearFeatures()
Removes all geometry feature from this node.
void putFeature(unsigned int role, GeometryFeature &feature)
Adds the feature to this geometry node using role in . The concept of geometry features and roles is ...
bool hasFeature(const GeometryFeature &feature) const
Tells whether feature is attached to this node in .
Represents a spatial scene element. It's location is determined relatively to another spatial that is...
Definition Spatial.hpp:48