-
Notifications
You must be signed in to change notification settings - Fork 12
/
bag_vrrefinementsdescriptor.cpp
150 lines (130 loc) · 3.58 KB
/
bag_vrrefinementsdescriptor.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
#include "bag_exceptions.h"
#include "bag_private.h"
#include "bag_vrrefinementsdescriptor.h"
namespace BAG {
//! Constructor.
/*!
\param id
The unique layer id.
\param chunkSize
The chunk size the HDF5 DataSet will use.
\param compressionLevel
The compression level the HDF5 DataSet will use.
*/
VRRefinementsDescriptor::VRRefinementsDescriptor(
uint32_t id,
uint64_t chunkSize,
int compressionLevel)
: LayerDescriptor(id, VR_REFINEMENT_PATH,
kLayerTypeMapString.at(VarRes_Refinement), VarRes_Refinement, chunkSize,
compressionLevel)
{
}
//! Constructor.
/*!
\param dataset
The BAG Dataset this layer belongs to.
*/
VRRefinementsDescriptor::VRRefinementsDescriptor(
const Dataset& dataset)
: LayerDescriptor(dataset, VarRes_Refinement, VR_REFINEMENT_PATH)
{
}
//! Create a new variable resolution refinements descriptor.
/*!
\param dataset
The BAG Dataset this layer belongs to.
\param chunkSize
The chunk size the HDF5 DataSet will use.
\param compressionLevel
The compression level the HDF5 DataSet will use.
\return
The new variable resolution refinements descriptor.
*/
std::shared_ptr<VRRefinementsDescriptor> VRRefinementsDescriptor::create(
const Dataset& dataset,
uint64_t chunkSize,
int compressionLevel)
{
return std::shared_ptr<VRRefinementsDescriptor>(
new VRRefinementsDescriptor{dataset.getNextId(), chunkSize,
compressionLevel});
}
//! Open an existing variable resolution refinements descriptor.
/*!
\param dataset
The BAG Dataset this layer belongs to.
\return
The existing variable resolution refinements descriptor.
*/
std::shared_ptr<VRRefinementsDescriptor> VRRefinementsDescriptor::open(
const Dataset& dataset)
{
return std::shared_ptr<VRRefinementsDescriptor>(
new VRRefinementsDescriptor{dataset});
}
//! \copydoc LayerDescriptor::getDataType
DataType VRRefinementsDescriptor::getDataTypeProxy() const noexcept
{
return DT_COMPOUND;
}
//! \copydoc LayerDescriptor::getElementSize
uint8_t VRRefinementsDescriptor::getElementSizeProxy() const noexcept
{
return sizeof(BagVRRefinementsItem);
}
//! Retrieve the minimum and maximum depth.
/*!
\return
The minimum and maximum depth.
*/
std::tuple<float, float>
VRRefinementsDescriptor::getMinMaxDepth() const noexcept
{
return {m_minDepth, m_maxDepth};
}
//! Retrieve the minimum and maximum uncertainty.
/*!
\return
The minimum and maximum uncertainty.
*/
std::tuple<float, float>
VRRefinementsDescriptor::getMinMaxUncertainty() const noexcept
{
return {m_minUncertainty, m_maxUncertainty};
}
//! Set the minimum and maximum depth.
/*!
\param minDepth
The new minimum depth.
\param maxDepth
The new maximum depth.
\return
The variable resolution refinements layer descriptor.
*/
VRRefinementsDescriptor& VRRefinementsDescriptor::setMinMaxDepth(
float minDepth,
float maxDepth) & noexcept
{
m_minDepth = minDepth;
m_maxDepth = maxDepth;
return *this;
}
//! Set the minimum and maximum uncertainty.
/*!
\param minUncertainty
The new minimum uncertainty.
\param maxUncertainty
The new maximum uncertainty.
\return
The variable resolution refinements layer descriptor.
*/
VRRefinementsDescriptor& VRRefinementsDescriptor::setMinMaxUncertainty(
float minUncertainty,
float maxUncertainty) & noexcept
{
m_minUncertainty = minUncertainty;
m_maxUncertainty = maxUncertainty;
return *this;
}
} // namespace BAG