|
mmcfilters
Public API documentation
|
Thin edit-session facade for multi-step topology updates. More...
#include <TreeEditor.hpp>
Classes | |
| class | IncrementalProof |
| Move-only evidence that the current edit revision satisfies the generic topology invariants. More... | |
Public Member Functions | |
| TreeEditor (const TreeEditor &)=delete | |
| Disables copy construction. | |
| TreeEditor & | operator= (const TreeEditor &)=delete |
| Disables copy assignment. | |
| TreeEditor (TreeEditor &&other) noexcept | |
| Transfers the open edit-session handle without closing it. | |
| TreeEditor & | operator= (TreeEditor &&)=delete |
| Disables move assignment. | |
| ~TreeEditor () | |
| Rolls back an unfinished recoverable public edit. | |
| bool | canRollback () const noexcept |
| Tests whether this editor owns a delta rollback journal. | |
| void | rollback () |
| Aborts a recoverable edit and restores its original state. | |
| NodeId | createDetachedNode () |
| Creates a live detached node in the topological hierarchy. | |
| void | detach (NodeId nodeId) |
| Detaches one non-root node from the connected rooted component. | |
| void | reparent (NodeId nodeId, NodeId newParentId) |
| Reparents one live non-root node under another live node. | |
| void | attach (NodeId parentId, NodeId detachedNodeId) |
| Attaches one detached node back under the connected rooted tree. | |
| void | moveChildren (NodeId parentId, NodeId sourceId) |
Transfers every direct child of sourceId under parentId. | |
| void | movePixelToProperPart (NodeId targetNodeId, NodeId sourceNodeId, PixelId pixel) |
Transfers one direct proper part from sourceNodeId to targetNodeId. | |
| void | mergeProperParts (NodeId targetNodeId, NodeId sourceNodeId) |
Transfers every direct proper part from sourceNodeId to targetNodeId. | |
| void | removeChild (NodeId parentNodeId, NodeId childId, bool releaseNodeFlag) |
| Detaches a direct child from its parent and optionally releases an empty detached slot. | |
| void | releaseNode (NodeId nodeId) |
| Releases an empty detached non-root node slot. | |
| void | setRoot (NodeId nodeId) |
Promotes nodeId to become the connected root. | |
| void | pruneNode (NodeId nodeId) |
| Applies the committed-safe subtree prune inside the staged edit. | |
| void | mergeNodeIntoParent (NodeId nodeId) |
| Applies the committed-safe parent merge inside the staged edit. | |
| bool | hasDetachedAliveNodes () const noexcept |
| Returns whether the staged edit still has detached alive nodes. | |
| IncrementalProof | proveIncremental () |
| Produces move-only evidence for the current edit revision. | |
| void | commit (IncrementalProof &&proof) |
Commits the exact edit revision represented by proof. | |
| TreeValidationResult | validate () const noexcept |
| Runs strong validation without closing the session. | |
| TreeValidationResult | validateAndCommit () noexcept |
| Validates and closes the edit session on success. | |
| void | commit () |
| Finalizes the edit by validating that the tree is connected again. | |
Friends | |
| class | MorphologicalTree |
| template<AltitudeValue T> | |
| class | ValuedMorphologicalTreeEditor |
Thin edit-session facade for multi-step topology updates.
Its role is to make explicit that the caller is performing a staged edit where the tree may become temporarily disconnected, and to centralize the final strong validation in validateAndCommit() / commit(). Public editors keep an undo journal proportional to the mutation delta; the internal by-construction editor remains journal-free.
Callers cannot construct TreeEditor directly. Use MorphologicalTree::edit() so the edit boundary remains explicit at the call site.
Definition at line 28 of file TreeEditor.hpp.
|
inlinenoexcept |
Transfers the open edit-session handle without closing it.
| other | Object to compare with or transfer from. |
Definition at line 653 of file TreeEditor.hpp.
|
inline |
Rolls back an unfinished recoverable public edit.
The internal by-construction editor is deliberately journal-free and therefore still requires its algorithm to publish explicitly.
Definition at line 679 of file TreeEditor.hpp.
Attaches one detached node back under the connected rooted tree.
The node must be self-parented. Full connectivity and cycle validation remains the responsibility of commit() / validateAndCommit().
| parentId | Identifier of the parent node. |
| detachedNodeId | Node identifier. |
Definition at line 806 of file TreeEditor.hpp.
|
inlinenoexcept |
Tests whether this editor owns a delta rollback journal.
Definition at line 686 of file TreeEditor.hpp.
|
inline |
Finalizes the edit by validating that the tree is connected again.
This validation is linear in the current dense internal-node domain plus the direct pixel domain.
Definition at line 1295 of file TreeEditor.hpp.
|
inline |
Commits the exact edit revision represented by proof.
| proof | Validation proof consumed by the operation. |
Definition at line 1252 of file TreeEditor.hpp.
|
inline |
Creates a live detached node in the topological hierarchy.
The caller must attach or release the node before a checked commit can succeed.
Definition at line 709 of file TreeEditor.hpp.
Detaches one non-root node from the connected rooted component.
| nodeId | Dense internal node identifier. |
Definition at line 735 of file TreeEditor.hpp.
|
inlinenoexcept |
Returns whether the staged edit still has detached alive nodes.
Definition at line 1135 of file TreeEditor.hpp.
Applies the committed-safe parent merge inside the staged edit.
| nodeId | Dense internal node identifier. |
Definition at line 1097 of file TreeEditor.hpp.
Transfers every direct proper part from sourceNodeId to targetNodeId.
The underlying splice is linear only in the number of moved direct proper parts.
| targetNodeId | Node identifier. |
| sourceNodeId | Node identifier. |
Definition at line 913 of file TreeEditor.hpp.
Transfers every direct child of sourceId under parentId.
This keeps the operation local and does not run an ancestry check; callers that move children inside a subtree must repair or reject cycles before committing.
| parentId | Identifier of the parent node. |
| sourceId | Input. |
Definition at line 842 of file TreeEditor.hpp.
|
inline |
Transfers one direct proper part from sourceNodeId to targetNodeId.
Moving one proper part is proportional to the linked-list update only; it does not rebuild the full smallest-node map.
| targetNodeId | Node identifier. |
| sourceNodeId | Node identifier. |
| pixel | Proper-part identifier. |
Definition at line 878 of file TreeEditor.hpp.
|
inline |
Produces move-only evidence for the current edit revision.
Supported primitives are checked only on the mutation delta and changed parent paths. An edit containing a primitive without incremental support falls back to the complete validator.
Definition at line 1245 of file TreeEditor.hpp.
Applies the committed-safe subtree prune inside the staged edit.
| nodeId | Dense internal node identifier. |
Definition at line 1050 of file TreeEditor.hpp.
Releases an empty detached non-root node slot.
| nodeId | Dense internal node identifier. |
Definition at line 982 of file TreeEditor.hpp.
|
inline |
Detaches a direct child from its parent and optionally releases an empty detached slot.
| parentNodeId | Identifier of the parent node. |
| childId | Identifier of the child node. |
| releaseNodeFlag | Flag controlling release node flag. |
Definition at line 946 of file TreeEditor.hpp.
Reparents one live non-root node under another live node.
This is a staged structural edit: cycle freedom is enforced at commit time rather than by an ancestry walk on every call.
| nodeId | Dense internal node identifier. |
| newParentId | Parent-node value. |
Definition at line 766 of file TreeEditor.hpp.
|
inline |
Aborts a recoverable edit and restores its original state.
Definition at line 691 of file TreeEditor.hpp.
Promotes nodeId to become the connected root.
The previous root becomes detached; callers must reconnect or explicitly tolerate that state before a checked commit.
| nodeId | Dense internal node identifier. |
Definition at line 1019 of file TreeEditor.hpp.
|
inlinenoexcept |
Runs strong validation without closing the session.
Definition at line 1268 of file TreeEditor.hpp.
|
inlinenoexcept |
Validates and closes the edit session on success.
Definition at line 1280 of file TreeEditor.hpp.
|
friend |
Definition at line 29 of file TreeEditor.hpp.
|
friend |
Definition at line 30 of file TreeEditor.hpp.