Open CASCADE Technology Reference Manual 8.0.0
Loading...
Searching...
No Matches
Public Member Functions
BRepGraph::ShapesView Class Reference

Read-only view for TopoDS_Shape reconstruction from graph data. More...

#include <BRepGraph_ShapesView.hxx>

Public Member Functions

TopoDS_Shape Shape (const BRepGraph_NodeId theNode) const
 Return or reconstruct a TopoDS_Shape for a node. Prefer this route for repeated public queries. Returns a cached shape when available and valid; otherwise reconstructs. Topology definition nodes (Vertex..CompSolid) reconstruct their topology directly, without assembly wrappers. Product nodes are reconstructed in product-local coordinates. Occurrence nodes are reconstructed with cumulative occurrence placement.
 
bool HasOriginal (const BRepGraph_NodeId theNode) const
 Check if the node has an original shape from graph construction. Editor-created and mutation-derived nodes have no original.
 
const TopoDS_ShapeFindOriginal (const BRepGraph_NodeId theNode) const
 Return a pointer to the original TopoDS_Shape stored during graph construction. This is the non-throw lookup counterpart of OriginalOf().
 
const TopoDS_ShapeOriginalOf (const BRepGraph_NodeId theNode) const
 Return the original TopoDS_Shape stored during graph construction.
 
TopoDS_Shape Reconstruct (const BRepGraph_NodeId theRoot) const
 Reconstruct a TopoDS_Shape from a graph node without using the persistent cache. Use this when the caller explicitly needs a fresh rebuild instead of the shared cached shape returned by Shape(). This method does not populate the persistent reconstructed-shape cache. Topology definition nodes reconstruct topology directly. Product nodes are reconstructed in product-local coordinates. Occurrence nodes are reconstructed with cumulative occurrence placement.
 
BRepGraph_NodeId FindNode (const TopoDS_Shape &theShape) const
 Look up the definition NodeId for a shape from graph construction input. Uses TShape pointer comparison (same semantics as IsSame()). Synthetic Product / Occurrence reconstructions are not given dedicated TShape bindings, so lookup is only guaranteed for construction-time topology. Programmatically created Builder().Add*() nodes can still be located by UID or by direct iteration over Topo() definitions.
 
bool HasNode (const TopoDS_Shape &theShape) const
 Check if a shape is known to the graph (was part of construction input). Uses TShape pointer comparison (same semantics as IsSame()). Synthetic Product / Occurrence reconstructions are not given dedicated TShape bindings, so this is only guaranteed for construction-time topology. Programmatically created Builder().Add*() nodes can still be located by UID or by direct iteration over Topo() definitions.
 

Detailed Description

Read-only view for TopoDS_Shape reconstruction from graph data.

Reconstructs TopoDS shapes from graph nodes on demand, with caching for repeated access. Topology nodes are delegated to the incidence-table reconstruction backend, while Product / Occurrence nodes are assembled at the facade level using product-local roots and occurrence placement chains. Provides lookup from original construction-time shapes back to their graph NodeIds via TShape pointer comparison. Shape() is the stable cached public route for repeated access; Reconstruct() forces a fresh rebuild with the same node-kind semantics and bypasses the persistent reconstructed-shape cache. BRepGraph_Builder::Add() and Compact() clear the persistent reconstructed-shape cache. Obtained via BRepGraph::Shapes().

Member Function Documentation

◆ FindNode()

BRepGraph_NodeId BRepGraph::ShapesView::FindNode ( const TopoDS_Shape & theShape) const

Look up the definition NodeId for a shape from graph construction input. Uses TShape pointer comparison (same semantics as IsSame()). Synthetic Product / Occurrence reconstructions are not given dedicated TShape bindings, so lookup is only guaranteed for construction-time topology. Programmatically created Builder().Add*() nodes can still be located by UID or by direct iteration over Topo() definitions.

Parameters
[in]theShapeshape to look up
Returns
active node identifier, or invalid NodeId if the shape is absent or removed

◆ FindOriginal()

const TopoDS_Shape * BRepGraph::ShapesView::FindOriginal ( const BRepGraph_NodeId theNode) const

Return a pointer to the original TopoDS_Shape stored during graph construction. This is the non-throw lookup counterpart of OriginalOf().

Parameters
[in]theNodenode identifier
Returns
pointer to original shape for an active node, or nullptr when absent/invalid/removed

◆ HasNode()

bool BRepGraph::ShapesView::HasNode ( const TopoDS_Shape & theShape) const

Check if a shape is known to the graph (was part of construction input). Uses TShape pointer comparison (same semantics as IsSame()). Synthetic Product / Occurrence reconstructions are not given dedicated TShape bindings, so this is only guaranteed for construction-time topology. Programmatically created Builder().Add*() nodes can still be located by UID or by direct iteration over Topo() definitions.

Parameters
[in]theShapeshape to check
Returns
true if the shape has a corresponding active definition node

◆ HasOriginal()

bool BRepGraph::ShapesView::HasOriginal ( const BRepGraph_NodeId theNode) const

Check if the node has an original shape from graph construction. Editor-created and mutation-derived nodes have no original.

Parameters
[in]theNodenode identifier
Returns
true if an original shape exists

◆ OriginalOf()

const TopoDS_Shape & BRepGraph::ShapesView::OriginalOf ( const BRepGraph_NodeId theNode) const

Return the original TopoDS_Shape stored during graph construction.

Parameters
[in]theNodenode identifier
Returns
reference to the exact TopoDS_Shape stored during graph construction
Exceptions
Standard_ProgramErrorif no original shape exists

◆ Reconstruct()

TopoDS_Shape BRepGraph::ShapesView::Reconstruct ( const BRepGraph_NodeId theRoot) const

Reconstruct a TopoDS_Shape from a graph node without using the persistent cache. Use this when the caller explicitly needs a fresh rebuild instead of the shared cached shape returned by Shape(). This method does not populate the persistent reconstructed-shape cache. Topology definition nodes reconstruct topology directly. Product nodes are reconstructed in product-local coordinates. Occurrence nodes are reconstructed with cumulative occurrence placement.

Parameters
[in]theRootdefinition node identifier
Returns
reconstructed shape, or null shape for invalid/removed nodes

◆ Shape()

TopoDS_Shape BRepGraph::ShapesView::Shape ( const BRepGraph_NodeId theNode) const

Return or reconstruct a TopoDS_Shape for a node. Prefer this route for repeated public queries. Returns a cached shape when available and valid; otherwise reconstructs. Topology definition nodes (Vertex..CompSolid) reconstruct their topology directly, without assembly wrappers. Product nodes are reconstructed in product-local coordinates. Occurrence nodes are reconstructed with cumulative occurrence placement.

Parameters
[in]theNodenode identifier
Returns
corresponding TopoDS_Shape, or null shape for invalid/removed nodes

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