mmcfilters
Public API documentation
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
mmcfilters::ValuedMorphologicalTreeView< T > Class Template Reference

Non-owning view pairing a topology with an external altitude span. More...

#include <ValuedMorphologicalTreeView.hpp>

Public Types

using AltitudeType = T
 Altitude scalar type borrowed by this view.
 

Public Member Functions

 ValuedMorphologicalTreeView (const MorphologicalTree &topology, NodeAltitudeSpan< T > altitude)
 Builds a view over caller-owned topology and altitude storage.
 
 ValuedMorphologicalTreeView (const MorphologicalTree &topology, const NodeAltitudeBuffer< T > &altitude)
 Builds a view over a caller-owned altitude buffer.
 
 ValuedMorphologicalTreeView (const MorphologicalTree &, NodeAltitudeBuffer< T > &&)=delete
 Rejects temporary altitude buffers that would leave a dangling span.
 
const MorphologicalTreetopology () const noexcept
 Returns the borrowed tree topology.
 
NodeAltitudeSpan< T > nodeAltitudes () const noexcept
 Returns the borrowed altitude span indexed by internal NodeId.
 
void requireTopologyUnchanged (const char *context) const
 Throws if the borrowed topology changed since view construction.
 
nodeAltitude (NodeId nodeId) const
 Returns the altitude associated with an internal node id.
 
AltitudeDifference< T > nodeResidue (NodeId nodeId) const
 Returns the altitude difference between a live node and its parent.
 

Detailed Description

template<AltitudeValue T>
class mmcfilters::ValuedMorphologicalTreeView< T >

Non-owning view pairing a topology with an external altitude span.

ValuedMorphologicalTreeView is the lightweight C++ representation of the Higra-like model used by generic-altitude kernels: topology storage stays elsewhere, and node altitudes are borrowed as a contiguous read-only span indexed by the dense internal NodeId domain. The caller must keep both the topology and the altitude storage alive for the lifetime of the view. The view intentionally carries no ownership or canonical-tree identity; operations that need owned valued state must receive a ValuedMorphologicalTree<T> instead.

Definition at line 24 of file ValuedMorphologicalTreeView.hpp.

Member Typedef Documentation

◆ AltitudeType

template<AltitudeValue T>
using mmcfilters::ValuedMorphologicalTreeView< T >::AltitudeType = T

Altitude scalar type borrowed by this view.

Definition at line 43 of file ValuedMorphologicalTreeView.hpp.

Constructor & Destructor Documentation

◆ ValuedMorphologicalTreeView() [1/2]

template<AltitudeValue T>
mmcfilters::ValuedMorphologicalTreeView< T >::ValuedMorphologicalTreeView ( const MorphologicalTree topology,
NodeAltitudeSpan< T >  altitude 
)
inlineexplicit

Builds a view over caller-owned topology and altitude storage.

The span must be indexed by the dense internal NodeId domain and remain alive for the full lifetime of the view.

Parameters
topologyTree topology.
altitudeAltitude data indexed by node identifier.

Definition at line 54 of file ValuedMorphologicalTreeView.hpp.

◆ ValuedMorphologicalTreeView() [2/2]

template<AltitudeValue T>
mmcfilters::ValuedMorphologicalTreeView< T >::ValuedMorphologicalTreeView ( const MorphologicalTree topology,
const NodeAltitudeBuffer< T > &  altitude 
)
inlineexplicit

Builds a view over a caller-owned altitude buffer.

This overload is equivalent to passing std::span<const T>(altitude) and exists so ValuedMorphologicalTreeView(tree, buffer) deduces the altitude type.

Parameters
topologyTree topology.
altitudeAltitude data indexed by node identifier.

Definition at line 68 of file ValuedMorphologicalTreeView.hpp.

Member Function Documentation

◆ nodeAltitude()

template<AltitudeValue T>
T mmcfilters::ValuedMorphologicalTreeView< T >::nodeAltitude ( NodeId  nodeId) const
inline

Returns the altitude associated with an internal node id.

Parameters
nodeIdDense internal node identifier.
Returns
The altitude associated with an internal node id.

Definition at line 105 of file ValuedMorphologicalTreeView.hpp.

◆ nodeAltitudes()

template<AltitudeValue T>
NodeAltitudeSpan< T > mmcfilters::ValuedMorphologicalTreeView< T >::nodeAltitudes ( ) const
inlinenoexcept

Returns the borrowed altitude span indexed by internal NodeId.

Returns
The borrowed altitude span indexed by internal NodeId.

Definition at line 90 of file ValuedMorphologicalTreeView.hpp.

◆ nodeResidue()

template<AltitudeValue T>
AltitudeDifference< T > mmcfilters::ValuedMorphologicalTreeView< T >::nodeResidue ( NodeId  nodeId) const
inline

Returns the altitude difference between a live node and its parent.

The project adopts a fixed zero reconstruction baseline. Root-like nodes, whose parent is invalid or themselves, therefore use their own altitude as residue.

Parameters
nodeIdDense internal node identifier.
Returns
The altitude difference between a live node and its parent.

Definition at line 121 of file ValuedMorphologicalTreeView.hpp.

◆ requireTopologyUnchanged()

template<AltitudeValue T>
void mmcfilters::ValuedMorphologicalTreeView< T >::requireTopologyUnchanged ( const char context) const
inline

Throws if the borrowed topology changed since view construction.

Parameters
contextOperation context or diagnostic label.

Definition at line 97 of file ValuedMorphologicalTreeView.hpp.

◆ topology()

template<AltitudeValue T>
const MorphologicalTree & mmcfilters::ValuedMorphologicalTreeView< T >::topology ( ) const
inlinenoexcept

Returns the borrowed tree topology.

Returns
The borrowed tree topology.

Definition at line 83 of file ValuedMorphologicalTreeView.hpp.


The documentation for this class was generated from the following file: