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

Product and assembly low-level reconstruction primitives. Wire two existing entities together; for shape ingestion use BRepGraph::ShapesView::Add(). More...

#include <BRepGraph_EditorView.hxx>

Public Member Functions

BRepGraph_ProductId Add (const BRepGraph_NodeId theShapeRoot, const TopLoc_Location &thePlacement=TopLoc_Location())
 Create a Product wrapping an existing topology root via an Occurrence. The product is NOT added to document roots; call AppendDocumentRoot() explicitly when this Product is a document root.
BRepGraph_ProductId Add ()
 Create an empty Product with no direct shape root; can later own child occurrences. The product is NOT added to document roots; call AppendDocumentRoot() explicitly when this Product is a document root.
void AppendDocumentRoot (const BRepGraph_ProductId theProductId)
 Add an active Product to document roots if it is not already listed.
BRepGraph_OccurrenceId Append (const BRepGraph_ProductId theParentProduct, const BRepGraph_ProductId theReferencedProduct, const TopLoc_Location &thePlacement, const BRepGraph_OccurrenceId theParentOccurrence=BRepGraph_OccurrenceId(), BRepGraph_OccurrenceRefId *theOutOccurrenceRefId=nullptr)
 Append two existing Products via a fresh Occurrence.
NCollection_Array1< BRepGraph_OccurrenceRefId > Append (const BRepGraph_ProductId theParentProduct, const NCollection_Array1< BRepGraph_ProductId > &theChildProducts, const NCollection_Array1< TopLoc_Location > &thePlacements)
 Batch-append multiple child products to a parent product via fresh Occurrences. Two-pass: validates all inputs first, then links all.
bool RemoveOccurrence (const BRepGraph_ProductId theProductDefId, const BRepGraph_OccurrenceRefId theOccurrenceRefId)
 Detach one exact occurrence ref from a product definition. Use BRepGraph_RefsOccurrenceOfProduct::CurrentId() when removing from a product iterator. The method removes the exact OccurrenceRef entry, erases it from the product's ordered ref sequence, updates relation tables, and prunes the occurrence subtree when it has no other active usages.
bool RemoveOccurrences (const BRepGraph_ProductId theProductId, const NCollection_Array1< BRepGraph_OccurrenceRefId > &theOccurrenceRefs)
 Batch-remove multiple occurrence refs from a product definition. All-or-nothing: validates all inputs first, then removes all.
bool RemoveShapeRoot (const BRepGraph_ProductId theProductDefId)
 Detach the scalar shape-root ownership from a product definition. If no other active product owns the same topology root afterward, the root subgraph is pruned as orphaned. The product loses its direct shape root; it is no longer a part, and it only remains an assembly if it still owns active child occurrences.
BRepGraph_MutGuard< BRepGraphInc::ProductDef > Mut (const BRepGraph_ProductId theProduct)
 Return scoped mutable product definition guard.

Detailed Description

Product and assembly low-level reconstruction primitives. Wire two existing entities together; for shape ingestion use BRepGraph::ShapesView::Add().

Member Function Documentation

◆ Add() [1/2]

BRepGraph_ProductId BRepGraph::EditorView::ProductOps::Add ( )
nodiscard

Create an empty Product with no direct shape root; can later own child occurrences. The product is NOT added to document roots; call AppendDocumentRoot() explicitly when this Product is a document root.

Returns
typed product definition identifier

◆ Add() [2/2]

BRepGraph_ProductId BRepGraph::EditorView::ProductOps::Add ( const BRepGraph_NodeId theShapeRoot,
const TopLoc_Location & thePlacement = TopLoc_Location() )
nodiscard

Create a Product wrapping an existing topology root via an Occurrence. The product is NOT added to document roots; call AppendDocumentRoot() explicitly when this Product is a document root.

Parameters
[in]theShapeRootroot topology NodeId for the part
[in]thePlacementlocal placement stored on the root OccurrenceRef
Returns
typed product definition identifier, or invalid if the root is not an active topology definition node

◆ Append() [1/2]

BRepGraph_OccurrenceId BRepGraph::EditorView::ProductOps::Append ( const BRepGraph_ProductId theParentProduct,
const BRepGraph_ProductId theReferencedProduct,
const TopLoc_Location & thePlacement,
const BRepGraph_OccurrenceId theParentOccurrence = BRepGraph_OccurrenceId(),
BRepGraph_OccurrenceRefId * theOutOccurrenceRefId = nullptr )
nodiscard

Append two existing Products via a fresh Occurrence.

Parameters
[in]theParentProducttyped parent product identifier
[in]theReferencedProducttyped child product identifier being instantiated
[in]thePlacementlocal placement relative to parent
[in]theParentOccurrenceoptional placing occurrence (nested assembly chains)
[out]theOutOccurrenceRefIdoptional out: typed ref id of the inserted OccurrenceRef
Returns
typed occurrence definition identifier, or invalid if the chain is not active

◆ Append() [2/2]

NCollection_Array1< BRepGraph_OccurrenceRefId > BRepGraph::EditorView::ProductOps::Append ( const BRepGraph_ProductId theParentProduct,
const NCollection_Array1< BRepGraph_ProductId > & theChildProducts,
const NCollection_Array1< TopLoc_Location > & thePlacements )
nodiscard

Batch-append multiple child products to a parent product via fresh Occurrences. Two-pass: validates all inputs first, then links all.

Parameters
[in]theParentProducttyped parent product identifier
[in]theChildProductschild product identifiers to instantiate
[in]thePlacementslocal placements per child (must match child count)
Returns
array of created occurrence reference ids, empty on validation failure

◆ AppendDocumentRoot()

void BRepGraph::EditorView::ProductOps::AppendDocumentRoot ( const BRepGraph_ProductId theProductId)

Add an active Product to document roots if it is not already listed.

◆ Mut()

BRepGraph_MutGuard< BRepGraphInc::ProductDef > BRepGraph::EditorView::ProductOps::Mut ( const BRepGraph_ProductId theProduct)
nodiscard

Return scoped mutable product definition guard.

◆ RemoveOccurrence()

bool BRepGraph::EditorView::ProductOps::RemoveOccurrence ( const BRepGraph_ProductId theProductDefId,
const BRepGraph_OccurrenceRefId theOccurrenceRefId )
nodiscard

Detach one exact occurrence ref from a product definition. Use BRepGraph_RefsOccurrenceOfProduct::CurrentId() when removing from a product iterator. The method removes the exact OccurrenceRef entry, erases it from the product's ordered ref sequence, updates relation tables, and prunes the occurrence subtree when it has no other active usages.

Parameters
[in]theProductDefIdproduct definition identifier
[in]theOccurrenceRefIdexact product-owned occurrence reference identifier
Returns
true if the active product-owned usage was removed

◆ RemoveOccurrences()

bool BRepGraph::EditorView::ProductOps::RemoveOccurrences ( const BRepGraph_ProductId theProductId,
const NCollection_Array1< BRepGraph_OccurrenceRefId > & theOccurrenceRefs )
nodiscard

Batch-remove multiple occurrence refs from a product definition. All-or-nothing: validates all inputs first, then removes all.

Parameters
[in]theProductIdproduct definition identifier
[in]theOccurrenceRefsoccurrence reference identifiers to remove
Returns
true if all refs were successfully removed

◆ RemoveShapeRoot()

bool BRepGraph::EditorView::ProductOps::RemoveShapeRoot ( const BRepGraph_ProductId theProductDefId)
nodiscard

Detach the scalar shape-root ownership from a product definition. If no other active product owns the same topology root afterward, the root subgraph is pruned as orphaned. The product loses its direct shape root; it is no longer a part, and it only remains an assembly if it still owns active child occurrences.

Parameters
[in]theProductDefIdproduct definition identifier
Returns
true if an active shape root was detached

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