Open CASCADE Technology Reference Manual 8.0.0
Loading...
Searching...
No Matches
Data Structures | Public Types | Public Member Functions
BRepGraph Class Reference

Topology-geometry graph over TopoDS / BRep. More...

#include <BRepGraph.hxx>

Data Structures

class  CacheView
 Non-const view for managing transient cache values on nodes. More...
 
class  EditorView
 Non-const view for programmatic graph construction and structural editing. More...
 
class  MeshView
 Read-only view over mesh data with cache-first, persistent-fallback priority. More...
 
class  RefsView
 Read-only view for RefId/RefUID-based reference storage. More...
 
class  ShapesView
 Read-only view for TopoDS_Shape reconstruction from graph data. More...
 
class  TopoView
 Unified read-only view over topology definitions, adjacency, and representations. More...
 
class  UIDsView
 Read-only view for persistent unique identifiers. More...
 

Public Types

using ReconstructCache = NCollection_DataMap<BRepGraph_NodeId, TopoDS_Shape>
 Shared cache for edge/vertex shapes during multi-face reconstruction.
 

Public Member Functions

 BRepGraph (const BRepGraph &)=delete
 
BRepGraphoperator= (const BRepGraph &)=delete
 
 BRepGraph ()
 Default constructor. Creates an empty graph with default allocator.
 
 BRepGraph (const occ::handle< NCollection_BaseAllocator > &theAlloc)
 Construct with a custom allocator for internal collections.
 
 ~BRepGraph ()
 Destructor.
 
 BRepGraph (BRepGraph &&) noexcept
 Move constructor.
 
BRepGraphoperator= (BRepGraph &&) noexcept
 Move assignment operator.
 
void Clear ()
 Reset the graph to an empty state. Increments generation and regenerates the graph GUID.
 
bool IsDone () const
 Return true if the graph was successfully built.
 
bool ValidateReverseIndex () const
 Verify reverse-index consistency against forward entity / reference-entry tables. Intended for debug builds and regression tests of incremental mutation paths.
 
const NCollection_DynamicArray< BRepGraph_ProductId > & RootProductIds () const
 Return root product identifiers (products not referenced by any active occurrence). Maintained incrementally by Editor/EditorView mutations. Returns empty vector if the graph has not been built.
 
void SetAllocator (const occ::handle< NCollection_BaseAllocator > &theAlloc)
 Replace the internal allocator and re-create all storage.
 
const occ::handle< NCollection_BaseAllocator > & Allocator () const
 Return the current allocator.
 
const TopoViewTopo () const
 Access topology definitions, representation access, adjacency queries, raw Product/Occurrence definition storage, and assembly classification.
 
const UIDsViewUIDs () const
 Access unique identifiers.
 
CacheViewCache ()
 Access transient cache values through the stable grouped-view API. This is the only public cache interface.
 
const CacheViewCache () const
 Access transient cache values (const, read-only Get/Has/CacheKinds). This is the only public cache interface.
 
const RefsViewRefs () const
 Access reference entries and their UIDs.
 
const ShapesViewShapes () const
 Access cached and fresh shape reconstruction.
 
EditorViewEditor ()
 Access programmatic graph construction and mutation.
 
const EditorViewEditor () const
 Const access to editor-specific state queries. Exposes IsDeferredMode() and ValidateMutationBoundary() on a const graph. All structural mutation methods require the non-const Editor() overload.
 
const MeshViewMesh () const
 Access mesh data with cache-first, persistent-fallback priority. For mesh cache writes and rep creation, use BRepGraph_Tool::Mesh.
 
BRepGraph_HistoryHistory ()
 Access history subsystem directly. History is returned directly rather than through a lightweight view because it is already a self-contained query and recording subsystem with no per-view cached state.
 
const BRepGraph_HistoryHistory () const
 Access history subsystem directly (const).
 
BRepGraph_LayerRegistryLayerRegistry ()
 Access registered graph layers.
 
const BRepGraph_LayerRegistryLayerRegistry () const
 Access registered graph layers (const).
 

Detailed Description

Topology-geometry graph over TopoDS / BRep.

Stores B-Rep topology as flat entity vectors (incidence-table model) with integer cross-references, enabling cache-friendly traversal, O(1) upward navigation via reverse indices, and parallel face-level geometry extraction.

Key design concepts:

Per-occurrence data (orientation, location) lives on incidence refs. Definition types are aliases to BRepGraphInc entity structs.

Grouped View API

Related methods are grouped behind lightweight view objects. Include the corresponding header (e.g. BRepGraph_TopoView.hxx) to use.

Thread safety

Const query methods are safe for concurrent reads. Concurrent reads during active mutation still require external synchronization. Deferred invalidation (BRepGraph_DeferredScope) batches SubtreeGen propagation; concurrent Editor().Mut*() calls during deferred mode still require external serialization. BRepGraph_Builder::Add() is internally parallel when requested.

UID persistence

UIDs use monotonic counters (not vector indices), persisting across Compact() and node removal. Only BRepGraph::Clear() resets counters (new generation). See BRepGraph_UID.hxx for the serialization contract.

Extension model

Extend via BRepGraph_Layer (per-node attributes) or BRepGraph_TransientCache (algorithm-computed caches). Direct storage extension is not supported.

ID systems

Four ID types with different stability guarantees:

Iterator guide

Choose the iterator that matches your traversal need:

Member Typedef Documentation

◆ ReconstructCache

Shared cache for edge/vertex shapes during multi-face reconstruction.

Constructor & Destructor Documentation

◆ BRepGraph() [1/4]

BRepGraph::BRepGraph ( const BRepGraph & )
delete

◆ BRepGraph() [2/4]

BRepGraph::BRepGraph ( )

Default constructor. Creates an empty graph with default allocator.

◆ BRepGraph() [3/4]

BRepGraph::BRepGraph ( const occ::handle< NCollection_BaseAllocator > & theAlloc)
explicit

Construct with a custom allocator for internal collections.

Parameters
[in]theAllocallocator for internal collections (null uses CommonBaseAllocator)

◆ ~BRepGraph()

BRepGraph::~BRepGraph ( )

Destructor.

◆ BRepGraph() [4/4]

BRepGraph::BRepGraph ( BRepGraph && )
noexcept

Move constructor.

Member Function Documentation

◆ Allocator()

const occ::handle< NCollection_BaseAllocator > & BRepGraph::Allocator ( ) const

Return the current allocator.

◆ Cache() [1/2]

CacheView & BRepGraph::Cache ( )

Access transient cache values through the stable grouped-view API. This is the only public cache interface.

◆ Cache() [2/2]

const CacheView & BRepGraph::Cache ( ) const

Access transient cache values (const, read-only Get/Has/CacheKinds). This is the only public cache interface.

◆ Clear()

void BRepGraph::Clear ( )

Reset the graph to an empty state. Increments generation and regenerates the graph GUID.

◆ Editor() [1/2]

EditorView & BRepGraph::Editor ( )

Access programmatic graph construction and mutation.

◆ Editor() [2/2]

const EditorView & BRepGraph::Editor ( ) const

Const access to editor-specific state queries. Exposes IsDeferredMode() and ValidateMutationBoundary() on a const graph. All structural mutation methods require the non-const Editor() overload.

◆ History() [1/2]

BRepGraph_History & BRepGraph::History ( )

Access history subsystem directly. History is returned directly rather than through a lightweight view because it is already a self-contained query and recording subsystem with no per-view cached state.

Returns
history subsystem for tracking modifications

◆ History() [2/2]

const BRepGraph_History & BRepGraph::History ( ) const

Access history subsystem directly (const).

Returns
history subsystem for tracking modifications

◆ IsDone()

bool BRepGraph::IsDone ( ) const

Return true if the graph was successfully built.

◆ LayerRegistry() [1/2]

BRepGraph_LayerRegistry & BRepGraph::LayerRegistry ( )

Access registered graph layers.

Returns
layer registry for managing attribute layers

◆ LayerRegistry() [2/2]

const BRepGraph_LayerRegistry & BRepGraph::LayerRegistry ( ) const

Access registered graph layers (const).

Returns
layer registry for managing attribute layers

◆ Mesh()

const MeshView & BRepGraph::Mesh ( ) const

Access mesh data with cache-first, persistent-fallback priority. For mesh cache writes and rep creation, use BRepGraph_Tool::Mesh.

◆ operator=() [1/2]

BRepGraph & BRepGraph::operator= ( BRepGraph && )
noexcept

Move assignment operator.

◆ operator=() [2/2]

BRepGraph & BRepGraph::operator= ( const BRepGraph & )
delete

◆ Refs()

const RefsView & BRepGraph::Refs ( ) const

Access reference entries and their UIDs.

◆ RootProductIds()

const NCollection_DynamicArray< BRepGraph_ProductId > & BRepGraph::RootProductIds ( ) const

Return root product identifiers (products not referenced by any active occurrence). Maintained incrementally by Editor/EditorView mutations. Returns empty vector if the graph has not been built.

◆ SetAllocator()

void BRepGraph::SetAllocator ( const occ::handle< NCollection_BaseAllocator > & theAlloc)

Replace the internal allocator and re-create all storage.

◆ Shapes()

const ShapesView & BRepGraph::Shapes ( ) const

Access cached and fresh shape reconstruction.

◆ Topo()

const TopoView & BRepGraph::Topo ( ) const

Access topology definitions, representation access, adjacency queries, raw Product/Occurrence definition storage, and assembly classification.

◆ UIDs()

const UIDsView & BRepGraph::UIDs ( ) const

Access unique identifiers.

◆ ValidateReverseIndex()

bool BRepGraph::ValidateReverseIndex ( ) const

Verify reverse-index consistency against forward entity / reference-entry tables. Intended for debug builds and regression tests of incremental mutation paths.

Returns
true when every forward ref has a matching reverse entry.

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