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