BRepGraph
OCCT package BRepGraph: BRepGraph, BRepGraph_Builder, BRepGraph_CacheKind, BRepGraph_CacheKindRegistry, and 180 more bound classes.
BRepGraph
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:
- NodeId (Kind + Index): lightweight typed address into per-kind vectors.
- UID (Kind + Counter): persistent identity surviving compaction/reorder.
- RepId (Kind + Index): separate geometry/mesh addressing (Surface, Curve3D, Curve2D, Triangulation, Polygon) decoupled from topology nodes.
- CoEdge: half-edge entity owning PCurve data for each edge-face binding; seam edges use paired CoEdges with opposite Orientation (Parasolid convention).
- Lifecycle:
BRepGraph_Builder::Add()populates fromTopoDS_Shape;Editor()is the single mutation entry point for both structural creation/removal (Add*, Remove*, Append*) and field-level RAII-scoped mutation (Mut*()) with automatic cache invalidation and upward SubtreeGen propagation.
Per-occurrence data (orientation, location) lives on incidence refs. Definition types are aliases toBRepGraphIncentity 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; concurrentEditor().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. OnlyBRepGraph::Clear()resets counters (new generation). SeeBRepGraph_UID.hxxfor the serialization contract.
Extension model
Extend viaBRepGraph_Layer(per-node attributes) orBRepGraph_TransientCache(algorithm-computed caches). Direct storage extension is not supported.
ID systems
Four ID types with different stability guarantees: - NodeId (Kind + per-kind Index): fast graph-local address. NOT stable across Compact(). Use for in-graph traversal and short-lived algorithm temporaries.
- UID (Kind + monotonic Counter): persistent identity surviving Compact() and node removal. Use for cross-session storage, history tracking, and external references.
- RefId (Kind + per-kind Index): same stability as NodeId, but addresses reference entries (Shell->Solid binding, Face->Shell binding, CoEdge->Wire binding) rather than defs.
- RepId (Kind + per-kind Index): addresses geometry/mesh representation objects (Surface, Curve3D, Curve2D, Triangulation, Polygon) independently of topology nodes.
Iterator guide
Choose the iterator that matches your traversal need: BRepGraph_Iterator<NodeType>: flat sequential scan of ALL definitions of one kind (e.g. every FaceDef, skipping removed). Use for bulk per-kind algorithms.BRepGraph_DefsIterator/BRepGraph_RefsIterator: single-level typed children of one parent (e.g. active shells of one solid, coedge refs of one wire). Zero allocation. Use when you have a specific parent and need its direct children.BRepGraph_ChildExplorer: depth-first downward walk from a root with accumulated location/orientation per step. Use when visiting descendants across multiple levels or when the global transform matters. Supports Recursive and DirectChildren modes.BRepGraph_ParentExplorer: upward walk via reverse indices from a starting node. Use when tracing which shells/solids/compounds contain a given face or edge.BRepGraph_RelatedIterator: single-level semantic neighbors (adjacent faces, boundary edges, incident vertices). No structural descent; no location accumulation.BRepGraph_WireExplorer: ordered edge traversal within a single wire, following connectivity order (graph equivalent ofBRepTools_WireExplorer).
Constructors(2)
Default constructor. Creates an empty graph with default allocator.
- constructor(theAlloc: NCollection_BaseAllocator): BRepGraph
Construct with a custom allocator for internal collections.
Parameters (1)theAlloc—allocator for internal collections (null uses CommonBaseAllocator)
Instance methods(15)
- Clear(): void
Reset the graph to an empty state. Increments generation and regenerates the graph GUID.
- IsDone(): boolean
Return true if the graph was successfully built.
- ValidateReverseIndex(): boolean
Verify reverse-index consistency against forward entity / reference-entry tables. Intended for debug builds and regression tests of incremental mutation paths.
Returnstrue when every forward ref has a matching reverse entry.
- RootProductIds(): any
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(theAlloc: NCollection_BaseAllocator): void
Replace the internal allocator and re-create all storage.
Parameters (1)theAlloc
Return the current allocator.
Access topology definitions, representation access, adjacency queries, raw Product/Occurrence definition storage, and assembly classification.
Access unique identifiers.
Access transient cache values through the stable grouped-view API. This is the only public cache interface.
Access reference entries and their UIDs.
Access cached and fresh shape reconstruction.
Access programmatic graph construction and mutation.
Access mesh data with cache-first, persistent-fallback priority. For mesh cache writes and rep creation, use
BRepGraph_Tool::Mesh.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.
Returnshistory subsystem for tracking modifications
Access registered graph layers.
Returnslayer registry for managing attribute layers
BRepGraph_Builder
Static helper that ingests a TopoDS_Shape into a BRepGraph.
Static methods(4)
- Add(theGraph: BRepGraph, theShape: TopoDS_Shape): BRepGraph_Builder_Result
Ingest a
TopoDS_Shapeas a new root subgraph, wrapping the topology root in a Product.Parameters (2)theGraph—graph to populatetheShape—shape to ingest
ReturnsResultwith TopologyRoot, Product and Occurrence set on success. - Add(theGraph: BRepGraph, theShape: TopoDS_Shape, theOptions: BRepGraph_Builder_Options): BRepGraph_Builder_Result
Ingest a
TopoDS_Shapeas a new root subgraph with explicit options.Parameters (3)theGraph—graph to populatetheShape—shape to ingesttheOptions—build-time options
ReturnsResultwith TopologyRoot set on success; Product/Occurrence set when theOptions.CreateAutoProduct is true. - Add(theGraph: BRepGraph, theShape: TopoDS_Shape, theParent: BRepGraph_NodeId): BRepGraph_Builder_Result
Ingest a
TopoDS_Shapeunder 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 (3)theGraph—graph to populatetheShape—shape to ingesttheParent—parent node receiving the topology
ReturnsResultwith TopologyRoot set, plus (Product, Occurrence, InsertedRef) for Product parents or InsertedRef for topology container parents. - Add(theGraph: BRepGraph, theShape: TopoDS_Shape, theParent: BRepGraph_NodeId, theOptions: BRepGraph_Builder_Options): BRepGraph_Builder_Result
Ingest a shape under an existing parent with explicit options.
Options::CreateAutoProductis ignored.Parameters (4)theGraphtheShapetheParenttheOptions
BRepGraph_CacheKind
Descriptor of one transient cache family.
A cache kind defines stable public identity for one class of transient, recomputable per-node data such as bounding boxes or UV bounds. Instances are process-global descriptors registered in BRepGraph_CacheKindRegistry and referenced from graphs by dense runtime slots.
Constructors(1)
- constructor(theID: Standard_GUID, theName?: TCollection_AsciiString, theNodeKindsMask?: number): BRepGraph_CacheKind
Create a cache kind descriptor.
Parameters (3)theID—stable public GUID identitytheName—display-only nametheNodeKindsMask—optional node-kind applicability mask; 0 means "unspecified / unrestricted"
Static methods(3)
- KindBit(theKind: BRepGraph_NodeId_Kind): number
Convenience: bitmask bit for a given node kind.
Parameters (1)theKind
- get_type_name(): string
Instance methods(5)
- ID(): Standard_GUID
Stable public identity.
Display-only metadata.
- NodeKindsMask(): number
Optional node-kind applicability mask.
- SupportsNodeKind(theKind: BRepGraph_NodeId_Kind): boolean
True if this cache kind is applicable to the given node kind. Cache kinds with
NodeKindsMask()== 0 are treated as unrestricted.Parameters (1)theKind
BRepGraph_CacheKindRegistry
Process-global registry of cache kind descriptors.
Maps stable GUID identity to dense runtime slot index. Slot indices are an internal storage detail used by BRepGraph_TransientCache for O(1) indexing. The registry is shared across all BRepGraph instances in the current process, so cache-kind GUIDs should be globally unique.
Static methods(8)
- Register(theKind: BRepGraph_CacheKind): number
Register a cache kind descriptor. Idempotent: the same GUID always yields the same slot. Slot assignment is process-global and graph-instance independent.
Parameters (1)theKind
Returnsdense runtime slot, or -1 for null input
- FindSlot(theGUID: Standard_GUID): number
Find slot by GUID. Returns -1 if not found.
Parameters (1)theGUID
- FindSlot(theGUID: Standard_GUID, theSlot: number): { returnValue: boolean; theSlot: number }
Find slot by GUID.
Parameters (2)theGUIDtheSlot—dense runtime slot if found
ReturnsA result object with fields:
returnValue: true if the GUID is registeredtheSlot: dense runtime slot if found
- FindKind(theGUID: Standard_GUID): BRepGraph_CacheKind
Find descriptor by GUID.
Parameters (1)theGUID
- FindKind(theSlot: number): BRepGraph_CacheKind
Find descriptor by slot.
Parameters (1)theSlot
- Contains(theGUID: Standard_GUID): boolean
Check whether a GUID is registered.
Parameters (1)theGUID
- Contains(theSlot: number): boolean
Check whether a slot is registered.
Parameters (1)theSlot
- NbRegistered(): number
Number of registered cache kinds.
BRepGraph_CacheValue
Abstract base for transient per-node cache values.
Inherits from Standard_Transient and is stored via occ::handle<BRepGraph_CacheValue>. This uses OCCT's embedded refcount and is consistent with the Handle pattern used throughout the codebase.
Static methods(2)
- get_type_name(): string
Instance methods(3)
- Invalidate(): void
Mark the cached value as needing recomputation. Lock-free.
- IsDirty(): boolean
True if the cached value needs recomputation.
BRepGraph_CacheView
Instance methods(20)
- Set(theNode: BRepGraph_NodeId, theKind: BRepGraph_CacheKind, theValue: BRepGraph_CacheValue): voidParameters (3)
theNodetheKindtheValue
- Set(theNode: BRepGraph_NodeId, theKindSlot: number, theValue: BRepGraph_CacheValue): voidParameters (3)
theNodetheKindSlottheValue
- Set(theRef: BRepGraph_RefId, theKind: BRepGraph_CacheKind, theValue: BRepGraph_CacheValue): voidParameters (3)
theReftheKindtheValue
- Set(theRef: BRepGraph_RefId, theKindSlot: number, theValue: BRepGraph_CacheValue): voidParameters (3)
theReftheKindSlottheValue
- Get(theNode: BRepGraph_NodeId, theKind: BRepGraph_CacheKind): BRepGraph_CacheValueParameters (2)
theNodetheKind
- Get(theNode: BRepGraph_NodeId, theKindSlot: number): BRepGraph_CacheValueParameters (2)
theNodetheKindSlot
- Get(theRef: BRepGraph_RefId, theKind: BRepGraph_CacheKind): BRepGraph_CacheValueParameters (2)
theReftheKind
- Get(theRef: BRepGraph_RefId, theKindSlot: number): BRepGraph_CacheValueParameters (2)
theReftheKindSlot
- Has(theNode: BRepGraph_NodeId, theKind: BRepGraph_CacheKind): booleanParameters (2)
theNodetheKind
- Has(theNode: BRepGraph_NodeId, theKindSlot: number): booleanParameters (2)
theNodetheKindSlot
- Has(theRef: BRepGraph_RefId, theKind: BRepGraph_CacheKind): booleanParameters (2)
theReftheKind
- Has(theRef: BRepGraph_RefId, theKindSlot: number): booleanParameters (2)
theReftheKindSlot
- Remove(theNode: BRepGraph_NodeId, theKind: BRepGraph_CacheKind): booleanParameters (2)
theNodetheKind
- Remove(theNode: BRepGraph_NodeId, theKindSlot: number): booleanParameters (2)
theNodetheKindSlot
- Remove(theRef: BRepGraph_RefId, theKind: BRepGraph_CacheKind): booleanParameters (2)
theReftheKind
- Remove(theRef: BRepGraph_RefId, theKindSlot: number): booleanParameters (2)
theReftheKindSlot
- Invalidate(theNode: BRepGraph_NodeId, theKind: BRepGraph_CacheKind): voidParameters (2)
theNodetheKind
- Invalidate(theNode: BRepGraph_NodeId, theKindSlot: number): voidParameters (2)
theNodetheKindSlot
- Invalidate(theRef: BRepGraph_RefId, theKind: BRepGraph_CacheKind): voidParameters (2)
theReftheKind
- Invalidate(theRef: BRepGraph_RefId, theKindSlot: number): voidParameters (2)
theReftheKindSlot
BRepGraph_ChildExplorer
Stack-based lazy downward hierarchy walker for BRepGraph with inline location/orientation accumulation.
Walks the graph hierarchy from a root node down to entities of a target kind, yielding one occurrence at a time via a depth-first stack. Location and orientation are composed incrementally during the walk, making Current().Location and Current().Orientation O(1) per call.
The traversal follows the actual graph structure transparently - every node kind is visited as a distinct entity (no hidden collapses): Compound -> children, CompSolid -> Solids, Solid -> Shells, Shell -> Faces, Face -> Wires (+direct Vertices), Wire -> CoEdges, CoEdge -> Edge, Edge -> Vertices, Product(assembly) -> Occurrences, Product(part) -> ShapeRoot, Occurrence -> Product.
Unlike flat definition traversal by typed ids, BRepGraph_ChildExplorer visits each occurrence. If Edge[5] is reachable through Face[0] and Face[1], it is visited twice with different accumulated transforms.
Traversal modes
- Recursive: depth-first walk through the full subgraph. Without target kind, all descendant nodes are emitted. With target kind, only matching nodes are emitted but intermediate levels are traversed to reach them.
- DirectChildren: yields only the immediate children of the root. No descent into grandchildren. With target kind, only children matching the kind are returned.
Constructors(12)
- constructor(theGraph: BRepGraph, theRoot: BRepGraph_NodeId): BRepGraph_ChildExplorerParameters (2)
theGraphtheRoot
- constructor(theGraph: BRepGraph, theRoot: BRepGraph_NodeId, theConfig: BRepGraph_ChildExplorer_Config): BRepGraph_ChildExplorer
Preferred long-term constructor: all tuning knobs in
Config.Parameters (3)theGraph—graph to walktheRoot—root node where the walk beginstheConfig—traversal configuration (mode, target kind, avoid kind, etc.)
- constructor(theGraph: BRepGraph, theRoot: BRepGraph_NodeId, theMode: BRepGraph_ChildExplorer_TraversalMode): BRepGraph_ChildExplorer
Preferred long-term constructor: all tuning knobs in
Config.Parameters (3)theGraph—graph to walktheRoot—root node where the walk beginstheMode
- constructor(theGraph: BRepGraph, theRoot: BRepGraph_NodeId, theTargetKind: BRepGraph_NodeId_Kind): BRepGraph_ChildExplorer
Preferred long-term constructor: all tuning knobs in
Config.Parameters (3)theGraph—graph to walktheRoot—root node where the walk beginstheTargetKind
- constructor(theGraph: BRepGraph, theProduct: BRepGraph_ProductId, theTargetKind: BRepGraph_NodeId_Kind): BRepGraph_ChildExplorer
Preferred long-term constructor: all tuning knobs in
Config.Parameters (3)theGraph—graph to walktheProducttheTargetKind
- constructor(theGraph: BRepGraph, theRoot: BRepGraph_NodeId, theTargetKind: BRepGraph_NodeId_Kind, theMode: BRepGraph_ChildExplorer_TraversalMode): BRepGraph_ChildExplorerParameters (4)
theGraphtheRoottheTargetKindtheMode
- constructor(theGraph: BRepGraph, theProduct: BRepGraph_ProductId, theTargetKind: BRepGraph_NodeId_Kind, theMode: BRepGraph_ChildExplorer_TraversalMode): BRepGraph_ChildExplorerParameters (4)
theGraphtheProducttheTargetKindtheMode
- constructor(theGraph: BRepGraph, theRoot: BRepGraph_NodeId, theAvoidKind: BRepGraph_NodeId_Kind | null | undefined, theEmitAvoidKind: boolean, theMode?: BRepGraph_ChildExplorer_TraversalMode): BRepGraph_ChildExplorerParameters (5)
theGraphtheRoottheAvoidKindtheEmitAvoidKindtheMode
- constructor(theGraph: BRepGraph, theRoot: BRepGraph_NodeId, theTargetKind: BRepGraph_NodeId_Kind, theAvoidKind: BRepGraph_NodeId_Kind | null | undefined, theEmitAvoidKind: boolean, theMode?: BRepGraph_ChildExplorer_TraversalMode): BRepGraph_ChildExplorerParameters (6)
theGraphtheRoottheTargetKindtheAvoidKindtheEmitAvoidKindtheMode
- constructor(theGraph: BRepGraph, theRoot: BRepGraph_NodeId, theTargetKind: BRepGraph_NodeId_Kind, theCumLoc: boolean, theCumOri: boolean, theMode?: BRepGraph_ChildExplorer_TraversalMode): BRepGraph_ChildExplorerParameters (6)
theGraphtheRoottheTargetKindtheCumLoctheCumOritheMode
- constructor(theGraph: BRepGraph, theProduct: BRepGraph_ProductId, theTargetKind: BRepGraph_NodeId_Kind, theCumLoc: boolean, theCumOri: boolean, theMode?: BRepGraph_ChildExplorer_TraversalMode): BRepGraph_ChildExplorerParameters (6)
theGraphtheProducttheTargetKindtheCumLoctheCumOritheMode
- constructor(theGraph: BRepGraph, theRoot: BRepGraph_NodeId, theTargetKind: BRepGraph_NodeId_Kind, theStartLoc: TopLoc_Location, theStartOri: TopAbs_Orientation, theMode?: BRepGraph_ChildExplorer_TraversalMode): BRepGraph_ChildExplorer
Disambiguates non-product typed ids from the ProductId-specific overload family above and keeps them on the generic NodeId traversal path.
Parameters (6)theGraphtheRoottheTargetKindtheStartLoctheStartOritheMode
Instance methods(12)
- GetConfig(): BRepGraph_ChildExplorer_Config
Returns the traversal configuration this explorer was constructed with. Read-only - configuration is fixed for the lifetime of the explorer.
- More(): boolean
- Next(): void
- Current(): any
Returns the immediate parent of
Current()in the explored path. Returns invalid NodeId whenCurrent()is the root/self match.- CurrentLinkKind(): BRepGraph_ChildExplorer_LinkKind
Returns how
Current()is linked fromCurrentParent(). Returns the exact parent-owned RefId for
Current(), when the current step is represented by a reference entry. Returns invalid RefId for structural links without a dedicated ref entry such as CoEdge->Edge, Product(part)->ShapeRoot and Occurrence->Product.- LocationOf(theKind: BRepGraph_NodeId_Kind): TopLoc_LocationParameters (1)
theKind
- NodeOf(theKind: BRepGraph_NodeId_Kind): BRepGraph_NodeIdParameters (1)
theKind
- LocationAt(theLevel: number): TopLoc_LocationParameters (1)
theLevel
- NodeAt(theLevel: number): BRepGraph_NodeIdParameters (1)
theLevel
Returns a sentinel marking the end of iteration.
BRepGraph_ChildRefId
Constructors(3)
- constructor(theIdx: number): BRepGraph_ChildRefIdParameters (1)
theIdx
- constructor(theRefId: BRepGraph_RefId): BRepGraph_ChildRefIdParameters (1)
theRefId
Static methods(3)
- Start(): BRepGraph_RefId_Typed
- Invalid(): BRepGraph_RefId_Typed
- FromRefId(theRefId: BRepGraph_RefId): BRepGraph_RefId_TypedParameters (1)
theRefId
Instance methods(2)
Properties(1)
BRepGraph_CoEdgeId
Constructors(3)
- constructor(theIdx: number): BRepGraph_CoEdgeIdParameters (1)
theIdx
- Parameters (1)
theId
Static methods(3)
- Start(): BRepGraph_NodeId_Typed
- Invalid(): BRepGraph_NodeId_Typed
- FromNodeId(theId: BRepGraph_NodeId): BRepGraph_NodeId_TypedParameters (1)
theId
Instance methods(2)
Properties(1)
BRepGraph_CoEdgeRefId
Constructors(3)
- constructor(theIdx: number): BRepGraph_CoEdgeRefIdParameters (1)
theIdx
- constructor(theRefId: BRepGraph_RefId): BRepGraph_CoEdgeRefIdParameters (1)
theRefId
Static methods(3)
- Start(): BRepGraph_RefId_Typed
- Invalid(): BRepGraph_RefId_Typed
- FromRefId(theRefId: BRepGraph_RefId): BRepGraph_RefId_TypedParameters (1)
theRefId
Instance methods(2)
Properties(1)
BRepGraph_CoEdgesOfEdge
Constructors(2)
- constructor(theGraph: BRepGraph, theParents: any): BRepGraph_CoEdgesOfEdgeParameters (2)
theGraphtheParents
- constructor(theGraph: BRepGraph, theParents: any, theStartIndex: number): BRepGraph_CoEdgesOfEdgeParameters (3)
theGraphtheParentstheStartIndex
Instance methods(10)
- More(): boolean
- Next(): void
- Definition(): unknown
- Index(): number
- Length(): number
- Size(): number
- Value(theIndex: number): BRepGraph_CoEdgeIdParameters (1)
theIndex
BRepGraph_Compact
Graph compaction algorithm that reclaims removed node slots.
After deduplication or other operations that mark nodes as removed, this algorithm rebuilds the graph with dense index arrays, eliminating all removed nodes and reassigning indices to be contiguous.
Strategy: rebuild-and-swap. A fresh BRepGraph is constructed from non-removed nodes with remapped indices, then move-assigned into the input graph.
Static methods(2)
Run compaction with default options.
Parameters (1)theGraph—graph to compact
Returnscompaction statistics
Run compaction with specified options.
Parameters (2)theGraph—graph to compacttheOptions—compaction configuration
Returnscompaction statistics
BRepGraph_CompoundId
Constructors(3)
- constructor(theIdx: number): BRepGraph_CompoundIdParameters (1)
theIdx
- Parameters (1)
theId
Static methods(3)
- Start(): BRepGraph_NodeId_Typed
- Invalid(): BRepGraph_NodeId_Typed
- FromNodeId(theId: BRepGraph_NodeId): BRepGraph_NodeId_TypedParameters (1)
theId
Instance methods(2)
Properties(1)
BRepGraph_CompoundsOfCompSolid
Constructors(2)
- constructor(theGraph: BRepGraph, theParents: any): BRepGraph_CompoundsOfCompSolidParameters (2)
theGraphtheParents
- constructor(theGraph: BRepGraph, theParents: any, theStartIndex: number): BRepGraph_CompoundsOfCompSolidParameters (3)
theGraphtheParentstheStartIndex
Instance methods(10)
- More(): boolean
- Next(): void
- Definition(): unknown
- Index(): number
- Length(): number
- Size(): number
- Value(theIndex: number): BRepGraph_CompoundIdParameters (1)
theIndex
BRepGraph_CompSolidId
Constructors(3)
- constructor(theIdx: number): BRepGraph_CompSolidIdParameters (1)
theIdx
- Parameters (1)
theId
Static methods(3)
- Start(): BRepGraph_NodeId_Typed
- Invalid(): BRepGraph_NodeId_Typed
- FromNodeId(theId: BRepGraph_NodeId): BRepGraph_NodeId_TypedParameters (1)
theId
Instance methods(2)
Properties(1)
BRepGraph_CompSolidsOfSolid
Constructors(2)
- constructor(theGraph: BRepGraph, theParents: any): BRepGraph_CompSolidsOfSolidParameters (2)
theGraphtheParents
- constructor(theGraph: BRepGraph, theParents: any, theStartIndex: number): BRepGraph_CompSolidsOfSolidParameters (3)
theGraphtheParentstheStartIndex
Instance methods(10)
- More(): boolean
- Next(): void
- Definition(): unknown
- Index(): number
- Length(): number
- Size(): number
- Value(theIndex: number): BRepGraph_CompSolidIdParameters (1)
theIndex
BRepGraph_Copy
Graph-to-graph deep copy.
Produces a new BRepGraph from an existing one in a single bottom-up pass, avoiding the 5-7 traversals of BRepTools_Modifier used by BRepBuilderAPI_Copy.
Two modes:
- theCopyGeom = true (deep): geometry handles are cloned, result is fully independent.
- theCopyGeom = false (light): geometry handles are shared, only topology is duplicated.
Typical usage
Static methods(2)
Copy the entire graph.
Parameters (2)theGraph—a pre-builtBRepGraph(must have IsDone() == true)theCopyGeom—if true (default), geometry handles are deep-copied; if false, geometry is shared (only topology is duplicated)
Returnsa new
BRepGraphwith IsDone() == true on success, or an empty graph with IsDone() == false on failure- CopyNode(theGraph: BRepGraph, theNodeId: BRepGraph_NodeId, theCopyGeom: boolean, theCopyMesh: boolean, theReserveCache: boolean): BRepGraph
Copy a single node sub-graph of any kind (Face, Shell, Solid, Wire, Edge, Vertex, etc.). The new graph contains only the specified node and all entities it references.
Parameters (5)theGraph—a pre-builtBRepGraphtheNodeId—node identifier (any kind)theCopyGeom—if true, geometry handles are deep-copiedtheCopyMesh—if true, cached mesh entries are propagated to the result; if false, mesh references are dropped on copied facestheReserveCache—if true, pre-allocates transient cache
Returnsa new
BRepGraphcontaining only the specified sub-graph
BRepGraph_Curve2DRepId
Constructors(3)
- constructor(theIdx: number): BRepGraph_Curve2DRepIdParameters (1)
theIdx
- Parameters (1)
theId
Static methods(3)
- Start(): BRepGraph_RepId_Typed
- Invalid(): BRepGraph_RepId_Typed
- FromRepId(theId: BRepGraph_RepId): BRepGraph_RepId_TypedParameters (1)
theId
Instance methods(2)
Properties(1)
BRepGraph_Curve3DRepId
Constructors(3)
- constructor(theIdx: number): BRepGraph_Curve3DRepIdParameters (1)
theIdx
- Parameters (1)
theId
Static methods(3)
- Start(): BRepGraph_RepId_Typed
- Invalid(): BRepGraph_RepId_Typed
- FromRepId(theId: BRepGraph_RepId): BRepGraph_RepId_TypedParameters (1)
theId
Instance methods(2)
Properties(1)
BRepGraph_Data
Internal storage for BRepGraph (PIMPL).
All topology definition data and UIDs live in myIncStorage. Access via myIncStorage.Edges, myIncStorage.Faces, etc.
Constructors(2)
- constructor(theAlloc: NCollection_BaseAllocator): BRepGraph_DataParameters (1)
theAlloc
Properties(31)
BRepGraph_Deduplicate
Deep geometry deduplication algorithm over an existing BRepGraph.
This algorithm canonicalizes deep-equal geometry references (surfaces and 3D curves) using GeomHash hashers. It updates face/edge definition links to canonical geometry nodes and can record lineage in graph history.
First implementation intentionally does not merge edge/face definitions yet.
Static methods(2)
Run deduplication on a built graph.
Parameters (1)theGraph—graph to update
Returnsdedup statistics
- Perform(theGraph: BRepGraph, theOptions: BRepGraph_Deduplicate_Options): BRepGraph_Deduplicate_Result
Run deduplication on a built graph.
Parameters (2)theGraph—graph to updatetheOptions—dedup configuration
Returnsdedup statistics
BRepGraph_DeferredScope
RAII guard for batch mutation scopes with deferred invalidation.
Activates deferred invalidation on construction and flushes it on destruction, followed by CommitMutation validation. Guarantees exception-safe cleanup: when this guard owns deferred mode, it is always closed and boundary checks are executed at scope exit. EndDeferredInvalidation() batch-propagates SubtreeGen upward, then CommitMutation() validates reverse-index consistency and active-entity counts.
Re-entrant: if deferred mode is already active (e.g., nested guard), the inner guard is a no-op. Only the outermost guard flushes and commits, so nested scopes do not create separate transaction or validation boundaries.
Usage:
Constructors(1)
- constructor(theGraph: BRepGraph): BRepGraph_DeferredScope
Begin deferred invalidation if not already active.
Parameters (1)theGraph
BRepGraph_DefsChildOfCompound
Constructors(1)
- constructor(theGraph: BRepGraph, theParent: unknown): BRepGraph_DefsChildOfCompoundParameters (2)
theGraphtheParent
Instance methods(6)
BRepGraph_DefsChildOfShell
Constructors(1)
- constructor(theGraph: BRepGraph, theParent: unknown): BRepGraph_DefsChildOfShellParameters (2)
theGraphtheParent
Instance methods(6)
BRepGraph_DefsChildOfSolid
Constructors(1)
- constructor(theGraph: BRepGraph, theParent: unknown): BRepGraph_DefsChildOfSolidParameters (2)
theGraphtheParent
Instance methods(6)
BRepGraph_DefsCoEdgeOfWire
Constructors(1)
- constructor(theGraph: BRepGraph, theParent: unknown): BRepGraph_DefsCoEdgeOfWireParameters (2)
theGraphtheParent
Instance methods(6)
BRepGraph_DefsEdgeOfWire
Constructors(1)
- constructor(theGraph: BRepGraph, theParent: unknown): BRepGraph_DefsEdgeOfWireParameters (2)
theGraphtheParent
Instance methods(6)
BRepGraph_DefsFaceOfShell
Constructors(1)
- constructor(theGraph: BRepGraph, theParent: unknown): BRepGraph_DefsFaceOfShellParameters (2)
theGraphtheParent
Instance methods(6)
BRepGraph_DefsIterator_ChildOfCompoundTraits
Constructors(1)
Static methods(5)
- IsParentValid(theGraph: BRepGraph, theParent: BRepGraph_CompoundId): booleanParameters (2)
theGraphtheParent
- RefIds(theGraph: BRepGraph, theParent: BRepGraph_CompoundId): anyParameters (2)
theGraphtheParent
- Ref(theGraph: BRepGraph, theRefId: BRepGraph_ChildRefId): BRepGraphInc_ChildRefParameters (2)
theGraphtheRefId
- ChildIdOf(argNo0: BRepGraph, theRef: BRepGraphInc_ChildRef): BRepGraph_NodeIdParameters (2)
argNo0theRef
- Child(theGraph: BRepGraph, theChildId: BRepGraph_NodeId): unknownParameters (2)
theGraphtheChildId
BRepGraph_DefsIterator_ChildOfShellTraits
Constructors(1)
Static methods(5)
- IsParentValid(theGraph: BRepGraph, theParent: BRepGraph_ShellId): booleanParameters (2)
theGraphtheParent
- RefIds(theGraph: BRepGraph, theParent: BRepGraph_ShellId): anyParameters (2)
theGraphtheParent
- Ref(theGraph: BRepGraph, theRefId: BRepGraph_ChildRefId): BRepGraphInc_ChildRefParameters (2)
theGraphtheRefId
- ChildIdOf(argNo0: BRepGraph, theRef: BRepGraphInc_ChildRef): BRepGraph_NodeIdParameters (2)
argNo0theRef
- Child(theGraph: BRepGraph, theChildId: BRepGraph_NodeId): unknownParameters (2)
theGraphtheChildId
BRepGraph_DefsIterator_ChildOfSolidTraits
Constructors(1)
Static methods(5)
- IsParentValid(theGraph: BRepGraph, theParent: BRepGraph_SolidId): booleanParameters (2)
theGraphtheParent
- RefIds(theGraph: BRepGraph, theParent: BRepGraph_SolidId): anyParameters (2)
theGraphtheParent
- Ref(theGraph: BRepGraph, theRefId: BRepGraph_ChildRefId): BRepGraphInc_ChildRefParameters (2)
theGraphtheRefId
- ChildIdOf(argNo0: BRepGraph, theRef: BRepGraphInc_ChildRef): BRepGraph_NodeIdParameters (2)
argNo0theRef
- Child(theGraph: BRepGraph, theChildId: BRepGraph_NodeId): unknownParameters (2)
theGraphtheChildId
BRepGraph_DefsIterator_CoEdgeOfWireTraits
Constructors(1)
Static methods(5)
- IsParentValid(theGraph: BRepGraph, theParent: BRepGraph_WireId): booleanParameters (2)
theGraphtheParent
- RefIds(theGraph: BRepGraph, theParent: BRepGraph_WireId): anyParameters (2)
theGraphtheParent
- Ref(theGraph: BRepGraph, theRefId: BRepGraph_CoEdgeRefId): BRepGraphInc_CoEdgeRefParameters (2)
theGraphtheRefId
- ChildIdOf(argNo0: BRepGraph, theRef: BRepGraphInc_CoEdgeRef): BRepGraph_CoEdgeIdParameters (2)
argNo0theRef
- Child(theGraph: BRepGraph, theChildId: BRepGraph_CoEdgeId): unknownParameters (2)
theGraphtheChildId
BRepGraph_DefsIterator_DefsVertexOfEdge
Constructors(1)
- constructor(theGraph: BRepGraph, theEdgeId: BRepGraph_EdgeId): BRepGraph_DefsIterator_DefsVertexOfEdgeParameters (2)
theGraphtheEdgeId
Instance methods(6)
BRepGraph_DefsIterator_EdgeOfWireTraits
Constructors(1)
Static methods(5)
- IsParentValid(theGraph: BRepGraph, theParent: BRepGraph_WireId): booleanParameters (2)
theGraphtheParent
- RefIds(theGraph: BRepGraph, theParent: BRepGraph_WireId): anyParameters (2)
theGraphtheParent
- Ref(theGraph: BRepGraph, theRefId: BRepGraph_CoEdgeRefId): BRepGraphInc_CoEdgeRefParameters (2)
theGraphtheRefId
- ChildIdOf(theGraph: BRepGraph, theRef: BRepGraphInc_CoEdgeRef): BRepGraph_EdgeIdParameters (2)
theGraphtheRef
- Child(theGraph: BRepGraph, theChildId: BRepGraph_EdgeId): unknownParameters (2)
theGraphtheChildId
BRepGraph_DefsIterator_FaceOfShellTraits
Constructors(1)
Static methods(5)
- IsParentValid(theGraph: BRepGraph, theParent: BRepGraph_ShellId): booleanParameters (2)
theGraphtheParent
- RefIds(theGraph: BRepGraph, theParent: BRepGraph_ShellId): anyParameters (2)
theGraphtheParent
- Ref(theGraph: BRepGraph, theRefId: BRepGraph_FaceRefId): BRepGraphInc_FaceRefParameters (2)
theGraphtheRefId
- ChildIdOf(argNo0: BRepGraph, theRef: BRepGraphInc_FaceRef): BRepGraph_FaceIdParameters (2)
argNo0theRef
- Child(theGraph: BRepGraph, theChildId: BRepGraph_FaceId): unknownParameters (2)
theGraphtheChildId
BRepGraph_DefsIterator_OccurrenceOfProductTraits
Constructors(1)
Static methods(5)
- IsParentValid(theGraph: BRepGraph, theParent: BRepGraph_ProductId): booleanParameters (2)
theGraphtheParent
- RefIds(theGraph: BRepGraph, theParent: BRepGraph_ProductId): anyParameters (2)
theGraphtheParent
- Ref(theGraph: BRepGraph, theRefId: BRepGraph_OccurrenceRefId): BRepGraphInc_OccurrenceRefParameters (2)
theGraphtheRefId
- ChildIdOf(argNo0: BRepGraph, theRef: BRepGraphInc_OccurrenceRef): BRepGraph_OccurrenceIdParameters (2)
argNo0theRef
- Child(theGraph: BRepGraph, theChildId: BRepGraph_OccurrenceId): unknownParameters (2)
theGraphtheChildId
BRepGraph_DefsIterator_ShellOfSolidTraits
Constructors(1)
Static methods(5)
- IsParentValid(theGraph: BRepGraph, theParent: BRepGraph_SolidId): booleanParameters (2)
theGraphtheParent
- RefIds(theGraph: BRepGraph, theParent: BRepGraph_SolidId): anyParameters (2)
theGraphtheParent
- Ref(theGraph: BRepGraph, theRefId: BRepGraph_ShellRefId): BRepGraphInc_ShellRefParameters (2)
theGraphtheRefId
- ChildIdOf(argNo0: BRepGraph, theRef: BRepGraphInc_ShellRef): BRepGraph_ShellIdParameters (2)
argNo0theRef
- Child(theGraph: BRepGraph, theChildId: BRepGraph_ShellId): unknownParameters (2)
theGraphtheChildId
BRepGraph_DefsIterator_SolidOfCompSolidTraits
Constructors(1)
Static methods(5)
- IsParentValid(theGraph: BRepGraph, theParent: BRepGraph_CompSolidId): booleanParameters (2)
theGraphtheParent
- RefIds(theGraph: BRepGraph, theParent: BRepGraph_CompSolidId): anyParameters (2)
theGraphtheParent
- Ref(theGraph: BRepGraph, theRefId: BRepGraph_SolidRefId): BRepGraphInc_SolidRefParameters (2)
theGraphtheRefId
- ChildIdOf(argNo0: BRepGraph, theRef: BRepGraphInc_SolidRef): BRepGraph_SolidIdParameters (2)
argNo0theRef
- Child(theGraph: BRepGraph, theChildId: BRepGraph_SolidId): unknownParameters (2)
theGraphtheChildId
BRepGraph_DefsIterator_VertexOfFaceTraits
Constructors(1)
Static methods(5)
- IsParentValid(theGraph: BRepGraph, theParent: BRepGraph_FaceId): booleanParameters (2)
theGraphtheParent
- RefIds(theGraph: BRepGraph, theParent: BRepGraph_FaceId): anyParameters (2)
theGraphtheParent
- Ref(theGraph: BRepGraph, theRefId: BRepGraph_VertexRefId): BRepGraphInc_VertexRefParameters (2)
theGraphtheRefId
- ChildIdOf(argNo0: BRepGraph, theRef: BRepGraphInc_VertexRef): BRepGraph_VertexIdParameters (2)
argNo0theRef
- Child(theGraph: BRepGraph, theChildId: BRepGraph_VertexId): unknownParameters (2)
theGraphtheChildId
BRepGraph_DefsIterator_WireOfFaceTraits
Constructors(1)
Static methods(5)
- IsParentValid(theGraph: BRepGraph, theParent: BRepGraph_FaceId): booleanParameters (2)
theGraphtheParent
- RefIds(theGraph: BRepGraph, theParent: BRepGraph_FaceId): anyParameters (2)
theGraphtheParent
- Ref(theGraph: BRepGraph, theRefId: BRepGraph_WireRefId): BRepGraphInc_WireRefParameters (2)
theGraphtheRefId
- ChildIdOf(argNo0: BRepGraph, theRef: BRepGraphInc_WireRef): BRepGraph_WireIdParameters (2)
argNo0theRef
- Child(theGraph: BRepGraph, theChildId: BRepGraph_WireId): unknownParameters (2)
theGraphtheChildId
BRepGraph_DefsOccurrenceOfProduct
Constructors(1)
- constructor(theGraph: BRepGraph, theParent: unknown): BRepGraph_DefsOccurrenceOfProductParameters (2)
theGraphtheParent
Instance methods(6)
BRepGraph_DefsShellOfSolid
Constructors(1)
- constructor(theGraph: BRepGraph, theParent: unknown): BRepGraph_DefsShellOfSolidParameters (2)
theGraphtheParent
Instance methods(6)
BRepGraph_DefsSolidOfCompSolid
Constructors(1)
- constructor(theGraph: BRepGraph, theParent: unknown): BRepGraph_DefsSolidOfCompSolidParameters (2)
theGraphtheParent
Instance methods(6)
BRepGraph_DefsVertexOfFace
Constructors(1)
- constructor(theGraph: BRepGraph, theParent: unknown): BRepGraph_DefsVertexOfFaceParameters (2)
theGraphtheParent
Instance methods(6)
BRepGraph_DefsWireOfFace
Constructors(1)
- constructor(theGraph: BRepGraph, theParent: unknown): BRepGraph_DefsWireOfFaceParameters (2)
theGraphtheParent
Instance methods(6)
BRepGraph_EdgeId
Constructors(3)
- constructor(theIdx: number): BRepGraph_EdgeIdParameters (1)
theIdx
- constructor(theId: BRepGraph_NodeId): BRepGraph_EdgeIdParameters (1)
theId
Static methods(3)
- Start(): BRepGraph_NodeId_Typed
- Invalid(): BRepGraph_NodeId_Typed
- FromNodeId(theId: BRepGraph_NodeId): BRepGraph_NodeId_TypedParameters (1)
theId
Instance methods(2)
Properties(1)
BRepGraph_EdgesOfVertex
Constructors(2)
- constructor(theGraph: BRepGraph, theParents: any): BRepGraph_EdgesOfVertexParameters (2)
theGraphtheParents
- constructor(theGraph: BRepGraph, theParents: any, theStartIndex: number): BRepGraph_EdgesOfVertexParameters (3)
theGraphtheParentstheStartIndex
Instance methods(10)
- More(): boolean
- Next(): void
- Definition(): unknown
- Index(): number
- Length(): number
- Size(): number
- Value(theIndex: number): BRepGraph_EdgeIdParameters (1)
theIndex
BRepGraph_EditorView
Instance methods(18)
- Vertices(): BRepGraph_EditorView_VertexOps
- Edges(): BRepGraph_EditorView_EdgeOps
- CoEdges(): BRepGraph_EditorView_CoEdgeOps
- Wires(): BRepGraph_EditorView_WireOps
- Faces(): BRepGraph_EditorView_FaceOps
- Shells(): BRepGraph_EditorView_ShellOps
- Solids(): BRepGraph_EditorView_SolidOps
- Compounds(): BRepGraph_EditorView_CompoundOps
- CompSolids(): BRepGraph_EditorView_CompSolidOps
- Products(): BRepGraph_EditorView_ProductOps
- Occurrences(): BRepGraph_EditorView_OccurrenceOps
- Gen(): BRepGraph_EditorView_GenOps
- Reps(): BRepGraph_EditorView_RepOps
- BeginDeferredInvalidation(): void
- EndDeferredInvalidation(): void
- IsDeferredMode(): boolean
- CommitMutation(): void
- ValidateMutationBoundary(theIssues?: any): booleanParameters (1)
theIssues
BRepGraph_FaceId
Constructors(3)
- constructor(theIdx: number): BRepGraph_FaceIdParameters (1)
theIdx
- constructor(theId: BRepGraph_NodeId): BRepGraph_FaceIdParameters (1)
theId
Static methods(3)
- Start(): BRepGraph_NodeId_Typed
- Invalid(): BRepGraph_NodeId_Typed
- FromNodeId(theId: BRepGraph_NodeId): BRepGraph_NodeId_TypedParameters (1)
theId
Instance methods(2)
Properties(1)
BRepGraph_FaceRefId
Constructors(3)
- constructor(theIdx: number): BRepGraph_FaceRefIdParameters (1)
theIdx
- constructor(theRefId: BRepGraph_RefId): BRepGraph_FaceRefIdParameters (1)
theRefId
Static methods(3)
- Start(): BRepGraph_RefId_Typed
- Invalid(): BRepGraph_RefId_Typed
- FromRefId(theRefId: BRepGraph_RefId): BRepGraph_RefId_TypedParameters (1)
theRefId
Instance methods(2)
Properties(1)
BRepGraph_FacesOfEdge
Constructors(2)
- constructor(theGraph: BRepGraph, theParents: any): BRepGraph_FacesOfEdgeParameters (2)
theGraphtheParents
- constructor(theGraph: BRepGraph, theParents: any, theStartIndex: number): BRepGraph_FacesOfEdgeParameters (3)
theGraphtheParentstheStartIndex
Instance methods(10)
- More(): boolean
- Next(): void
- Definition(): unknown
- Index(): number
- Length(): number
- Size(): number
- Value(theIndex: number): BRepGraph_FaceIdParameters (1)
theIndex
BRepGraph_FullChildRefIterator
Constructors(2)
- constructor(theGraph: BRepGraph): BRepGraph_FullChildRefIteratorParameters (1)
theGraph
- constructor(theGraph: BRepGraph, theStartId: unknown): BRepGraph_FullChildRefIteratorParameters (2)
theGraphtheStartId
Instance methods(5)
BRepGraph_FullCoEdgeRefIterator
Constructors(2)
- constructor(theGraph: BRepGraph): BRepGraph_FullCoEdgeRefIteratorParameters (1)
theGraph
- constructor(theGraph: BRepGraph, theStartId: unknown): BRepGraph_FullCoEdgeRefIteratorParameters (2)
theGraphtheStartId
Instance methods(5)
BRepGraph_FullFaceRefIterator
Constructors(2)
- constructor(theGraph: BRepGraph): BRepGraph_FullFaceRefIteratorParameters (1)
theGraph
- constructor(theGraph: BRepGraph, theStartId: unknown): BRepGraph_FullFaceRefIteratorParameters (2)
theGraphtheStartId
Instance methods(5)
BRepGraph_FullOccurrenceRefIterator
Constructors(2)
- constructor(theGraph: BRepGraph): BRepGraph_FullOccurrenceRefIteratorParameters (1)
theGraph
- constructor(theGraph: BRepGraph, theStartId: unknown): BRepGraph_FullOccurrenceRefIteratorParameters (2)
theGraphtheStartId
Instance methods(5)
BRepGraph_FullShellRefIterator
Constructors(2)
- constructor(theGraph: BRepGraph): BRepGraph_FullShellRefIteratorParameters (1)
theGraph
- constructor(theGraph: BRepGraph, theStartId: unknown): BRepGraph_FullShellRefIteratorParameters (2)
theGraphtheStartId
Instance methods(5)
BRepGraph_FullSolidRefIterator
Constructors(2)
- constructor(theGraph: BRepGraph): BRepGraph_FullSolidRefIteratorParameters (1)
theGraph
- constructor(theGraph: BRepGraph, theStartId: unknown): BRepGraph_FullSolidRefIteratorParameters (2)
theGraphtheStartId
Instance methods(5)
BRepGraph_FullVertexRefIterator
Constructors(2)
- constructor(theGraph: BRepGraph): BRepGraph_FullVertexRefIteratorParameters (1)
theGraph
- constructor(theGraph: BRepGraph, theStartId: unknown): BRepGraph_FullVertexRefIteratorParameters (2)
theGraphtheStartId
Instance methods(5)
BRepGraph_FullWireRefIterator
Constructors(2)
- constructor(theGraph: BRepGraph): BRepGraph_FullWireRefIteratorParameters (1)
theGraph
- constructor(theGraph: BRepGraph, theStartId: unknown): BRepGraph_FullWireRefIteratorParameters (2)
theGraphtheStartId
Instance methods(5)
BRepGraph_History
Extracted history subsystem for BRepGraph.
BRepGraph_History maintains an append-only log of modification events and bidirectional lookup maps (original <-> derived) for efficient history queries. Recording can be toggled on/off at runtime.
Constructors(1)
Instance methods(10)
- Record(theOpLabel: TCollection_AsciiString, theOriginal: BRepGraph_NodeId, theReplacements: NCollection_DynamicArray_BRepGraph_NodeId): void
Record a modification: theOriginal was replaced by theReplacements.
Parameters (3)theOpLabel—human-readable operation nametheOriginal—node id before the operationtheReplacements—node ids after the operation
- Record(theRecordIdx: number): BRepGraph_HistoryRecord
Access a record by index (0-based).
Parameters (1)theRecordIdx—zero-based index into the records vector
Returnsthe history record at the given index
- RecordBatch(theOpLabel: TCollection_AsciiString, theOriginals: NCollection_DynamicArray_BRepGraph_NodeId, theReplacements: NCollection_DynamicArray_BRepGraph_NodeId, theExtraInfo?: TCollection_AsciiString): void
Record a batch of 1-to-1 modifications in a single history event. theOriginals[i] was replaced by theReplacements[i]. More efficient than calling
Record()in a loop: creates one HistoryRecord and updates the bidirectional maps with minimal overhead.Parameters (4)theOpLabel—human-readable operation nametheOriginals—node ids before the operationtheReplacements—node ids after the operation (same length)theExtraInfo—optional diagnostic info stored on the record
- FindOriginal(theModified: BRepGraph_NodeId): BRepGraph_NodeId
Walk backwards from a modified node to its original. Follows the reverse map recursively until a root is reached.
Parameters (1)theModified—node id to trace back
Returnsthe root original node id, or theModified itself if not found
- FindDerived(theOriginal: BRepGraph_NodeId): NCollection_DynamicArray_BRepGraph_NodeId
Walk forwards from an original node to all derived nodes. Follows the forward map recursively, collecting all leaves.
Parameters (1)theOriginal—node id to trace forward
Returnsall transitively derived node ids
- NbRecords(): number
Number of recorded history events.
Returnsrecord count
- SetEnabled(theVal: boolean): void
Enable or disable history recording.
Parameters (1)theVal—true to enable, false to disable
- IsEnabled(): boolean
Query whether history recording is enabled.
Returnstrue if recording is active
- Clear(): void
Clear all records and lookup maps.
- SetAllocator(theAlloc: NCollection_BaseAllocator): void
Set the allocator for internal containers. Must be called before any Record/RecordBatch calls.
Parameters (1)theAlloc—allocator to use for internal maps
BRepGraph_HistoryRecord
One atomic modification event recorded in the graph's history log.
A HistoryRecord captures what happened during a single call to BRepGraph::ApplyModification():
- OperationName identifies the algorithm ("Sewing", "FilletEdge", ...).
- SequenceNumber provides total ordering of events.
- Mapping records the topological fate of each affected node: original -> [replacement1, replacement2, ...] (split) original -> [same_node] (modified in place) original -> [] (deleted)
The history log is append-only within a graph's lifetime.
Constructors(1)
Properties(4)
BRepGraph_Layer
Abstract base class for named attribute layers.
A layer groups per-node and per-reference metadata under a unique name with lifecycle callbacks. Layers are registered on BRepGraph and automatically notified when nodes or references are removed, remapped (compact), or modified.
Derived layers store domain-specific data (names, colors, materials, etc.) in internal maps keyed by BRepGraph_NodeId or BRepGraph_RefId. The lifecycle callbacks ensure data consistency across all graph mutations.
Node Modification Events
Layers subscribe to node modification events by overriding SubscribedKinds() to return a non-zero bitmask of Kind values. When a subscribed node kind is modified, OnNodeModified() (immediate mode) or OnNodesModified() (deferred batch mode) is called. Layers with SubscribedKinds() == 0 (default) incur zero dispatch overhead.
Reference Modification Events
Layers subscribe to reference modification events by overriding SubscribedRefKinds() to return a non-zero bitmask of BRepGraph_RefId::Kind values. When a subscribed ref kind is mutated, OnRefModified() (immediate mode) or OnRefsModified() (deferred batch mode) is called. Removal is always dispatched via OnRefRemoved() regardless of subscription.
Thread safety
Callback dispatch is single-threaded (called from mutation paths). Layers that only provide read access can skip internal locking.
Static methods(4)
- KindBit(theKind: BRepGraph_NodeId_Kind): number
Convenience: return bitmask bit for a given Kind.
Parameters (1)theKind
- RefKindBit(theKind: BRepGraph_RefId_Kind): number
Convenience: return bitmask bit for a given RefId::Kind.
Parameters (1)theKind
- get_type_name(): string
Instance methods(17)
- ID(): Standard_GUID
Layer type identity (unique within a graph).
Layer identity (unique within a graph).
- OnNodeRemoved(theNode: BRepGraph_NodeId, theReplacement: BRepGraph_NodeId): void
Called when a node is soft-removed.
Parameters (2)theNode—the removed nodetheReplacement—if valid, the node that replaces theNode (e.g., sewing edge merge, deduplicate). If invalid, pure deletion. Layers should migrate data from theNode to theReplacement when valid, otherwise discard or archive removed-node data. Implementations must validate theReplacement before dereferencing graph data through it.
RemarksWarning: Layer callbacks must not throw. They are called from noexcept notification paths (MutGuard destructors, deferred invalidation flush).
- OnCompact(theRemapMap: NCollection_DataMap_BRepGraph_NodeId_BRepGraph_NodeId): void
Called after Compact with a unified old->new remap map. Layer must remap all internal NodeId references using this map. The map covers all node kinds (Vertex through CompSolid and future extensions). Nodes absent from the map were removed during compaction - layers should drop data associated with those nodes.
Parameters (1)theRemapMap—maps old NodeId to new NodeId for all surviving nodes
- InvalidateAll(): void
Mark all cached values dirty (bulk invalidation).
- Clear(): void
Clear all stored data.
- SubscribedKinds(): number
Return a bitmask of
BRepGraph_NodeId::Kindvalues this layer subscribes to. Only modification events matching subscribed kinds are dispatched. Default: 0 (no subscription - no modification events received). Override to receive OnNodeModified/OnNodesModified callbacks. The returned value must be constant for the lifetime of the layer. - OnNodeModified(theNode: BRepGraph_NodeId): void
Called in immediate (non-deferred) mode after a single node is modified. Only dispatched if the node's kind matches
SubscribedKinds(). Default: no-op.Parameters (1)theNode—the modified node
- OnNodesModified(theModifiedNodes: NCollection_DynamicArray_BRepGraph_NodeId): void
Called after EndDeferredInvalidation() with all nodes modified during the deferred scope. Only dispatched if at least one modified node's kind matches
SubscribedKinds(). The vector may contain nodes of kinds not subscribed to - layers should filter internally if needed. Default: no-op.Parameters (1)theModifiedNodes—all modified, non-removed nodes
- SubscribedRefKinds(): number
Return a bitmask of
BRepGraph_RefId::Kindvalues this layer subscribes to. Only modification events matching subscribed ref kinds are dispatched. Default: 0 (no subscription). Must be constant for the layer's lifetime. - OnRefRemoved(theRef: BRepGraph_RefId): void
Called when a reference is soft-deleted via RemoveRef(). No replacement concept - refs are simply removed (unlike nodes which can have a replacement during sewing or deduplication). Dispatched to all layers regardless of
SubscribedRefKinds(). Default: no-op.Parameters (1)theRef—the removed reference
- OnRefModified(theRef: BRepGraph_RefId): void
Called in immediate (non-deferred) mode after a single ref is mutated. Only dispatched if the ref's kind matches
SubscribedRefKinds(). Default: no-op.Parameters (1)theRef—the modified reference
- OnRefsModified(theModifiedRefs: NCollection_DynamicArray_BRepGraph_RefId, theModifiedRefKindsMask: number): void
Called after EndDeferredInvalidation() with all refs modified during the deferred scope. Only dispatched if at least one modified ref's kind matches
SubscribedRefKinds(). The vector may contain refs of kinds not subscribed to - layers should filter internally if needed. Default: no-op.Parameters (2)theModifiedRefs—all modified, non-removed refstheModifiedRefKindsMask—bitwise OR of all modified ref kinds
- Revision(): number
Monotonic revision counter incremented by
touch()on every observable state change. Consumers compare stored revisions to detect staleness in O(1). Derived layers MUST calltouch()from their mutators. Owning graph, set by the registry on RegisterLayer() and cleared on Unregister(). Nullptr before registration or after unregistration.
Mutable accessor for layers that drive graph mutations (e.g. meshing).
BRepGraph_LayerIterator
Iterator over registered layers in a BRepGraph_LayerRegistry.
Provides zero-allocation iteration with OCCT More()/Next()/Value() pattern and STL range-for via begin()/end().
Constructors(1)
- constructor(theRegistry: BRepGraph_LayerRegistry): BRepGraph_LayerIterator
Construct an iterator over all layers in the registry.
Parameters (1)theRegistry
Instance methods(6)
BRepGraph_LayerParam
Persistent vertex point-representation store: point-on-curve, point-on-surface, and point-on-PCurve parameters per vertex.
Mirrors classical BRep_PointRepresentation entries on TVertex: each vertex may carry parameters identifying its location on incident edges, faces, or coedges (PCurves). The layer is the single source of truth for these parameters in BRepGraph.
Lifetime policy
The layer is persistent metadata: stored values survive arbitrary mutations to the referenced vertices, edges, faces, and coedges. Only the following events discard data:
- OnNodeRemoved - the referenced node is gone; entries naming it are dropped (or migrated when a replacement is provided).
- OnCompact - ids are remapped; entries pointing to removed nodes drop.
InvalidateAll()/Clear()- explicit caller request. The layer does NOT subscribe to OnNodeModified: a tolerance bump, parameter range adjustment, or NaturalRestriction toggle on a referenced node leaves point-representation data intact. Callers that change geometry are responsible for refreshing affected entries.
Constructors(1)
Static methods(3)
Return fixed layer type GUID.
- get_type_name(): string
Instance methods(18)
- ID(): Standard_GUID
Return this layer type GUID.
- Parameters (1)
theVertex
- FindPointOnCurve(theVertex: BRepGraph_VertexId, theEdge: BRepGraph_EdgeId, theParameter?: number): booleanParameters (3)
theVertextheEdgetheParameter
- FindPointOnSurface(theVertex: BRepGraph_VertexId, theFace: BRepGraph_FaceId, theUV?: gp_Pnt2d): booleanParameters (3)
theVertextheFacetheUV
- FindPointOnPCurve(theVertex: BRepGraph_VertexId, theCoEdge: BRepGraph_CoEdgeId, theParameter?: number): booleanParameters (3)
theVertextheCoEdgetheParameter
- NbPointsOnCurve(theVertex: BRepGraph_VertexId): numberParameters (1)
theVertex
- NbPointsOnSurface(theVertex: BRepGraph_VertexId): numberParameters (1)
theVertex
- NbPointsOnPCurve(theVertex: BRepGraph_VertexId): numberParameters (1)
theVertex
- HasBindings(): boolean
- SetPointOnCurve(theVertex: BRepGraph_VertexId, theEdge: BRepGraph_EdgeId, theParameter: number): voidParameters (3)
theVertextheEdgetheParameter
- SetPointOnSurface(theVertex: BRepGraph_VertexId, theFace: BRepGraph_FaceId, theParameterU: number, theParameterV: number): voidParameters (4)
theVertextheFacetheParameterUtheParameterV
- SetPointOnPCurve(theVertex: BRepGraph_VertexId, theCoEdge: BRepGraph_CoEdgeId, theParameter: number): voidParameters (3)
theVertextheCoEdgetheParameter
Layer identity (unique within a graph).
- OnNodeRemoved(theNode: BRepGraph_NodeId, theReplacement: BRepGraph_NodeId): void
Called when a node is soft-removed.
Parameters (2)theNode—the removed nodetheReplacement—if valid, the node that replaces theNode (e.g., sewing edge merge, deduplicate). If invalid, pure deletion. Layers should migrate data from theNode to theReplacement when valid, otherwise discard or archive removed-node data. Implementations must validate theReplacement before dereferencing graph data through it.
RemarksWarning: Layer callbacks must not throw. They are called from noexcept notification paths (MutGuard destructors, deferred invalidation flush).
- OnCompact(theRemapMap: NCollection_DataMap_BRepGraph_NodeId_BRepGraph_NodeId): void
Called after Compact with a unified old->new remap map. Layer must remap all internal NodeId references using this map. The map covers all node kinds (Vertex through CompSolid and future extensions). Nodes absent from the map were removed during compaction - layers should drop data associated with those nodes.
Parameters (1)theRemapMap—maps old NodeId to new NodeId for all surviving nodes
- InvalidateAll(): void
Mark all cached values dirty (bulk invalidation).
- Clear(): void
Clear all stored data.
BRepGraph_LayerParam_VertexParams
Constructors(1)
Instance methods(1)
- IsEmpty(): boolean
Properties(3)
BRepGraph_LayerRegistry
Dense GUID-keyed runtime registry of graph layers.
Stores registered layers in a compact vector for O(1) slot access and a GUID-to-slot map for O(1) lookup by stable public identity.
Constructors(1)
Instance methods(21)
- SetOwningGraph(theGraph: BRepGraph): void
Bind the owning graph. Propagates to every registered layer.
Parameters (1)theGraph
Owning graph bound via
SetOwningGraph(), or nullptr.- RegisterLayer(theLayer: BRepGraph_Layer): number
Register a layer. Replaces an existing layer with the same GUID.
Parameters (1)theLayer
Returnsslot index in the internal dense vector, or -1 for null input.
- UnregisterLayer(theGUID: Standard_GUID): void
Remove a layer by GUID.
Parameters (1)theGUID
- FindLayer(theGUID: Standard_GUID): BRepGraph_Layer
Find a layer by GUID. Returns null handle if not found.
Parameters (1)theGUID
- FindSlot(theGUID: Standard_GUID): number
Return current slot for a GUID, or -1 if not registered.
Parameters (1)theGUID
- Layer(theSlot: number): BRepGraph_Layer
Return layer by slot index.
Parameters (1)theSlot
- NbLayers(): number
Number of registered layers.
- HasModificationSubscribers(): boolean
True if any registered layer subscribes to node modification events.
- SubscribedKindsMask(): number
Bitwise OR of all registered layer node subscription masks.
- DispatchOnNodeRemoved(theNode: BRepGraph_NodeId, theReplacement: BRepGraph_NodeId): void
Dispatch OnNodeRemoved to all registered layers.
Parameters (2)theNodetheReplacement
- DispatchNodeModified(theNode: BRepGraph_NodeId): void
Dispatch OnNodeModified to subscribed layers.
Parameters (1)theNode
- DispatchNodesModified(theModifiedNodes: NCollection_DynamicArray_BRepGraph_NodeId, theModifiedKindsMask: number): void
Dispatch OnNodesModified to subscribed layers.
Parameters (2)theModifiedNodestheModifiedKindsMask
- DispatchOnCompact(theRemapMap: NCollection_DataMap_BRepGraph_NodeId_BRepGraph_NodeId): void
Dispatch OnCompact to all registered layers.
Parameters (1)theRemapMap
- HasRefModificationSubscribers(): boolean
True if any registered layer subscribes to reference modification events.
- SubscribedRefKindsMask(): number
Bitwise OR of all registered layer reference subscription masks.
- DispatchOnRefRemoved(theRef: BRepGraph_RefId): void
Dispatch OnRefRemoved to all registered layers (unconditional - not filtered).
Parameters (1)theRef
- DispatchRefModified(theRef: BRepGraph_RefId): void
Dispatch OnRefModified to subscribed layers (immediate mode).
Parameters (1)theRef
- DispatchRefsModified(theModifiedRefs: NCollection_DynamicArray_BRepGraph_RefId, theModifiedRefKindsMask: number): void
Dispatch OnRefsModified to subscribed layers (deferred/batch mode).
Parameters (2)theModifiedRefstheModifiedRefKindsMask
- ClearAll(): void
Clear all registered layer payloads without unregistering them.
- InvalidateAll(): void
Invalidate all registered layer payloads.
BRepGraph_LayerRegularity
Persistent edge-continuity store, keyed by (edge, F1, F2).
Each entry holds the geometric continuity (C^k / G^k) across the face pair at a given edge. F1 == F2 represents seam continuity across a closed surface's seam line; F1 != F2 represents inter-face regularity. The schema mirrors classical BRep_Tool::Continuity(edge, F1, F2).
Lifetime policy
The layer is persistent metadata: stored values survive arbitrary mutations to the referenced edges and faces. Only the following events discard data:
- OnNodeRemoved(edge|face) - the referenced node is gone; entries naming it are dropped (or migrated when a replacement is provided).
- OnCompact - ids are remapped; entries pointing to removed nodes drop.
InvalidateAll()/Clear()- explicit caller request. In particular, this layer does NOT subscribe to OnNodeModified: a tolerance bump or NaturalRestriction toggle leaves stored continuity intact. Callers that change the underlying geometry are responsible for refreshing affected entries (typically via SetRegularity, removeRegularity, or InvalidateAll).
Constructors(1)
Static methods(3)
Return fixed layer type GUID.
- get_type_name(): string
Instance methods(15)
- ID(): Standard_GUID
Return this layer type GUID.
- Parameters (1)
theEdge
- FindContinuity(theEdge: BRepGraph_EdgeId, theFace1: BRepGraph_FaceId, theFace2: BRepGraph_FaceId, theContinuity?: GeomAbs_Shape): booleanParameters (4)
theEdgetheFace1theFace2theContinuity
- NbRegularities(theEdge: BRepGraph_EdgeId): numberParameters (1)
theEdge
- MaxContinuity(theEdge: BRepGraph_EdgeId): GeomAbs_ShapeParameters (1)
theEdge
- HasBindings(): boolean
- SetRegularity(theEdge: BRepGraph_EdgeId, theFace1: BRepGraph_FaceId, theFace2: BRepGraph_FaceId, theContinuity: GeomAbs_Shape): voidParameters (4)
theEdgetheFace1theFace2theContinuity
- CopyRegularities(theSourceEdge: BRepGraph_EdgeId, theTargetEdge: BRepGraph_EdgeId): void
Copy all regularity entries from one edge to another.
Parameters (2)theSourceEdgetheTargetEdge
- RemoveRegularities(theEdge: BRepGraph_EdgeId): void
Remove all regularity entries bound to the edge.
Parameters (1)theEdge
Layer identity (unique within a graph).
- OnNodeRemoved(theNode: BRepGraph_NodeId, theReplacement: BRepGraph_NodeId): void
Called when a node is soft-removed.
Parameters (2)theNode—the removed nodetheReplacement—if valid, the node that replaces theNode (e.g., sewing edge merge, deduplicate). If invalid, pure deletion. Layers should migrate data from theNode to theReplacement when valid, otherwise discard or archive removed-node data. Implementations must validate theReplacement before dereferencing graph data through it.
RemarksWarning: Layer callbacks must not throw. They are called from noexcept notification paths (MutGuard destructors, deferred invalidation flush).
- OnCompact(theRemapMap: NCollection_DataMap_BRepGraph_NodeId_BRepGraph_NodeId): void
Called after Compact with a unified old->new remap map. Layer must remap all internal NodeId references using this map. The map covers all node kinds (Vertex through CompSolid and future extensions). Nodes absent from the map were removed during compaction - layers should drop data associated with those nodes.
Parameters (1)theRemapMap—maps old NodeId to new NodeId for all surviving nodes
- InvalidateAll(): void
Mark all cached values dirty (bulk invalidation).
- Clear(): void
Clear all stored data.
BRepGraph_LayerRegularity_EdgeRegularities
Constructors(1)
Instance methods(1)
- IsEmpty(): boolean
Properties(1)
BRepGraph_MeshCache_CoEdgeMeshEntry
Constructors(1)
Instance methods(2)
Properties(3)
BRepGraph_MeshCache_EdgeMeshEntry
Constructors(1)
Instance methods(2)
Properties(2)
BRepGraph_MeshCache_FaceMeshEntry
Constructors(1)
Instance methods(3)
Properties(3)
BRepGraph_MeshCacheStorage
Storage backend for cached mesh data.
Dense vectors indexed by per-kind entity index (same pattern as DefStore). Entries with StoredOwnGen == 0 are absent (no cached mesh data). Thread safety: parallel writes to different indices are safe (no contention).
Constructors(1)
Instance methods(14)
- HasFaceMesh(theFace: BRepGraph_FaceId): boolean
Check if a face has a cached mesh entry (StoredOwnGen != 0).
Parameters (1)theFace
Find face mesh entry, or nullptr if absent.
Parameters (1)theFace
Get or create a face mesh entry. Creates with default values if absent.
Parameters (1)theFace
- ClearFaceMesh(theFace: BRepGraph_FaceId): void
Clear the face mesh entry (reset to absent).
Parameters (1)theFace
- HasCoEdgeMesh(theCoEdge: BRepGraph_CoEdgeId): boolean
Check if a coedge has a cached mesh entry.
Parameters (1)theCoEdge
Find coedge mesh entry, or nullptr if absent.
Parameters (1)theCoEdge
Get or create a coedge mesh entry.
Parameters (1)theCoEdge
- ClearCoEdgeMesh(theCoEdge: BRepGraph_CoEdgeId): void
Clear the coedge mesh entry.
Parameters (1)theCoEdge
- HasEdgeMesh(theEdge: BRepGraph_EdgeId): boolean
Check if an edge has a cached mesh entry.
Parameters (1)theEdge
Find edge mesh entry, or nullptr if absent.
Parameters (1)theEdge
Get or create an edge mesh entry.
Parameters (1)theEdge
- ClearEdgeMesh(theEdge: BRepGraph_EdgeId): void
Clear the edge mesh entry.
Parameters (1)theEdge
- Clear(): void
Clear all cached mesh data.
- OnCompact(theNodeRemapMap: NCollection_DataMap_BRepGraph_NodeId_BRepGraph_NodeId): void
Remap cache entries after compaction.
Parameters (1)theNodeRemapMap—old NodeId -> new NodeId mapping
BRepGraph_MeshView
Instance methods(4)
BRepGraph_MeshView_CoEdgeOps
Instance methods(2)
- HasMesh(theCoEdge: BRepGraph_CoEdgeId): booleanParameters (1)
theCoEdge
- Parameters (1)
theCoEdge
BRepGraph_MeshView_EdgeOps
Instance methods(3)
- HasPolygon3D(theEdge: BRepGraph_EdgeId): booleanParameters (1)
theEdge
- Parameters (1)
theEdge
- Parameters (1)
theEdge
BRepGraph_MeshView_FaceOps
Instance methods(3)
- HasTriangulation(theFace: BRepGraph_FaceId): booleanParameters (1)
theFace
- Parameters (1)
theFace
- Parameters (1)
theFace
BRepGraph_MeshView_PolyOps
Instance methods(12)
- NbTriangulations(): number
- NbPolygons3D(): number
- NbPolygons2D(): number
- NbPolygonsOnTri(): number
- NbActiveTriangulations(): number
- NbActivePolygons3D(): number
- NbActivePolygons2D(): number
- NbActivePolygonsOnTri(): number
- Parameters (1)
theRep
- Parameters (1)
theRep
- Parameters (1)
theRep
- Parameters (1)
theRep
BRepGraph_NodeId
Lightweight typed index into a per-kind node vector inside BRepGraph.
The pair (NodeKind, Index) forms a unique node identifier within one graph instance. Default-constructed NodeId has Index = UINT32_MAX (invalid).
NodeId is a value type: cheap to copy, compare, hash. It carries no pointer back to the owning graph; the caller is responsible for using it with the correct BRepGraph instance.
Constructors(2)
Default: invalid NodeId (Index = UINT32_MAX). NodeKind is set to
Kind::Solidbut is meaningless when !IsValid().- constructor(theKind: BRepGraph_NodeId_Kind, theIdx: number): BRepGraph_NodeIdParameters (2)
theKindtheIdx
Static methods(4)
- IsTopologyKind(theKind: BRepGraph_NodeId_Kind): boolean
True if the kind is a core topology kind (Solid..CoEdge).
Parameters (1)theKind
- IsAssemblyKind(theKind: BRepGraph_NodeId_Kind): boolean
True if the kind is an assembly kind (Product or Occurrence).
Parameters (1)theKind
- Start(theKind: BRepGraph_NodeId_Kind): BRepGraph_NodeId
First valid id in a dense sequence for the specified kind.
Parameters (1)theKind
- Invalid(theKind?: BRepGraph_NodeId_Kind): BRepGraph_NodeId
Invalid sentinel id for the specified kind.
Parameters (1)theKind
Instance methods(2)
Properties(2)
BRepGraph_OccurrenceId
Constructors(3)
- constructor(theIdx: number): BRepGraph_OccurrenceIdParameters (1)
theIdx
- Parameters (1)
theId
Static methods(3)
- Start(): BRepGraph_NodeId_Typed
- Invalid(): BRepGraph_NodeId_Typed
- FromNodeId(theId: BRepGraph_NodeId): BRepGraph_NodeId_TypedParameters (1)
theId
Instance methods(2)
Properties(1)
BRepGraph_OccurrenceRefId
Constructors(3)
- constructor(theIdx: number): BRepGraph_OccurrenceRefIdParameters (1)
theIdx
- constructor(theRefId: BRepGraph_RefId): BRepGraph_OccurrenceRefIdParameters (1)
theRefId
Static methods(3)
- Start(): BRepGraph_RefId_Typed
- Invalid(): BRepGraph_RefId_Typed
- FromRefId(theRefId: BRepGraph_RefId): BRepGraph_RefId_TypedParameters (1)
theRefId
Instance methods(2)
Properties(1)
BRepGraph_OccurrencesOfProduct
Constructors(2)
- constructor(theGraph: BRepGraph, theParents: any): BRepGraph_OccurrencesOfProductParameters (2)
theGraphtheParents
- constructor(theGraph: BRepGraph, theParents: any, theStartIndex: number): BRepGraph_OccurrencesOfProductParameters (3)
theGraphtheParentstheStartIndex
Instance methods(10)
- More(): boolean
- Next(): void
- Definition(): unknown
- Index(): number
- Length(): number
- Size(): number
- Value(theIndex: number): BRepGraph_OccurrenceIdParameters (1)
theIndex
BRepGraph_ParallelPolicy
Lightweight workload-aware policy for deciding whether an internal phase should actually launch parallel work when parallel mode is allowed.
The goal is to avoid forcing every short-lived loop onto the thread pool. Decisions are based on available worker capacity and on the amount of work already visible to the phase, instead of on buried per-loop split sizes.
Constructors(1)
Static methods(4)
- WorkerCount(): number
Return the effective logical worker count reported by
OSD_Parallel. - IsParallelAllowed(theAllowParallel: boolean): boolean
Check whether parallel execution is allowed and meaningful at all.
Parameters (1)theAllowParallel
- ShouldRun(theAllowParallel: boolean, theWorkers: number, theWorkload: BRepGraph_ParallelPolicy_Workload): boolean
Decide whether the estimated workload is large enough to amortize thread-pool launch and synchronization overhead.
Parameters (3)theAllowParalleltheWorkerstheWorkload
- ShouldRun(theAllowParallel: boolean, theWorkload: BRepGraph_ParallelPolicy_Workload): boolean
Overload that queries the active worker count lazily.
Parameters (2)theAllowParalleltheWorkload
BRepGraph_ParentExplorer
Upward occurrence-aware parent traversal for BRepGraph.
Enumerates all ancestor nodes reachable from a starting node. Traversal is path-aware: when the same definition is reached through multiple occurrence paths, each path contributes its own parent sequence with its own accumulated location and orientation.
The traversal follows the actual graph structure transparently - every node kind is visited as a distinct entity (no hidden collapses): Vertex -> Edge, Edge -> CoEdge, CoEdge -> Wire, Wire -> Face, Face -> Shell, Shell -> Solid, Solid -> CompSolid/Compound, Product -> Occurrence, Occurrence -> Product (parent assembly).
Traversal modes
- Recursive: walks the full ancestor chain to the graph roots. Without target kind, all ancestors are emitted. With target kind, only matching ancestors are emitted but intermediate levels are traversed to reach them.
- DirectParents: yields only the immediate parents of the starting node. No ascent into grandparents. With target kind, only parents matching the kind are returned.
Constructors(7)
- constructor(theGraph: BRepGraph, theNode: BRepGraph_NodeId): BRepGraph_ParentExplorer
Explore all parents of the starting node.
Parameters (2)theGraphtheNode
- constructor(theGraph: BRepGraph, theNode: BRepGraph_NodeId, theConfig: BRepGraph_ParentExplorer_Config): BRepGraph_ParentExplorer
Preferred long-term constructor: all tuning knobs in
Config.Parameters (3)theGraph—graph to walktheNode—starting node whose ancestors are exploredtheConfig—traversal configuration
- constructor(theGraph: BRepGraph, theNode: BRepGraph_NodeId, theMode: BRepGraph_ParentExplorer_TraversalMode): BRepGraph_ParentExplorer
Preferred long-term constructor: all tuning knobs in
Config.Parameters (3)theGraph—graph to walktheNode—starting node whose ancestors are exploredtheMode
- constructor(theGraph: BRepGraph, theNode: BRepGraph_NodeId, theTargetKind: BRepGraph_NodeId_Kind): BRepGraph_ParentExplorer
Preferred long-term constructor: all tuning knobs in
Config.Parameters (3)theGraph—graph to walktheNode—starting node whose ancestors are exploredtheTargetKind
- constructor(theGraph: BRepGraph, theNode: BRepGraph_NodeId, theTargetKind: BRepGraph_NodeId_Kind, theMode: BRepGraph_ParentExplorer_TraversalMode): BRepGraph_ParentExplorer
Explore only parents of the given kind using the given traversal mode.
Parameters (4)theGraphtheNodetheTargetKindtheMode
- constructor(theGraph: BRepGraph, theNode: BRepGraph_NodeId, theAvoidKind: BRepGraph_NodeId_Kind | null | undefined, theEmitAvoidKind: boolean, theMode?: BRepGraph_ParentExplorer_TraversalMode): BRepGraph_ParentExplorer
Explore all parents while pruning branches at the avoid kind.
Parameters (5)theGraphtheNodetheAvoidKindtheEmitAvoidKindtheMode
- constructor(theGraph: BRepGraph, theNode: BRepGraph_NodeId, theTargetKind: BRepGraph_NodeId_Kind, theAvoidKind: BRepGraph_NodeId_Kind | null | undefined, theEmitAvoidKind: boolean, theMode?: BRepGraph_ParentExplorer_TraversalMode): BRepGraph_ParentExplorer
Explore parents of the given kind while pruning branches at the avoid kind.
Parameters (6)theGraphtheNodetheTargetKindtheAvoidKindtheEmitAvoidKindtheMode
Instance methods(11)
- GetConfig(): BRepGraph_ParentExplorer_Config
Returns the traversal configuration this explorer was constructed with. Read-only - configuration is fixed for the lifetime of the explorer.
- More(): boolean
True if another matching parent is available.
- Next(): void
Advance to the next matching parent.
- Current(): any
Current matching ancestor node with accumulated location and orientation.
Returns the immediate child of
Current()on the currently emitted branch. Returns invalid NodeId when no current ancestor is available.- CurrentLinkKind(): BRepGraph_ParentExplorer_LinkKind
Returns how
Current()is linked toCurrentChild(). Returns the exact parent-owned RefId linking
Current()toCurrentChild(), when that branch step is represented by a reference entry.
Some upward steps are structural and therefore have no parent-owned ref entry even though the parent itself is still emitted by the explorer. In those cases this method returns an invalid RefId, for example for CoEdge->Edge, Product(part)->ShapeRoot and Occurrence->Product.Accumulated location at the starting node of the current branch.
Accumulated orientation at the starting node of the current branch.
- IsCurrentBranchRoot(): boolean
True if
Current()is the explicit root node of the current branch. Returns a sentinel marking the end of iteration.
BRepGraph_Polygon2DRepId
Constructors(3)
- constructor(theIdx: number): BRepGraph_Polygon2DRepIdParameters (1)
theIdx
- Parameters (1)
theId
Static methods(3)
- Start(): BRepGraph_RepId_Typed
- Invalid(): BRepGraph_RepId_Typed
- FromRepId(theId: BRepGraph_RepId): BRepGraph_RepId_TypedParameters (1)
theId
Instance methods(2)
Properties(1)
BRepGraph_Polygon3DRepId
Constructors(3)
- constructor(theIdx: number): BRepGraph_Polygon3DRepIdParameters (1)
theIdx
- Parameters (1)
theId
Static methods(3)
- Start(): BRepGraph_RepId_Typed
- Invalid(): BRepGraph_RepId_Typed
- FromRepId(theId: BRepGraph_RepId): BRepGraph_RepId_TypedParameters (1)
theId
Instance methods(2)
Properties(1)
BRepGraph_PolygonOnTriRepId
Constructors(3)
- constructor(theIdx: number): BRepGraph_PolygonOnTriRepIdParameters (1)
theIdx
- Parameters (1)
theId
Static methods(3)
- Start(): BRepGraph_RepId_Typed
- Invalid(): BRepGraph_RepId_Typed
- FromRepId(theId: BRepGraph_RepId): BRepGraph_RepId_TypedParameters (1)
theId
Instance methods(2)
Properties(1)
BRepGraph_ProductId
Constructors(3)
- constructor(theIdx: number): BRepGraph_ProductIdParameters (1)
theIdx
- Parameters (1)
theId
Static methods(3)
- Start(): BRepGraph_NodeId_Typed
- Invalid(): BRepGraph_NodeId_Typed
- FromNodeId(theId: BRepGraph_NodeId): BRepGraph_NodeId_TypedParameters (1)
theId
Instance methods(2)
Properties(1)
BRepGraph_RefId
Lightweight typed index into a per-kind reference vector inside BRepGraph.
The pair (Kind, Index) forms a unique reference identifier within one graph instance. Default-constructed RefId has Index = UINT32_MAX (invalid).
Constructors(2)
- constructor(theKind: BRepGraph_RefId_Kind, theIdx: number): BRepGraph_RefIdParameters (2)
theKindtheIdx
Static methods(3)
- IsTopologyRefKind(theKind: BRepGraph_RefId_Kind): booleanParameters (1)
theKind
- Start(theKind: BRepGraph_RefId_Kind): BRepGraph_RefId
First valid id in a dense sequence for the specified kind.
Parameters (1)theKind
- Invalid(theKind?: BRepGraph_RefId_Kind): BRepGraph_RefId
Invalid sentinel id for the specified kind.
Parameters (1)theKind
Instance methods(2)
Properties(2)
BRepGraph_RefsChildOfCompound
Constructors(1)
- constructor(theGraph: BRepGraph, theParent: unknown): BRepGraph_RefsChildOfCompoundParameters (2)
theGraphtheParent
Instance methods(5)
BRepGraph_RefsChildOfShell
Constructors(1)
- constructor(theGraph: BRepGraph, theParent: unknown): BRepGraph_RefsChildOfShellParameters (2)
theGraphtheParent
Instance methods(5)
BRepGraph_RefsChildOfSolid
Constructors(1)
- constructor(theGraph: BRepGraph, theParent: unknown): BRepGraph_RefsChildOfSolidParameters (2)
theGraphtheParent
Instance methods(5)
BRepGraph_RefsCoEdgeOfWire
Constructors(1)
- constructor(theGraph: BRepGraph, theParent: unknown): BRepGraph_RefsCoEdgeOfWireParameters (2)
theGraphtheParent
Instance methods(5)
BRepGraph_RefsCompoundsOfChild
Constructors(1)
- constructor(theGraph: BRepGraph, theParents: any, theChild: unknown): BRepGraph_RefsCompoundsOfChildParameters (3)
theGraphtheParentstheChild
Instance methods(7)
- More(): boolean
- Next(): void
- Current(): any
- CurrentParentId(): unknown
- CurrentRefId(): unknown
- Index(): number
BRepGraph_RefsCompSolidsOfSolid
Constructors(1)
- constructor(theGraph: BRepGraph, theParents: any, theChild: unknown): BRepGraph_RefsCompSolidsOfSolidParameters (3)
theGraphtheParentstheChild
Instance methods(7)
- More(): boolean
- Next(): void
- Current(): any
- CurrentParentId(): unknown
- CurrentRefId(): unknown
- Index(): number
BRepGraph_RefsEdgesOfVertex
Constructors(1)
- constructor(theGraph: BRepGraph, theParents: any, theChild: unknown): BRepGraph_RefsEdgesOfVertexParameters (3)
theGraphtheParentstheChild
Instance methods(7)
- More(): boolean
- Next(): void
- Current(): any
- CurrentParentId(): unknown
- CurrentRefId(): unknown
- Index(): number
BRepGraph_RefsFaceOfShell
Constructors(1)
- constructor(theGraph: BRepGraph, theParent: unknown): BRepGraph_RefsFaceOfShellParameters (2)
theGraphtheParent
Instance methods(5)
BRepGraph_RefsFacesOfWire
Constructors(1)
- constructor(theGraph: BRepGraph, theParents: any, theChild: unknown): BRepGraph_RefsFacesOfWireParameters (3)
theGraphtheParentstheChild
Instance methods(7)
- More(): boolean
- Next(): void
- Current(): any
- CurrentParentId(): unknown
- CurrentRefId(): unknown
- Index(): number
BRepGraph_RefsIterator_ChildOfCompoundTraits
Constructors(1)
Static methods(4)
- IsParentValid(theGraph: BRepGraph, theParent: BRepGraph_CompoundId): booleanParameters (2)
theGraphtheParent
- RefIds(theGraph: BRepGraph, theParent: BRepGraph_CompoundId): anyParameters (2)
theGraphtheParent
- Ref(theGraph: BRepGraph, theRefId: BRepGraph_ChildRefId): BRepGraphInc_ChildRefParameters (2)
theGraphtheRefId
- ChildIdOf(argNo0: BRepGraph, theRef: BRepGraphInc_ChildRef): BRepGraph_NodeIdParameters (2)
argNo0theRef
BRepGraph_RefsIterator_ChildOfShellTraits
Constructors(1)
Static methods(4)
- IsParentValid(theGraph: BRepGraph, theParent: BRepGraph_ShellId): booleanParameters (2)
theGraphtheParent
- RefIds(theGraph: BRepGraph, theParent: BRepGraph_ShellId): anyParameters (2)
theGraphtheParent
- Ref(theGraph: BRepGraph, theRefId: BRepGraph_ChildRefId): BRepGraphInc_ChildRefParameters (2)
theGraphtheRefId
- ChildIdOf(argNo0: BRepGraph, theRef: BRepGraphInc_ChildRef): BRepGraph_NodeIdParameters (2)
argNo0theRef
BRepGraph_RefsIterator_ChildOfSolidTraits
Constructors(1)
Static methods(4)
- IsParentValid(theGraph: BRepGraph, theParent: BRepGraph_SolidId): booleanParameters (2)
theGraphtheParent
- RefIds(theGraph: BRepGraph, theParent: BRepGraph_SolidId): anyParameters (2)
theGraphtheParent
- Ref(theGraph: BRepGraph, theRefId: BRepGraph_ChildRefId): BRepGraphInc_ChildRefParameters (2)
theGraphtheRefId
- ChildIdOf(argNo0: BRepGraph, theRef: BRepGraphInc_ChildRef): BRepGraph_NodeIdParameters (2)
argNo0theRef