OCCT3D OCCT 8.0.1
OCCT documentation

Search guides and API reference

Enter at least two characters.

    Open CASCADE Technology Reference Manual 8.0.1
    BRepGraph::ShapesView Class Reference

    View for TopoDS_Shape ingestion, reconstruction and lookup. More...

    #include <BRepGraph_ShapesView.hxx>

    Data Structures

    struct  Options
     Shape-ingestion options. More...
    struct  Result
     Outcome of a single Add() call. More...

    Public Types

    enum class  AddStatus { Success , SuccessWithWarnings , Failed }
     Status of a single Add() call. More...

    Public Member Functions

    Result Add (const TopoDS_Shape &theShape)
     Ingest a TopoDS_Shape as a new root subgraph, wrapping the topology root in a Product.
    Result Add (const TopoDS_Shape &theShape, const Options &theOptions)
     Ingest a TopoDS_Shape as a new root subgraph with explicit options.
    Result Add (const TopoDS_Shape &theShape, const BRepGraph_NodeId theParent)
     Ingest a TopoDS_Shape under an existing parent.
    Result Add (const TopoDS_Shape &theShape, const BRepGraph_NodeId theParent, const Options &theOptions)
     Ingest a shape under an existing parent with explicit options. Options::CreateAutoProduct is ignored.
    void CollectHistoryInputs (const NCollection_Array1< BRepGraph_NodeId > &theRoots, NCollection_DataMap< TopoDS_Shape, BRepGraph_NodeId, TopTools_ShapeMapHasher > &theOutInputs) const
     Collect a TopoDS_Shape -> NodeId map for graph roots and all subshapes resolvable through FindNode(). This is intended for algorithms that reconstruct selected graph roots to TopoDS, run OCCT, and then need to translate BRepTools_History back to graph NodeIds.
    Result AddWithHistory (const TopoDS_Shape &theResultShape, const NCollection_DataMap< TopoDS_Shape, BRepGraph_NodeId, TopTools_ShapeMapHasher > &theInputs, const occ::handle< BRepTools_History > &theHistory, const TCollection_AsciiString &theOpLabel)
     Add an OCCT algorithm result and absorb BRepTools_History into the registered BRepGraph_LayerHistory layer using explicit input shape mapping.
    Result AddWithHistory (const TopoDS_Shape &theResultShape, const NCollection_DataMap< TopoDS_Shape, BRepGraph_NodeId, TopTools_ShapeMapHasher > &theInputs, const occ::handle< BRepTools_History > &theHistory, const TCollection_AsciiString &theOpLabel, const Options &theOptions)
     Add an OCCT algorithm result and absorb BRepTools_History with explicit options.
    Result AddWithHistory (const TopoDS_Shape &theResultShape, const NCollection_Array1< BRepGraph_NodeId > &theInputRoots, const occ::handle< BRepTools_History > &theHistory, const TCollection_AsciiString &theOpLabel)
     Convenience overload that collects the history input map from selected roots.
    Result AddWithHistory (const TopoDS_Shape &theResultShape, const NCollection_Array1< BRepGraph_NodeId > &theInputRoots, const occ::handle< BRepTools_History > &theHistory, const TCollection_AsciiString &theOpLabel, const Options &theOptions)
     Convenience overload that collects the history input map from selected roots and uses explicit options.
    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.
    TopoDS_Shape Original (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.
    void ClearCached (const BRepGraph_NodeId theNode)
     Remove the cached reconstructed shape for one node. Does not change graph generation counters and does not rebuild the shape. Invalid or removed nodes are ignored.
    void ClearCached (const BRepGraph_RefId theRef)
     Remove the cached reconstructed shape for the node referenced by one reference. Does not change graph generation counters and does not rebuild the shape. Invalid or removed references are ignored.
    BRepGraph_NodeId FindNode (const TopoDS_Shape &theShape) const
     Look up the definition NodeId for a shape from graph construction input. Uses OCCT IsSame() semantics (TShape + Location, orientation ignored). Synthetic Product / Occurrence reconstructions are not given dedicated TShape bindings, so lookup is only guaranteed for construction-time topology. Programmatically created Editor().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 OCCT IsSame() semantics (TShape + Location, orientation ignored). Synthetic Product / Occurrence reconstructions are not given dedicated TShape bindings, so this is only guaranteed for construction-time topology. Programmatically created Editor().Add*() nodes can still be located by UID or by direct iteration over Topo() definitions.
    bool RemoveShape (const TopoDS_Shape &theShape)
     Remove the active graph node corresponding to a construction-time shape. This is the convenience equivalent of FindNode(theShape) followed by Editor().Gen().RemoveNode(node).

    Detailed Description

    View for TopoDS_Shape ingestion, reconstruction and lookup.

    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 construction-time shapes back to their graph NodeIds using OCCT shape identity (TShape + Location, orientation ignored). 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. Add() and Compact() clear the persistent reconstructed-shape cache. Obtained via BRepGraph::Shapes().

    Member Enumeration Documentation

    ◆ AddStatus

    Status of a single Add() call.

    Enumerator
    Success 

    All faces built successfully.

    SuccessWithWarnings 

    Build completed with diagnostics, e.g. unbounded natural faces.

    Failed 

    Build failed (e.g., null shape).

    Member Function Documentation

    ◆ Add() [1/4]

    Result BRepGraph::ShapesView::Add ( const TopoDS_Shape & theShape)
    nodiscard

    Ingest a TopoDS_Shape as a new root subgraph, wrapping the topology root in a Product.

    Parameters
    [in]theShapeshape to ingest
    Returns
    Result with TopologyRoot, Product and Occurrence set on success.

    ◆ Add() [2/4]

    Result BRepGraph::ShapesView::Add ( const TopoDS_Shape & theShape,
    const BRepGraph_NodeId theParent )
    nodiscard

    Ingest a TopoDS_Shape under an existing parent.

    Parent kind dispatch:

    • Product: creates a child part-product, links via Occurrence with shape.Location().
    • Compound: appends topology root as a child reference.
    • Shell: appends a Face as a FaceRef; other shapes via AddChild.
    • Solid: appends a Shell as a ShellRef; other shapes via AddChild.
    • CompSolid: appends a Solid as a SolidRef. Other parent kinds (Wire, Edge, Vertex, Occurrence) are not supported and yield an invalid Result (Result::Ok == false) without modification to the graph.
      Parameters
      [in]theShapeshape to ingest
      [in]theParentparent node receiving the topology
      Returns
      Result with TopologyRoot set, plus (Product, Occurrence, InsertedRef) for Product parents or InsertedRef for topology container parents.

    ◆ Add() [3/4]

    Result BRepGraph::ShapesView::Add ( const TopoDS_Shape & theShape,
    const BRepGraph_NodeId theParent,
    const Options & theOptions )
    nodiscard

    Ingest a shape under an existing parent with explicit options. Options::CreateAutoProduct is ignored.

    ◆ Add() [4/4]

    Result BRepGraph::ShapesView::Add ( const TopoDS_Shape & theShape,
    const Options & theOptions )
    nodiscard

    Ingest a TopoDS_Shape as a new root subgraph with explicit options.

    Parameters
    [in]theShapeshape to ingest
    [in]theOptionsshape-ingestion options
    Returns
    Result with TopologyRoot set on success; Product/Occurrence set when theOptions.CreateAutoProduct is true.

    ◆ AddWithHistory() [1/4]

    Result BRepGraph::ShapesView::AddWithHistory ( const TopoDS_Shape & theResultShape,
    const NCollection_Array1< BRepGraph_NodeId > & theInputRoots,
    const occ::handle< BRepTools_History > & theHistory,
    const TCollection_AsciiString & theOpLabel )
    nodiscard

    Convenience overload that collects the history input map from selected roots.

    ◆ AddWithHistory() [2/4]

    Result BRepGraph::ShapesView::AddWithHistory ( const TopoDS_Shape & theResultShape,
    const NCollection_Array1< BRepGraph_NodeId > & theInputRoots,
    const occ::handle< BRepTools_History > & theHistory,
    const TCollection_AsciiString & theOpLabel,
    const Options & theOptions )
    nodiscard

    Convenience overload that collects the history input map from selected roots and uses explicit options.

    ◆ AddWithHistory() [3/4]

    Result BRepGraph::ShapesView::AddWithHistory ( const TopoDS_Shape & theResultShape,
    const NCollection_DataMap< TopoDS_Shape, BRepGraph_NodeId, TopTools_ShapeMapHasher > & theInputs,
    const occ::handle< BRepTools_History > & theHistory,
    const TCollection_AsciiString & theOpLabel )
    nodiscard

    Add an OCCT algorithm result and absorb BRepTools_History into the registered BRepGraph_LayerHistory layer using explicit input shape mapping.

    ◆ AddWithHistory() [4/4]

    Result BRepGraph::ShapesView::AddWithHistory ( const TopoDS_Shape & theResultShape,
    const NCollection_DataMap< TopoDS_Shape, BRepGraph_NodeId, TopTools_ShapeMapHasher > & theInputs,
    const occ::handle< BRepTools_History > & theHistory,
    const TCollection_AsciiString & theOpLabel,
    const Options & theOptions )
    nodiscard

    Add an OCCT algorithm result and absorb BRepTools_History with explicit options.

    ◆ ClearCached() [1/2]

    void BRepGraph::ShapesView::ClearCached ( const BRepGraph_NodeId theNode)

    Remove the cached reconstructed shape for one node. Does not change graph generation counters and does not rebuild the shape. Invalid or removed nodes are ignored.

    ◆ ClearCached() [2/2]

    void BRepGraph::ShapesView::ClearCached ( const BRepGraph_RefId theRef)

    Remove the cached reconstructed shape for the node referenced by one reference. Does not change graph generation counters and does not rebuild the shape. Invalid or removed references are ignored.

    ◆ CollectHistoryInputs()

    void BRepGraph::ShapesView::CollectHistoryInputs ( const NCollection_Array1< BRepGraph_NodeId > & theRoots,
    NCollection_DataMap< TopoDS_Shape, BRepGraph_NodeId, TopTools_ShapeMapHasher > & theOutInputs ) const

    Collect a TopoDS_Shape -> NodeId map for graph roots and all subshapes resolvable through FindNode(). This is intended for algorithms that reconstruct selected graph roots to TopoDS, run OCCT, and then need to translate BRepTools_History back to graph NodeIds.

    ◆ FindNode()

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

    Look up the definition NodeId for a shape from graph construction input. Uses OCCT IsSame() semantics (TShape + Location, orientation ignored). Synthetic Product / Occurrence reconstructions are not given dedicated TShape bindings, so lookup is only guaranteed for construction-time topology. Programmatically created Editor().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

    ◆ HasNode()

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

    Check if a shape is known to the graph (was part of construction input). Uses OCCT IsSame() semantics (TShape + Location, orientation ignored). Synthetic Product / Occurrence reconstructions are not given dedicated TShape bindings, so this is only guaranteed for construction-time topology. Programmatically created Editor().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
    nodiscard

    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

    ◆ Original()

    TopoDS_Shape BRepGraph::ShapesView::Original ( const BRepGraph_NodeId theNode) const
    nodiscard

    Return the original TopoDS_Shape stored during graph construction.

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

    ◆ Reconstruct()

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

    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

    ◆ RemoveShape()

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

    Remove the active graph node corresponding to a construction-time shape. This is the convenience equivalent of FindNode(theShape) followed by Editor().Gen().RemoveNode(node).

    Parameters
    [in]theShapeshape to remove
    Returns
    true when an active node was found and removed

    ◆ Shape()

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

    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: