Carna Version 3.3.3
Loading...
Searching...
No Matches
VolumeSegment.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 VOLUMESEGMENT_H_6014714286
13#define VOLUMESEGMENT_H_6014714286
14
23#include <Carna/Carna.h>
27#include <memory>
28
29namespace Carna
30{
31
32namespace base
33{
34
35
36
37// ----------------------------------------------------------------------------------
38// VolumeSegmentNormalsComponent< SegmentNormalsVolumeType >
39// ----------------------------------------------------------------------------------
40
47template< typename SegmentNormalsVolumeType >
49{
50
52
53 std::unique_ptr< Association< SegmentNormalsVolumeType > > myNormals;
54
55public:
56
61
66
72
76
80 bool hasNormals() const;
81
82}; // VolumeSegmentNormalsComponent
83
84
85template< typename SegmentNormalsVolumeType >
89
90
91template< typename SegmentNormalsVolumeType >
96
97
98template< typename SegmentNormalsVolumeType >
104
105
106template< typename SegmentNormalsVolumeType >
108{
109 CARNA_ASSERT( hasNormals() );
110 return **myNormals;
111}
112
113
114template< typename SegmentNormalsVolumeType >
116{
117 return myNormals.get() != nullptr && myNormals->get() != nullptr;
118}
119
120
121
122// ----------------------------------------------------------------------------------
123// VolumeSegmentNormalsComponent< void >
124// ----------------------------------------------------------------------------------
125
132template< >
134{
135
136public:
137
142
143}; // VolumeSegmentNormalsComponent
144
145
149
150
151
152// ----------------------------------------------------------------------------------
153// VolumeSegment
154// ----------------------------------------------------------------------------------
155
162template< typename SegmentIntensityVolumeType, typename SegmentNormalsVolumeType >
163class VolumeSegment : public VolumeSegmentNormalsComponent< SegmentNormalsVolumeType >
164{
165
167
168public:
169
175
180
185
191
200
205
211
215
219 bool hasIntensities() const;
220
226
227private:
228
229 std::unique_ptr< Association< SegmentIntensityVolumeType > > myIntensities;
230
231}; // VolumeSegment
232
233
234template< typename SegmentIntensityVolumeType, typename SegmentNormalsVolumeType >
240
241
242template< typename SegmentIntensityVolumeType, typename SegmentNormalsVolumeType >
247
248
249template< typename SegmentIntensityVolumeType, typename SegmentNormalsVolumeType >
255
256
257template< typename SegmentIntensityVolumeType, typename SegmentNormalsVolumeType >
263
264
265template< typename SegmentIntensityVolumeType, typename SegmentNormalsVolumeType >
267{
268 return myIntensities.get() != nullptr && myIntensities->get() != nullptr;
269}
270
271
272
273} // namespace Carna :: base
274
275} // namespace Carna
276
277#endif // VOLUMESEGMENT_H_6014714286
Defines Carna::base::Association.
Defines Carna::base::CarnaException, Carna::base::AssertionFailure.
#define CARNA_ASSERT(expression)
If the given expression is false, a break point is raised in debug mode and an AssertionFailure throw...
Defines Carna::base::VolumeGrid.
AssociatedObjectType * get() const
Returns raw pointer to the referenced object.
Definition Association.h:61
Represents a particular partitioning of volumetric data.
Definition VolumeGrid.h:64
Represents the normal map component of an VolumeSegment object.
const SegmentNormalsVolumeType & normals() const
bool hasNormals() const
Tells whether this partition has a normal map associated.
void setNormals(Association< SegmentNormalsVolumeType > *volume)
Sets the normal map of this partition.
SegmentNormalsVolumeType & normals()
References the normal map of this partition.
Represents a single volumetric data partition.
Grid & grid
References the volumetric data partitioning this partition belongs to.
void setIntensities(Association< SegmentIntensityVolumeType > *intensities)
Sets the intensity volume data of this partition.
VolumeGrid< SegmentIntensityVolumeType, SegmentNormalsVolumeType > Grid
Reflects the type to use for representation of the whole volumetric data partitioning.
SegmentIntensityVolumeType IntensityVolume
Reflects the type to use for storing the intensity volume of a single partition.
const SegmentIntensityVolumeType & intensities() const
math::Vector3ui offset
Holds the coordinate offset this partition within the whole volumetric data partitioning.
bool hasIntensities() const
Tells whether this partition has intensity volume data associated.
VolumeSegment(Grid &grid)
Instantiates.
SegmentNormalsVolumeType NormalsVolume
Reflects the type to use for storing the normal map of a single partition.
SegmentIntensityVolumeType & intensities()
References the intensity volume data of this partition.
Eigen::Matrix< unsigned int, 3, 1 > Vector3ui
Defines vector.
Definition math.h:199
#define NON_COPYABLE
Features class it is placed in as non-copyable.