Open CASCADE Technology Reference Manual 8.0.2
Loading...
Searching...
No Matches
BRepGraph::EditorView::GenOps Class Reference

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.

Detailed Description

Generic node, reference, and representation removal operations.

Member Function Documentation

◆ ApplyModification()

template<typename ModifierT>
void BRepGraph::EditorView::GenOps::ApplyModification ( const BRepGraph_NodeId theTarget,
ModifierT && theModifier,
const TCollection_AsciiString & theOpLabel )
inline

Apply a modification operation and record history.

Parameters
[in]theTargetnode to modify
[in]theModifiercallback that performs the modification and returns replacements
[in]theOpLabelhuman-readable operation label for history

◆ CleanupRemovedReferences()

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.

Postcondition
ValidateRelations() passes.

◆ MutChildRef()

BRepGraph_MutGuard< BRepGraphInc::ChildRef > BRepGraph::EditorView::GenOps::MutChildRef ( const BRepGraph_ChildRefId theChildRef)
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.

◆ RemoveNode()

void BRepGraph::EditorView::GenOps::RemoveNode ( const BRepGraph_NodeId theNode)

Mark a node as removed (soft deletion).

Parameters
[in]theNodenode to remove

◆ RemoveRef() [1/2]

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.

Parameters
[in]theParentexpected owning parent of the reference usage
[in]theRefreference entry to remove
[in]theToPruneOrphanedChildif true, remove the referenced child subtree when no active parent usages remain after detachment
Returns
true if the reference transitioned from active to removed

◆ RemoveRef() [2/2]

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.

Parameters
[in]theRefreference entry to remove
Returns
true if the reference transitioned from active to removed

◆ RemoveSubgraph()

void BRepGraph::EditorView::GenOps::RemoveSubgraph ( const BRepGraph_NodeId theNode)

Mark a node and all its descendants as removed (cascading soft deletion).

Parameters
[in]theNoderoot node to remove

◆ ReplaceNode()

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.

Parameters
[in]theNodenode to remove
[in]theReplacementnode that replaces theNode

◆ SetChildRefChildNodeId() [1/2]

void BRepGraph::EditorView::GenOps::SetChildRefChildNodeId ( BRepGraph_MutGuard< BRepGraphInc::ChildRef > & theMut,
const BRepGraph_NodeId theChild )

◆ SetChildRefChildNodeId() [2/2]

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>).

◆ SetChildRefLocalLocation() [1/2]

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.

Parameters
[in]theMutactive mutable child reference guard
[in]theLocnew local location

◆ SetChildRefLocalLocation() [2/2]

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.

Parameters
[in]theChildReftyped child reference identifier
[in]theLocnew local location

◆ SetChildRefOrientation() [1/2]

void BRepGraph::EditorView::GenOps::SetChildRefOrientation ( BRepGraph_MutGuard< BRepGraphInc::ChildRef > & theMut,
const BRepGraphInc::ParityOrientation theOrientation )

Set the orientation inside a batched mutation scope.

◆ SetChildRefOrientation() [2/2]

void BRepGraph::EditorView::GenOps::SetChildRefOrientation ( const BRepGraph_ChildRefId theChildRef,
const BRepGraphInc::ParityOrientation theOrientation )

Set the orientation of a child reference.


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