/src/bag/api/bag_vrrefinementsdescriptor.h
Line | Count | Source (jump to first uncovered line) |
1 | | #ifndef BAG_VRREFINEMENTSDESCRIPTOR_H |
2 | | #define BAG_VRREFINEMENTSDESCRIPTOR_H |
3 | | |
4 | | #include "bag_config.h" |
5 | | #include "bag_fordec.h" |
6 | | #include "bag_layerdescriptor.h" |
7 | | |
8 | | |
9 | | namespace BAG { |
10 | | |
11 | | //! Describe the variable resolution refinements layer. |
12 | | class BAG_API VRRefinementsDescriptor final : public LayerDescriptor |
13 | | { |
14 | | public: |
15 | | VRRefinementsDescriptor(const VRRefinementsDescriptor&) = delete; |
16 | | VRRefinementsDescriptor(VRRefinementsDescriptor&&) = delete; |
17 | | |
18 | | VRRefinementsDescriptor& operator=(const VRRefinementsDescriptor&) = delete; |
19 | | VRRefinementsDescriptor& operator=(VRRefinementsDescriptor&&) = delete; |
20 | | |
21 | 0 | bool operator==(const VRRefinementsDescriptor &rhs) const noexcept { |
22 | 0 | return m_minDepth == rhs.m_minDepth && |
23 | 0 | m_maxDepth == rhs.m_maxDepth && |
24 | 0 | m_minUncertainty == rhs.m_minUncertainty && |
25 | 0 | m_maxUncertainty == rhs.m_maxUncertainty; |
26 | 0 | } |
27 | | |
28 | 0 | bool operator!=(const VRRefinementsDescriptor &rhs) const noexcept { |
29 | 0 | return !(rhs == *this); |
30 | 0 | } |
31 | | |
32 | | std::tuple<float, float> getMinMaxDepth() const noexcept; |
33 | | std::tuple<float, float> getMinMaxUncertainty() const noexcept; |
34 | | |
35 | | VRRefinementsDescriptor& setMinMaxDepth(float minDepth, |
36 | | float maxDepth) & noexcept; |
37 | | VRRefinementsDescriptor& setMinMaxUncertainty(float minUncertainty, |
38 | | float maxUncertainty) & noexcept; |
39 | | |
40 | | protected: |
41 | | VRRefinementsDescriptor(uint32_t id, uint64_t chunkSize, |
42 | | int compressionLevel); |
43 | | explicit VRRefinementsDescriptor(const Dataset& dataset); |
44 | | |
45 | | static std::shared_ptr<VRRefinementsDescriptor> create(const Dataset& dataset, |
46 | | uint64_t chunkSize, int compressionLevel); |
47 | | |
48 | | static std::shared_ptr<VRRefinementsDescriptor> open(const Dataset& dataset); |
49 | | |
50 | | private: |
51 | | DataType getDataTypeProxy() const noexcept override; |
52 | | uint8_t getElementSizeProxy() const noexcept override; |
53 | | |
54 | | //! The minimum depth. |
55 | | float m_minDepth = std::numeric_limits<float>::max(); |
56 | | //! The maximum depth. |
57 | | float m_maxDepth = std::numeric_limits<float>::lowest(); |
58 | | //! The minimum uncertainty. |
59 | | float m_minUncertainty = std::numeric_limits<float>::max(); |
60 | | //! The maximum uncertainty. |
61 | | float m_maxUncertainty = std::numeric_limits<float>::lowest(); |
62 | | |
63 | | friend Dataset; |
64 | | friend VRRefinements; |
65 | | }; |
66 | | |
67 | | } // namespace BAG |
68 | | |
69 | | #endif // BAG_VRREFINEMENTSDESCRIPTOR_H |
70 | | |