![]() |
Open CASCADE Technology Reference Manual 8.0.2
|
Generic node, reference, and representation removal operations. More...
#include <BRepGraph_EditorView.hxx>
Public Member Functions | |
| void | RemoveNode (const BRepGraph_NodeId theNode) |
| Mark a node as removed (soft deletion). | |
| void | ReplaceNode (const BRepGraph_NodeId theNode, const BRepGraph_NodeId theReplacement) |
| Replace a node by another active node and mark the old node as removed. For Edge nodes: all CoEdges referencing the removed edge are reparented to the replacement edge (ChildEdgeId updated, relation entries rebound). This prevents orphaned CoEdges that would disappear from CoEdgesOfEdge() queries. If the replacement is active, layers receive OnNodeReplaced(theNode,
theReplacement) for structural data migration. If the replacement is invalid or inactive, the operation falls back to OnNodeRemoved(theNode), matching pure deletion. Semantic history records are not inferred here; algorithms should record operation-specific history. | |
| void | RemoveSubgraph (const BRepGraph_NodeId theNode) |
| Mark a node and all its descendants as removed (cascading soft deletion). | |
| bool | RemoveRef (const BRepGraph_RefId theRef) |
| Mark a reference entry as removed (soft deletion). This is the builder-level API for detaching a child usage from its parent without removing the referenced definition itself. Invalid or already-removed ids are ignored. | |
| bool | RemoveRef (const BRepGraph_NodeId theParent, const BRepGraph_RefId theRef, const bool theToPruneOrphanedChild) |
| Mark an exact parent-owned reference entry as removed (soft deletion). This overload validates that the reference really belongs to the supplied parent and can optionally prune the child subtree when the removed usage was the last active parent usage of that child definition. Use this overload for UI/path-driven detach operations where the parent context is part of the user's selection. | |
| BRepGraph_MutGuard< BRepGraphInc::ChildRef > | MutChildRef (const BRepGraph_ChildRefId theChildRef) |
| Return scoped mutable child reference guard. ChildRef is generic (the child node can be of any kind), so its Mut accessor lives on the cross-kind Gen() rather than on a per-kind Ops. | |
| void | SetChildRefLocalLocation (const BRepGraph_ChildRefId theChildRef, const TopLoc_Location &theLoc) |
| Set the local location of a child reference and fire immediate notification. | |
| void | SetChildRefOrientation (const BRepGraph_ChildRefId theChildRef, const BRepGraphInc::ParityOrientation theOrientation) |
| Set the orientation of a child reference. | |
| void | SetChildRefOrientation (BRepGraph_MutGuard< BRepGraphInc::ChildRef > &theMut, const BRepGraphInc::ParityOrientation theOrientation) |
| Set the orientation inside a batched mutation scope. | |
| void | SetChildRefChildNodeId (const BRepGraph_ChildRefId theChildRef, const BRepGraph_NodeId theChild) |
| Rewire a child reference to a different child def (rebinds CompoundsOf<Kind>). | |
| void | SetChildRefChildNodeId (BRepGraph_MutGuard< BRepGraphInc::ChildRef > &theMut, const BRepGraph_NodeId theChild) |
| void | SetChildRefLocalLocation (BRepGraph_MutGuard< BRepGraphInc::ChildRef > &theMut, const TopLoc_Location &theLoc) |
| Set the local location of a child reference inside a batched mutation scope. | |
| template<typename ModifierT> | |
| void | ApplyModification (const BRepGraph_NodeId theTarget, ModifierT &&theModifier, const TCollection_AsciiString &theOpLabel) |
| Apply a modification operation and record history. | |
| void | CleanupRemovedReferences () |
| Clean up forward references to removed nodes in relation tables and references. After one or more RemoveNode calls, other entities may still hold stale child references pointing to removed nodes. This method marks those stale references as removed, detaches them from parent arrays, and updates relation entries for consistency. | |
Generic node, reference, and representation removal operations.
|
inline |
Apply a modification operation and record history.
| [in] | theTarget | node to modify |
| [in] | theModifier | callback that performs the modification and returns replacements |
| [in] | theOpLabel | human-readable operation label for history |
| void BRepGraph::EditorView::GenOps::CleanupRemovedReferences | ( | ) |
Clean up forward references to removed nodes in relation tables and references. After one or more RemoveNode calls, other entities may still hold stale child references pointing to removed nodes. This method marks those stale references as removed, detaches them from parent arrays, and updates relation entries for consistency.
|
nodiscard |
Return scoped mutable child reference guard. ChildRef is generic (the child node can be of any kind), so its Mut accessor lives on the cross-kind Gen() rather than on a per-kind Ops.
| void BRepGraph::EditorView::GenOps::RemoveNode | ( | const BRepGraph_NodeId | theNode | ) |
Mark a node as removed (soft deletion).
| [in] | theNode | node to remove |
| bool BRepGraph::EditorView::GenOps::RemoveRef | ( | const BRepGraph_NodeId | theParent, |
| const BRepGraph_RefId | theRef, | ||
| const bool | theToPruneOrphanedChild ) |
Mark an exact parent-owned reference entry as removed (soft deletion). This overload validates that the reference really belongs to the supplied parent and can optionally prune the child subtree when the removed usage was the last active parent usage of that child definition. Use this overload for UI/path-driven detach operations where the parent context is part of the user's selection.
| [in] | theParent | expected owning parent of the reference usage |
| [in] | theRef | reference entry to remove |
| [in] | theToPruneOrphanedChild | if true, remove the referenced child subtree when no active parent usages remain after detachment |
| bool BRepGraph::EditorView::GenOps::RemoveRef | ( | const BRepGraph_RefId | theRef | ) |
Mark a reference entry as removed (soft deletion). This is the builder-level API for detaching a child usage from its parent without removing the referenced definition itself. Invalid or already-removed ids are ignored.
| [in] | theRef | reference entry to remove |
| void BRepGraph::EditorView::GenOps::RemoveSubgraph | ( | const BRepGraph_NodeId | theNode | ) |
Mark a node and all its descendants as removed (cascading soft deletion).
| [in] | theNode | root node to remove |
| void BRepGraph::EditorView::GenOps::ReplaceNode | ( | const BRepGraph_NodeId | theNode, |
| const BRepGraph_NodeId | theReplacement ) |
Replace a node by another active node and mark the old node as removed. For Edge nodes: all CoEdges referencing the removed edge are reparented to the replacement edge (ChildEdgeId updated, relation entries rebound). This prevents orphaned CoEdges that would disappear from CoEdgesOfEdge() queries. If the replacement is active, layers receive OnNodeReplaced(theNode, theReplacement) for structural data migration. If the replacement is invalid or inactive, the operation falls back to OnNodeRemoved(theNode), matching pure deletion. Semantic history records are not inferred here; algorithms should record operation-specific history.
| [in] | theNode | node to remove |
| [in] | theReplacement | node that replaces theNode |
| void BRepGraph::EditorView::GenOps::SetChildRefChildNodeId | ( | BRepGraph_MutGuard< BRepGraphInc::ChildRef > & | theMut, |
| const BRepGraph_NodeId | theChild ) |
| void BRepGraph::EditorView::GenOps::SetChildRefChildNodeId | ( | const BRepGraph_ChildRefId | theChildRef, |
| const BRepGraph_NodeId | theChild ) |
Rewire a child reference to a different child def (rebinds CompoundsOf<Kind>).
| void BRepGraph::EditorView::GenOps::SetChildRefLocalLocation | ( | BRepGraph_MutGuard< BRepGraphInc::ChildRef > & | theMut, |
| const TopLoc_Location & | theLoc ) |
Set the local location of a child reference inside a batched mutation scope.
| [in] | theMut | active mutable child reference guard |
| [in] | theLoc | new local location |
| void BRepGraph::EditorView::GenOps::SetChildRefLocalLocation | ( | const BRepGraph_ChildRefId | theChildRef, |
| const TopLoc_Location & | theLoc ) |
Set the local location of a child reference and fire immediate notification.
| [in] | theChildRef | typed child reference identifier |
| [in] | theLoc | new local location |
| void BRepGraph::EditorView::GenOps::SetChildRefOrientation | ( | BRepGraph_MutGuard< BRepGraphInc::ChildRef > & | theMut, |
| const BRepGraphInc::ParityOrientation | theOrientation ) |
Set the orientation inside a batched mutation scope.
| void BRepGraph::EditorView::GenOps::SetChildRefOrientation | ( | const BRepGraph_ChildRefId | theChildRef, |
| const BRepGraphInc::ParityOrientation | theOrientation ) |
Set the orientation of a child reference.