mmcfilters
Public API documentation
Loading...
Searching...
No Matches
NativeHierarchyOwned.hpp
1#pragma once
2
4#include "ProperPartDomain.hpp"
5#include "../utils/Common.hpp"
6
7#include <optional>
8#include <utility>
9#include <vector>
10
11namespace mmcfilters {
12
26template <class T> struct NativeHierarchyOwned {
28 std::vector<NodeId> parent;
30 std::vector<NodeId> smallestNodeMap;
32 std::vector<T> nodeAltitudes;
36 std::optional<GridDomain2D> gridDomain2D;
39
50 NativeHierarchyOwned(std::vector<NodeId>&& parent, std::vector<NodeId>&& smallestNodeMap, std::vector<T>&& nodeAltitudes, NodeId root,
51 std::optional<GridDomain2D> gridDomain2D, MorphologicalTreeSemantics semantics)
52 : parent(std::move(parent)), smallestNodeMap(std::move(smallestNodeMap)), nodeAltitudes(std::move(nodeAltitudes)), root(root),
54
72 NativeHierarchyOwned& operator=(NativeHierarchyOwned&&) noexcept = default;
73};
74
86template <class T>
87[[nodiscard]] NativeHierarchyOwned<T> makeNativeHierarchyOwned(std::vector<NodeId>&& parent, std::vector<NodeId>&& smallestNodeMap,
88 std::vector<T>&& nodeAltitudes, NodeId root, std::optional<GridDomain2D> gridDomain2D,
90 return NativeHierarchyOwned<T>(std::move(parent), std::move(smallestNodeMap), std::move(nodeAltitudes), root, gridDomain2D, std::move(semantics));
91}
92
93} // namespace mmcfilters
Shared scalar conventions used by the C++ API.
int NodeId
Node identifier type used throughout the project.
Definition Common.hpp:17
Immutable scientific metadata attached to a morphological tree.
Shape metadata optionally attached to the pixel domain.
Immutable scientific interpretation attached to one morphological tree.
NativeHierarchyOwned & operator=(const NativeHierarchyOwned &)=delete
Disables copy assignment.
NativeHierarchyOwned(std::vector< NodeId > &&parent, std::vector< NodeId > &&smallestNodeMap, std::vector< T > &&nodeAltitudes, NodeId root, std::optional< GridDomain2D > gridDomain2D, MorphologicalTreeSemantics semantics)
Takes ownership of native hierarchy buffers without structural validation.
std::vector< NodeId > smallestNodeMap
Smallest node identifier indexed by pixel.
MorphologicalTreeSemantics semantics
Semantic metadata, including owned construction adjacencies.
std::vector< NodeId > parent
Parent identifier indexed by internal node.
std::optional< GridDomain2D > gridDomain2D
Optional two-dimensional pixel domain.
NativeHierarchyOwned(const NativeHierarchyOwned &)=delete
Disables copy construction.
NativeHierarchyOwned(NativeHierarchyOwned &&) noexcept=default
Transfers ownership of the native hierarchy.
NodeId root
Identifier of the self-parented root.
std::vector< T > nodeAltitudes
Altitude indexed by internal node.