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

Edit-session facade for ValuedMorphologicalTree. More...

#include <ValuedMorphologicalTree.hpp>

Public Member Functions

 ValuedMorphologicalTreeEditor (const ValuedMorphologicalTreeEditor &)=delete
 Disables copy construction.
 
ValuedMorphologicalTreeEditoroperator= (const ValuedMorphologicalTreeEditor &)=delete
 Disables copy assignment.
 
 ValuedMorphologicalTreeEditor (ValuedMorphologicalTreeEditor &&other) noexcept
 Transfers the active valued-tree edit session and rollback journal.
 
ValuedMorphologicalTreeEditoroperator= (ValuedMorphologicalTreeEditor &&)=delete
 Disables move assignment.
 
 ~ValuedMorphologicalTreeEditor ()
 Restores the altitude journal and closes the valued-tree edit session.
 
bool canRollback () const noexcept
 Tests whether topology and altitude can be rolled back.
 
void rollback ()
 Restores topology and altitude captured by the delta journals.
 
NodeId createDetachedNode (T altitude=T{})
 Creates a detached topology node and initializes its altitude.
 
void setNodeAltitude (NodeId nodeId, T altitude)
 Sets a live node altitude during a staged topology edit.
 
void detach (NodeId nodeId)
 Detaches one non-root node through the structural editor.
 
void reparent (NodeId nodeId, NodeId newParentId)
 Reparents one node through the structural editor.
 
void attach (NodeId parentId, NodeId detachedNodeId)
 Attaches one detached node through the structural editor.
 
void moveChildren (NodeId parentId, NodeId sourceId)
 Moves all direct children from sourceId under parentId.
 
void movePixelToProperPart (NodeId targetNodeId, NodeId sourceNodeId, PixelId pixel)
 Moves one direct proper part between nodes.
 
void mergeProperParts (NodeId targetNodeId, NodeId sourceNodeId)
 Moves all direct proper parts between nodes.
 
void removeChild (NodeId parentNodeId, NodeId childId, bool releaseNodeFlag)
 Detaches a direct child and optionally releases an empty node slot.
 
void releaseNode (NodeId nodeId)
 Releases an empty detached node slot.
 
void setRoot (NodeId nodeId)
 Promotes one node to the topology root.
 
void pruneNode (NodeId nodeId)
 Applies the topology prune helper inside the valued-tree edit session.
 
void mergeNodeIntoParent (NodeId nodeId)
 Applies the topology merge helper inside the valued-tree edit session.
 
bool hasDetachedAliveNodes () const noexcept
 Returns whether the structural edit still has detached live nodes.
 
TreeEditor::IncrementalProof proveIncremental ()
 Produces a generic move-only proof for the current valued-tree edit revision.
 
void commit (TreeEditor::IncrementalProof &&proof)
 Commits the exact valued-tree edit revision represented by proof.
 
TreeValidationResult validate () const noexcept
 Validates only the staged topology.
 
TreeValidationResult validateAndCommit () noexcept
 Validates topology, validates altitude order, then closes the edit.
 
void commit ()
 Exception-based wrapper around validateAndCommit().
 

Friends

class ValuedMorphologicalTree< T >
 
ValuedMorphologicalTreeEditor< T > detail::beginEstablishedValuedEdit (ValuedMorphologicalTree< T > &tree)
 Grants detail::beginEstablishedValuedEdit access to the enclosing type.
 

Detailed Description

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

Edit-session facade for ValuedMorphologicalTree.

The valued-tree editor reuses the structural TreeEditor for topology while keeping the external altitude buffer as the canonical valued-tree state. commit() first validates the topology and then validates monotone altitude.

Definition at line 370 of file ValuedMorphologicalTree.hpp.

Constructor & Destructor Documentation

◆ ValuedMorphologicalTreeEditor()

template<AltitudeValue T>
mmcfilters::ValuedMorphologicalTreeEditor< T >::ValuedMorphologicalTreeEditor ( ValuedMorphologicalTreeEditor< T > &&  other)
inlinenoexcept

Transfers the active valued-tree edit session and rollback journal.

Parameters
otherObject to compare with or transfer from.

Definition at line 486 of file ValuedMorphologicalTree.hpp.

◆ ~ValuedMorphologicalTreeEditor()

template<AltitudeValue T>
mmcfilters::ValuedMorphologicalTreeEditor< T >::~ValuedMorphologicalTreeEditor ( )
inline

Restores the altitude journal and closes the valued-tree edit session.

Definition at line 501 of file ValuedMorphologicalTree.hpp.

Member Function Documentation

◆ attach()

template<AltitudeValue T>
void mmcfilters::ValuedMorphologicalTreeEditor< T >::attach ( NodeId  parentId,
NodeId  detachedNodeId 
)
inline

Attaches one detached node through the structural editor.

Parameters
parentIdIdentifier of the parent node.
detachedNodeIdNode identifier.

Definition at line 592 of file ValuedMorphologicalTree.hpp.

◆ canRollback()

template<AltitudeValue T>
bool mmcfilters::ValuedMorphologicalTreeEditor< T >::canRollback ( ) const
inlinenoexcept

Tests whether topology and altitude can be rolled back.

Returns
True if topology and altitude can be rolled back; otherwise false.

Definition at line 508 of file ValuedMorphologicalTree.hpp.

◆ commit() [1/2]

template<AltitudeValue T>
void mmcfilters::ValuedMorphologicalTreeEditor< T >::commit ( )
inline

Exception-based wrapper around validateAndCommit().

Definition at line 775 of file ValuedMorphologicalTree.hpp.

◆ commit() [2/2]

template<AltitudeValue T>
void mmcfilters::ValuedMorphologicalTreeEditor< T >::commit ( TreeEditor::IncrementalProof &&  proof)
inline

Commits the exact valued-tree edit revision represented by proof.

Parameters
proofValidation proof consumed by the operation.

Definition at line 731 of file ValuedMorphologicalTree.hpp.

◆ createDetachedNode()

template<AltitudeValue T>
NodeId mmcfilters::ValuedMorphologicalTreeEditor< T >::createDetachedNode ( altitude = T{})
inline

Creates a detached topology node and initializes its altitude.

The altitude buffer is reserved before mutating the topology so allocation failure cannot leave a new node without a matching altitude slot.

Parameters
altitudeAltitude data indexed by node identifier.
Returns
The created detached topology node and initializes its altitude.

Definition at line 530 of file ValuedMorphologicalTree.hpp.

◆ detach()

template<AltitudeValue T>
void mmcfilters::ValuedMorphologicalTreeEditor< T >::detach ( NodeId  nodeId)
inline

Detaches one non-root node through the structural editor.

Parameters
nodeIdDense internal node identifier.

Definition at line 570 of file ValuedMorphologicalTree.hpp.

◆ hasDetachedAliveNodes()

template<AltitudeValue T>
bool mmcfilters::ValuedMorphologicalTreeEditor< T >::hasDetachedAliveNodes ( ) const
inlinenoexcept

Returns whether the structural edit still has detached live nodes.

Returns
Whether the structural edit still has detached live nodes.

Definition at line 688 of file ValuedMorphologicalTree.hpp.

◆ mergeNodeIntoParent()

template<AltitudeValue T>
void mmcfilters::ValuedMorphologicalTreeEditor< T >::mergeNodeIntoParent ( NodeId  nodeId)
inline

Applies the topology merge helper inside the valued-tree edit session.

Parameters
nodeIdDense internal node identifier.

Definition at line 678 of file ValuedMorphologicalTree.hpp.

◆ mergeProperParts()

template<AltitudeValue T>
void mmcfilters::ValuedMorphologicalTreeEditor< T >::mergeProperParts ( NodeId  targetNodeId,
NodeId  sourceNodeId 
)
inline

Moves all direct proper parts between nodes.

Parameters
targetNodeIdNode identifier.
sourceNodeIdNode identifier.

Definition at line 626 of file ValuedMorphologicalTree.hpp.

◆ moveChildren()

template<AltitudeValue T>
void mmcfilters::ValuedMorphologicalTreeEditor< T >::moveChildren ( NodeId  parentId,
NodeId  sourceId 
)
inline

Moves all direct children from sourceId under parentId.

Parameters
parentIdIdentifier of the parent node.
sourceIdInput.

Definition at line 603 of file ValuedMorphologicalTree.hpp.

◆ movePixelToProperPart()

template<AltitudeValue T>
void mmcfilters::ValuedMorphologicalTreeEditor< T >::movePixelToProperPart ( NodeId  targetNodeId,
NodeId  sourceNodeId,
PixelId  pixel 
)
inline

Moves one direct proper part between nodes.

Parameters
targetNodeIdNode identifier.
sourceNodeIdNode identifier.
pixelProper-part identifier.

Definition at line 615 of file ValuedMorphologicalTree.hpp.

◆ proveIncremental()

template<AltitudeValue T>
TreeEditor::IncrementalProof mmcfilters::ValuedMorphologicalTreeEditor< T >::proveIncremental ( )
inline

Produces a generic move-only proof for the current valued-tree edit revision.

Topology is checked on the mutation delta whenever every primitive is supported. Altitude order is then checked only around touched nodes. A topology fallback also selects complete altitude validation.

Returns
The produced generic move-only proof for the current valued-tree edit revision.

Definition at line 700 of file ValuedMorphologicalTree.hpp.

◆ pruneNode()

template<AltitudeValue T>
void mmcfilters::ValuedMorphologicalTreeEditor< T >::pruneNode ( NodeId  nodeId)
inline

Applies the topology prune helper inside the valued-tree edit session.

Parameters
nodeIdDense internal node identifier.

Definition at line 668 of file ValuedMorphologicalTree.hpp.

◆ releaseNode()

template<AltitudeValue T>
void mmcfilters::ValuedMorphologicalTreeEditor< T >::releaseNode ( NodeId  nodeId)
inline

Releases an empty detached node slot.

Parameters
nodeIdDense internal node identifier.

Definition at line 648 of file ValuedMorphologicalTree.hpp.

◆ removeChild()

template<AltitudeValue T>
void mmcfilters::ValuedMorphologicalTreeEditor< T >::removeChild ( NodeId  parentNodeId,
NodeId  childId,
bool  releaseNodeFlag 
)
inline

Detaches a direct child and optionally releases an empty node slot.

Parameters
parentNodeIdIdentifier of the parent node.
childIdIdentifier of the child node.
releaseNodeFlagFlag controlling release node flag.

Definition at line 638 of file ValuedMorphologicalTree.hpp.

◆ reparent()

template<AltitudeValue T>
void mmcfilters::ValuedMorphologicalTreeEditor< T >::reparent ( NodeId  nodeId,
NodeId  newParentId 
)
inline

Reparents one node through the structural editor.

Parameters
nodeIdDense internal node identifier.
newParentIdParent-node value.

Definition at line 581 of file ValuedMorphologicalTree.hpp.

◆ rollback()

template<AltitudeValue T>
void mmcfilters::ValuedMorphologicalTreeEditor< T >::rollback ( )
inline

Restores topology and altitude captured by the delta journals.

Definition at line 513 of file ValuedMorphologicalTree.hpp.

◆ setNodeAltitude()

template<AltitudeValue T>
void mmcfilters::ValuedMorphologicalTreeEditor< T >::setNodeAltitude ( NodeId  nodeId,
altitude 
)
inline

Sets a live node altitude during a staged topology edit.

Monotone order is intentionally checked at valued-tree commit time because intermediate staged topologies may not yet have final parent/child relations.

Parameters
nodeIdDense internal node identifier.
altitudeAltitude data indexed by node identifier.

Definition at line 554 of file ValuedMorphologicalTree.hpp.

◆ setRoot()

template<AltitudeValue T>
void mmcfilters::ValuedMorphologicalTreeEditor< T >::setRoot ( NodeId  nodeId)
inline

Promotes one node to the topology root.

Parameters
nodeIdDense internal node identifier.

Definition at line 658 of file ValuedMorphologicalTree.hpp.

◆ validate()

template<AltitudeValue T>
TreeValidationResult mmcfilters::ValuedMorphologicalTreeEditor< T >::validate ( ) const
inlinenoexcept

Validates only the staged topology.

Altitude monotonicity is checked by validateAndCommit() / commit().

Returns
Validation result for only the staged topology.

Definition at line 747 of file ValuedMorphologicalTree.hpp.

◆ validateAndCommit()

template<AltitudeValue T>
TreeValidationResult mmcfilters::ValuedMorphologicalTreeEditor< T >::validateAndCommit ( )
inlinenoexcept

Validates topology, validates altitude order, then closes the edit.

Returns
Validation result for topology, validates altitude order, then closes the edit.

Definition at line 754 of file ValuedMorphologicalTree.hpp.

Friends And Related Symbol Documentation

◆ ValuedMorphologicalTree< T >

template<AltitudeValue T>
friend class ValuedMorphologicalTree< T >
friend

Definition at line 360 of file ValuedMorphologicalTree.hpp.


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