BRepGraph
OCCT package BRepGraph: BRepGraph, BRepGraph_Cache, BRepGraph_CacheDerivedState, BRepGraph_CacheIterator, and 179 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, relation-table parent navigation, 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:
Shapes().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.Shapes().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(persistent metadata / observers) orBRepGraph_CacheRegistry(typed algorithm-computed transient cache services). 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 owner-scoped geometry/mesh representation slots (Surface, Curve3D, Curve2D, Triangulation, Polygon).
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, coedges 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 relation tables 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.
Constructors(1)
Default constructor. Creates an empty graph with default allocator.
Instance methods(15)
- Clear(): void
Reset the graph to an empty state. Increments generation and regenerates the graph GUID.
- IsEmpty(): boolean
Return true when the graph contains no topology definitions.
- ValidateRelations(): boolean
Verify relation consistency against entity / reference-entry tables. Intended for debug builds and regression tests of incremental mutation paths.
Returnstrue when every stored relation matches its endpoints.
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.
Return the current allocator.
- IsValid(): boolean
Return true when this wrapper references graph data.
- IsNull(): boolean
Return true when this wrapper does not reference graph data.
Access topology definitions, representation access, adjacency queries, raw Product/Occurrence definition storage, and assembly classification.
Access unique identifiers.
Access reference entries and their UIDs.
Access cached and fresh shape reconstruction.
Access programmatic graph construction and mutation.
Access mesh data with explicit Cache()/Persistent() sub-views and
Editor()for cache mutations. Persistent rep creation lives onEditor().Edges(),Editor().CoEdges(),Editor().Faces() (since reps back the topology defs).Returnsread-only mesh view
Access registered graph layers.
Returnslayer registry for managing attribute layers
Access registered graph cache services.
Returnscache registry for managing typed transient cache services
BRepGraph_Cache
Lightweight owner-bound base for transient graph cache services.
A cache service stores typed, recomputable, graph-local data such as bounding boxes, UV bounds, or display-resolution results. The registry owns only service identity and lifetime binding; concrete caches own their own typed storage and validate freshness lazily via graph generation counters.
Static methods(2)
- get_type_name(): string
Instance methods(5)
- ID(): Standard_GUID
Cache service identity, unique within a graph registry.
Cache service display name.
- Clear(): void
Clear all transient data owned by this cache.
- CopyFreshTo(theCopy: BRepGraph_CopyRemap): void
Copy fresh, remappable cache data into the target graph described by the remap. Default implementation copies nothing.
Parameters (1)theCopy
BRepGraph_CacheDerivedState
Cache for derived edge, wire, and shell properties.
Each query is independent and caches only its own result. Callers request specific values (IsDegenerated, SameParameter, etc.) and the cache computes + stores only what is needed.
Constructors(1)
Static methods(6)
Returns the unique cache service GUID.
- ComputeEdgeProperties(theGraph: BRepGraph, theEdge: BRepGraph_EdgeId, theIsDegenerated?: boolean, theIsClosed?: boolean): { returnValue: boolean; theIsDegenerated: boolean; theIsClosed: boolean }
Compute edge-own derived state (Status, IsClosed). SameRange/SameParameter are per-CoEdge - use the per-CoEdge cache directly.
Parameters (4)theGraph—source graphtheEdge—edge definition identifiertheIsDegenerated—true if edge is degeneratetheIsClosed—true if edge is closed
ReturnsA result object with fields:
returnValue: true if computation succeededtheIsDegenerated: true if edge is degeneratetheIsClosed: true if edge is closed
- ComputeShellIsClosed(theGraph: BRepGraph, theShell: BRepGraph_ShellId): boolean
Compute shell closure directly from a
BRepGraphwithout caching.Parameters (2)theGraph—source graphtheShell—shell definition identifier
Returnstrue if the shell is closed
- ComputeWireIsClosed(theGraph: BRepGraph, theWire: BRepGraph_WireId): boolean
Compute wire closure directly from a
BRepGraphwithout caching.Parameters (2)theGraph—source graphtheWire—wire definition identifier
Returnstrue if the wire is closed
- get_type_name(): string
Instance methods(12)
- ID(): Standard_GUID
Returns the unique cache service GUID.
Returns the cache service display name.
- Clear(): void
Clears all cached entries.
- CopyFreshTo(theCopy: BRepGraph_CopyRemap): void
Copy fresh, remappable derived-state entries into the target graph.
Parameters (1)theCopy
- IsDegenerated(theEdge: BRepGraph_EdgeId): boolean
Test if an edge is degenerate (no 3D curve and vertex collapse). Computes and caches only Status - does NOT compute SameParameter/SameRange.
Parameters (1)theEdge—edge definition identifier
Returnstrue if the edge is degenerate
- SameParameter(theCoEdge: BRepGraph_CoEdgeId): boolean
Test if a single coedge has SameParameter.
Parameters (1)theCoEdge—coedge definition identifier
Returnstrue if the coedge has SameParameter
- SameRange(theCoEdge: BRepGraph_CoEdgeId): boolean
Test if a single coedge has SameRange.
Parameters (1)theCoEdge—coedge definition identifier
Returnstrue if the coedge has SameRange
- IsClosed(theEdge: BRepGraph_EdgeId): boolean
Test if an edge is closed (start vertex == end vertex). Computes and caches only IsClosed.
Parameters (1)theEdge—edge definition identifier
Returnstrue if the edge is closed
- GetWireIsClosed(theWire: BRepGraph_WireId, theClosed?: boolean): { returnValue: boolean; theClosed: boolean }
Return wire closure, computing and storing a fresh entry.
Parameters (2)theWire—wire definition identifiertheClosed—filled with the fresh derived value
ReturnsA result object with fields:
returnValue: true if computation succeededtheClosed: filled with the fresh derived value
- SetWireIsClosed(theWire: BRepGraph_WireId, theClosed: boolean): void
Store a pre-computed wire closure value.
Parameters (2)theWire—wire definition identifiertheClosed—pre-computed closure value
- IsShellClosed(theShell: BRepGraph_ShellId): boolean
Test if a shell is closed.
Parameters (1)theShell—shell definition identifier
Returnstrue if the shell is closed
BRepGraph_CacheIterator
Iterator over registered cache families in a BRepGraph_CacheRegistry.
Supports OCCT More()/Next()/Value() pattern and STL range-for via begin()/end().
Constructors(1)
- constructor(theRegistry: BRepGraph_CacheRegistry): BRepGraph_CacheIterator
Construct an iterator over all cache families in the registry.
Parameters (1)theRegistry
Instance methods(6)
BRepGraph_CacheMesh_CoEdgeMeshEntry
Constructors(1)
Instance methods(2)
Properties(7)
BRepGraph_CacheMesh_DirtySet
Constructors(1)
Instance methods(2)
Properties(2)
BRepGraph_CacheMesh_Driver
Static methods(2)
- get_type_name(): string
Instance methods(4)
- ID(): Standard_GUID
- RecipeHash(): number
- Fill(theGraph: BRepGraph, theSlot: number, theDirtySet: BRepGraph_CacheMesh_DirtySet, theRange: Message_ProgressRange): booleanParameters (4)
theGraphtheSlottheDirtySettheRange
BRepGraph_CacheMesh_EdgeMeshEntry
Constructors(1)
Instance methods(2)
Properties(2)
BRepGraph_CacheMesh_EntryStamp
Constructors(1)
Instance methods(1)
- Reset(): void
Properties(2)
BRepGraph_CacheMesh_FaceMeshEntry
Constructors(1)
Instance methods(3)
- IsPresent(): boolean
- ClearRepresentation(): void
- Reset(): void
Properties(3)
BRepGraph_CacheRegistry
GUID-keyed runtime registry of graph cache services.
Stores registered cache services in a stable slot array for O(1) slot access and a GUID-to-slot map for lookup by stable public identity. Cache services own their typed transient data; this registry only manages identity and owner binding.
Constructors(1)
Instance methods(12)
- RegisterCache(theCache: BRepGraph_Cache): number
Register a cache service. Replaces an existing cache with the same GUID.
Parameters (1)theCache—cache service
Returnsgraph-local slot index
- Register(theCache: BRepGraph_Cache): number
Register a cache service. Short form used by graph-local cache operations.
Parameters (1)theCache—cache service
Returnsgraph-local slot index
- UnregisterCache(theGUID: Standard_GUID): void
Remove a cache service by GUID.
Parameters (1)theGUID—cache identity
- FindCache(theGUID: Standard_GUID): BRepGraph_Cache
Find a cache service by GUID.
Parameters (1)theGUID—cache identity
Returnscache service, or null handle if not found
- FindSlot(theGUID: Standard_GUID, theSlot: number): { returnValue: boolean; theSlot: number }
Return current graph-local slot for a GUID.
Parameters (2)theGUID—cache family identitytheSlot—graph-local slot index
ReturnsA result object with fields:
returnValue: true if the cache service is registeredtheSlot: graph-local slot index
- FindSlot(theCache: BRepGraph_Cache, theSlot: number): { returnValue: boolean; theSlot: number }
Return current graph-local slot for a cache service.
Parameters (2)theCache—cache servicetheSlot—graph-local slot index
ReturnsA result object with fields:
returnValue: true if the cache service is registeredtheSlot: graph-local slot index
- Cache(theSlot: number): BRepGraph_Cache
Return cache service by graph-local slot, or null handle if the slot is out of range.
Parameters (1)theSlot—graph-local cache slot
- NbCaches(): number
Number of registered cache services.
- ClearAll(): void
Clear data in all registered cache services.
- CopyFreshCachesTo(theTargetGraph: BRepGraph, theItemRemap: any, theMode: BRepGraph_CopyRemap_Mode): void
Ask registered cache services to copy fresh, remappable data into the target graph.
Parameters (3)theTargetGraphtheItemRemaptheMode
- CopyFreshCachesTo(theTargetGraph: BRepGraph, theMappingKind: BRepGraph_CopyRemap_MappingKind, theMode: BRepGraph_CopyRemap_Mode): void
Ask registered cache services to copy fresh data using identity mapping.
Parameters (3)theTargetGraphtheMappingKindtheMode
- Clear(): void
Unregister all cache services.
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 -> Occurrences, Occurrence -> Product/topology-root.
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_ChildExplorer
Explore all descendants of the root node using recursive traversal.
Parameters (2)theGraph—graph to walktheRoot—root node where the walk begins
- 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
Explore descendants of the root node using the given traversal mode.
Parameters (3)theGraph—graph to walktheRoot—root node where the walk beginstheMode—traversal strategy (recursive or direct children)
- constructor(theGraph: BRepGraph, theRoot: BRepGraph_NodeId, theTargetKind: BRepGraph_NodeId_Kind): BRepGraph_ChildExplorer
Disambiguates non-product typed ids from the ProductId-specific overload family above and keeps them on the generic NodeId traversal path.
Parameters (3)theGraph—graph to walktheRoot—typed root node where the walk beginstheTargetKind—kind of nodes to emit
- constructor(theGraph: BRepGraph, theProduct: BRepGraph_ProductId, theTargetKind: BRepGraph_NodeId_Kind): BRepGraph_ChildExplorer
Explore only descendants of the given target kind starting from a product.
Parameters (3)theGraph—graph to walktheProduct—product whose occurrences and topology are exploredtheTargetKind—kind of nodes to emit
- constructor(theGraph: BRepGraph, theRoot: BRepGraph_NodeId, theTargetKind: BRepGraph_NodeId_Kind, theMode: BRepGraph_ChildExplorer_TraversalMode): BRepGraph_ChildExplorer
Explore only descendants of the given target kind using the given traversal mode.
Parameters (4)theGraph—graph to walktheRoot—root node where the walk beginstheTargetKind—kind of nodes to emittheMode—traversal strategy
- constructor(theGraph: BRepGraph, theProduct: BRepGraph_ProductId, theTargetKind: BRepGraph_NodeId_Kind, theMode: BRepGraph_ChildExplorer_TraversalMode): BRepGraph_ChildExplorer
Explore only descendants of the given target kind starting from a product, using the given traversal mode.
Parameters (4)theGraph—graph to walktheProduct—product whose occurrences and topology are exploredtheTargetKind—kind of nodes to emittheMode—traversal strategy
- constructor(theGraph: BRepGraph, theRoot: BRepGraph_NodeId, theAvoidKind: BRepGraph_NodeId_Kind | null | undefined, theEmitAvoidKind: boolean, theMode?: BRepGraph_ChildExplorer_TraversalMode): BRepGraph_ChildExplorer
Explore descendants while pruning branches at the avoid kind.
Parameters (5)theGraph—graph to walktheRoot—root node where the walk beginstheAvoidKind—node kind to avoid descending intotheEmitAvoidKind—if true, emit matching avoid-kind nodes once before skippingtheMode—traversal strategy
- constructor(theGraph: BRepGraph, theRoot: BRepGraph_NodeId, theTargetKind: BRepGraph_NodeId_Kind, theAvoidKind: BRepGraph_NodeId_Kind | null | undefined, theEmitAvoidKind: boolean, theMode?: BRepGraph_ChildExplorer_TraversalMode): BRepGraph_ChildExplorer
Explore descendants of the given target kind while pruning branches at the avoid kind.
Parameters (6)theGraph—graph to walktheRoot—root node where the walk beginstheTargetKind—kind of nodes to emittheAvoidKind—node kind to avoid descending intotheEmitAvoidKind—if true, emit matching avoid-kind nodes once before skippingtheMode—traversal strategy
- constructor(theGraph: BRepGraph, theRoot: BRepGraph_NodeId, theTargetKind: BRepGraph_NodeId_Kind, theCumLoc: boolean, theCumOri: boolean, 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)theGraph—graph to walktheRoot—typed root node where the walk beginstheTargetKind—kind of nodes to emittheCumLoc—if true, accumulate location down the walktheCumOri—if true, accumulate orientation down the walktheMode—traversal strategy
- constructor(theGraph: BRepGraph, theProduct: BRepGraph_ProductId, theTargetKind: BRepGraph_NodeId_Kind, theCumLoc: boolean, theCumOri: boolean, theMode?: BRepGraph_ChildExplorer_TraversalMode): BRepGraph_ChildExplorer
Explore only descendants of the given target kind starting from a product, with explicit location/orientation control.
Parameters (6)theGraph—graph to walktheProduct—product whose occurrences and topology are exploredtheTargetKind—kind of nodes to emittheCumLoc—if true, accumulate location down the walktheCumOri—if true, accumulate orientation down the walktheMode—traversal strategy
- constructor(theGraph: BRepGraph, theRoot: BRepGraph_NodeId, theTargetKind: BRepGraph_NodeId_Kind, theStartLoc: TopLoc_Location, theStartOri: TopAbs_Orientation, theMode?: BRepGraph_ChildExplorer_TraversalMode): BRepGraph_ChildExplorer
Explore only descendants of the given target kind with an explicit initial transform.
Parameters (6)theGraph—graph to walktheRoot—root node where the walk beginstheTargetKind—kind of nodes to emittheStartLoc—initial accumulated locationtheStartOri—initial accumulated orientationtheMode—traversal strategy
Instance methods(14)
- 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
True if another matching descendant is available.
- Next(): void
Advance to the next matching descendant.
- Current(): any
Current matching descendant node with accumulated location and orientation.
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, Occurrence->Product/topology-root.Returns the explicit concrete traversal path from the explorer root to
Current().- LocationOf(theKind: BRepGraph_NodeId_Kind): TopLoc_Location
Returns the accumulated location at the most recent ancestor of the given kind.
Parameters (1)theKind—node kind to search for in the ancestor chain
Returnsaccumulated location at the matching ancestor
- NodeOf(theKind: BRepGraph_NodeId_Kind): BRepGraph_NodeId
Returns the node id of the most recent ancestor of the given kind.
Parameters (1)theKind—node kind to search for in the ancestor chain
Returnsnode id of the matching ancestor
- LocationAt(theLevel: number): TopLoc_Location
Returns the accumulated location at the given stack level.
Parameters (1)theLevel—zero-based stack depth (0 = root)
Returnsaccumulated location at the specified level
- NodeAt(theLevel: number): BRepGraph_NodeId
Returns the node id at the given stack level.
Parameters (1)theLevel—zero-based stack depth (0 = root)
Returnsnode id at the specified level
- Depth(): number
Number of valid ancestor frames currently on the stack (excluding the sentinel below the root). O(1); avoids the O(depth^2) NodeAt(i) walk used to compute container priority in selection-mode building.
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(4)
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(4)
Properties(1)
BRepGraph_CoEdgesOfEdge
Constructors(2)
- constructor(theGraph: BRepGraph, theParents: unknown): BRepGraph_CoEdgesOfEdgeParameters (2)
theGraphtheParents
- constructor(theGraph: BRepGraph, theParents: unknown, theStartIndex: number): BRepGraph_CoEdgesOfEdgeParameters (3)
theGraphtheParentstheStartIndex
Instance methods(9)
BRepGraph_CoEdgesOfWire
Constructors(1)
- constructor(theGraph: BRepGraph, theParent: unknown): BRepGraph_CoEdgesOfWireParameters (2)
theGraphtheParent
Instance methods(5)
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(4)
Properties(1)
BRepGraph_CompSolidsOfSolid
Constructors(2)
- constructor(theGraph: BRepGraph, theRefs: BRepGraph_SolidRefId[]): BRepGraph_CompSolidsOfSolidParameters (2)
theGraphtheRefs
- constructor(theGraph: BRepGraph, theRefs: BRepGraph_SolidRefId[], theStartIndex: number): BRepGraph_CompSolidsOfSolidParameters (3)
theGraphtheRefstheStartIndex
Instance methods(9)
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
- Perform(theGraph: BRepGraph, theOptions: BRepGraph_Compact_Options): BRepGraph_Compact_Result
Run compaction with specified options.
Parameters (2)theGraph—graph to compacttheOptions—compaction configuration
Returnscompaction statistics
BRepGraph_Compact_Options
Constructors(1)
Properties(2)
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(4)
Properties(1)
BRepGraph_CompoundsOfChild
Constructors(2)
- constructor(theGraph: BRepGraph, theRefs: BRepGraph_ChildRefId[]): BRepGraph_CompoundsOfChildParameters (2)
theGraphtheRefs
- constructor(theGraph: BRepGraph, theRefs: BRepGraph_ChildRefId[], theStartIndex: number): BRepGraph_CompoundsOfChildParameters (3)
theGraphtheRefstheStartIndex
Instance methods(9)
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 copy modes:
- External: source and target are different graphs. Target receives the copied data.
- Self-copy: source and target are the same graph. The specified sub-graph is duplicated with new entity IDs; shared dependencies (geometry, vertices referenced from outside the sub-graph) are preserved.
Geometry and mesh policies are controlled by the GeomPolicy and MeshPolicy enums.
Typical usage
Static methods(2)
- Perform(theSourceGraph: BRepGraph, theTargetGraph: BRepGraph, theGeomPolicy?: BRepGraph_Copy_GeomPolicy, theMeshPolicy?: BRepGraph_Copy_MeshPolicy, theCachePolicy?: BRepGraph_Copy_CachePolicy): boolean
Copy the entire source graph into the target graph.
Self-copy (theSourceGraph == theTargetGraph): Identity no-op, returns true immediately.
External copy to empty target (theTargetGraph.IsEmpty()): Uses identity-mapped fast path (old index == new index).
External copy to non-empty target: Uses explicit mapping; IDs in theTargetGraph will differ from theSourceGraph. Entities from theSourceGraph are appended to theTargetGraph.Parameters (5)theSourceGraph—a pre-builtBRepGraph(must not be empty)theTargetGraph—destination graph (may already contain data)theGeomPolicy—geometry handle policy (default: Copy)theMeshPolicy—mesh data policy (default: Copy)theCachePolicy
Returnstrue on success, false on failure (empty source)
- CopyNode(theSourceGraph: BRepGraph, theTargetGraph: BRepGraph, theNodeId: BRepGraph_NodeId, theGeomPolicy?: BRepGraph_Copy_GeomPolicy, theMeshPolicy?: BRepGraph_Copy_MeshPolicy, theCachePolicy?: BRepGraph_Copy_CachePolicy): BRepGraph_NodeId
Copy a single node sub-graph of any kind (Face, Shell, Solid, Wire, Edge, Vertex, etc.). The target graph receives the specified node and all entities it references.
External copy (theSourceGraph != theTargetGraph): New entities are appended to theTargetGraph. Entities already present in theTargetGraph are reused (not duplicated).
Self-copy (theSourceGraph == theTargetGraph): The specified sub-graph is duplicated with new entity IDs within the same graph. Shared dependencies (vertices, edges referenced from outside the sub-graph) are preserved as-is.Parameters (6)theSourceGraph—a pre-builtBRepGraphtheTargetGraph—destination graph (may already contain data)theNodeId—node identifier (any kind)theGeomPolicy—geometry handle policy (default: Copy)theMeshPolicy—mesh data policy (default: Copy)theCachePolicy
Returnsthe mapped root NodeId in theTargetGraph, or invalid NodeId on failure
BRepGraph_CopyRemap
Immutable context passed to layer copy callbacks.
The structural copy algorithm owns remap construction. Layers receive this context and decide how to copy their own representation without exposing layer details back to BRepGraph_Copy.
Constructors(2)
- constructor(theSourceGraph: BRepGraph, theTargetGraph: BRepGraph, theItemRemap: any, theMode: BRepGraph_CopyRemap_Mode): BRepGraph_CopyRemapParameters (4)
theSourceGraphtheTargetGraphtheItemRemaptheMode
- constructor(theSourceGraph: BRepGraph, theTargetGraph: BRepGraph, theMappingKind: BRepGraph_CopyRemap_MappingKind, theMode: BRepGraph_CopyRemap_Mode): BRepGraph_CopyRemap
Identity-mapping constructor for full identity copy into an empty target. Source item ids are returned directly as target item ids after validation.
Parameters (4)theSourceGraphtheTargetGraphtheMappingKindtheMode
Instance methods(12)
- CopyMode(): BRepGraph_CopyRemap_Mode
Migration mode of this context.
- IsCompact(): boolean
True if this is a compaction migration (not a full copy).
Source graph the copied layer is attached to.
Target graph whose structural contents have already been copied.
Target graph as const.
- Items(): any
Source item id -> target item id map for copied definitions, refs, and reps.
- TargetItem(theSourceItem: BRepGraph_ItemId): BRepGraph_ItemId
Return the target item for a source item, or an invalid item if not copied.
Parameters (1)theSourceItem
- TargetItemOrInvalid(theSourceItem: BRepGraph_ItemId): BRepGraph_ItemId
Return the target item for a source item, or an invalid item id.
Parameters (1)theSourceItem
- HasTargetItem(theSourceItem: BRepGraph_ItemId): boolean
Return true if the source item has a valid copied target item.
Parameters (1)theSourceItem
- SourceUID(theSourceItem: BRepGraph_ItemId): BRepGraph_ItemUID
Return source UID for a source item.
Parameters (1)theSourceItem
- TargetUID(theTargetItem: BRepGraph_ItemId): BRepGraph_ItemUID
Return target UID for a target item.
Parameters (1)theTargetItem
- TargetUIDFromSource(theSourceItem: BRepGraph_ItemId): BRepGraph_ItemUID
Return target UID for a source item by source->target remap.
Parameters (1)theSourceItem
BRepGraph_Data
Internal storage for BRepGraph (PIMPL).
All topology definition data and UIDs live in myIncStorage. Access via myIncStorage.Edges, myIncStorage.Faces, etc.
Constructors(1)
Properties(9)
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 relation 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(7)
BRepGraph_DefsCoEdgeOfWire
Constructors(1)
- constructor(theGraph: BRepGraph, theParent: unknown): BRepGraph_DefsCoEdgeOfWireParameters (2)
theGraphtheParent
Instance methods(7)
BRepGraph_DefsEdgeOfWire
Constructors(1)
- constructor(theGraph: BRepGraph, theParent: unknown): BRepGraph_DefsEdgeOfWireParameters (2)
theGraphtheParent
Instance methods(7)
BRepGraph_DefsFaceOfShell
Constructors(1)
- constructor(theGraph: BRepGraph, theParent: unknown): BRepGraph_DefsFaceOfShellParameters (2)
theGraphtheParent
Instance methods(7)
BRepGraph_DefsIterator_ChildOfCompoundTraits
Constructors(1)
Static methods(5)
- IsParentValid(theGraph: BRepGraph, theParent: BRepGraph_CompoundId): booleanParameters (2)
theGraphtheParent
- RefIds(theGraph: BRepGraph, theParent: BRepGraph_CompoundId): BRepGraph_ChildRefId[]Parameters (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(4)
- IsParentValid(theGraph: BRepGraph, theParent: BRepGraph_WireId): booleanParameters (2)
theGraphtheParent
- RefIds(theGraph: BRepGraph, theParent: BRepGraph_WireId): BRepGraph_CoEdgeId[]Parameters (2)
theGraphtheParent
- Ref(theGraph: BRepGraph, theRefId: BRepGraph_CoEdgeId): BRepGraphInc_CoEdgeDefParameters (2)
theGraphtheRefId
- 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(7)
BRepGraph_DefsIterator_EdgeOfWireTraits
Constructors(1)
Static methods(5)
- IsParentValid(theGraph: BRepGraph, theParent: BRepGraph_WireId): booleanParameters (2)
theGraphtheParent
- RefIds(theGraph: BRepGraph, theParent: BRepGraph_WireId): BRepGraph_CoEdgeId[]Parameters (2)
theGraphtheParent
- Ref(theGraph: BRepGraph, theRefId: BRepGraph_CoEdgeId): BRepGraphInc_CoEdgeDefParameters (2)
theGraphtheRefId
- ChildIdOf(theGraph: BRepGraph, theRef: BRepGraphInc_CoEdgeDef): 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): BRepGraph_FaceRefId[]Parameters (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): BRepGraph_OccurrenceRefId[]Parameters (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): BRepGraph_ShellRefId[]Parameters (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): BRepGraph_SolidRefId[]Parameters (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_WireOfFaceTraits
Constructors(1)
Static methods(5)
- IsParentValid(theGraph: BRepGraph, theParent: BRepGraph_FaceId): booleanParameters (2)
theGraphtheParent
- RefIds(theGraph: BRepGraph, theParent: BRepGraph_FaceId): BRepGraph_WireRefId[]Parameters (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(7)
BRepGraph_DefsShellOfSolid
Constructors(1)
- constructor(theGraph: BRepGraph, theParent: unknown): BRepGraph_DefsShellOfSolidParameters (2)
theGraphtheParent
Instance methods(7)
BRepGraph_DefsSolidOfCompSolid
Constructors(1)
- constructor(theGraph: BRepGraph, theParent: unknown): BRepGraph_DefsSolidOfCompSolidParameters (2)
theGraphtheParent
Instance methods(7)
BRepGraph_DefsWireOfFace
Constructors(1)
- constructor(theGraph: BRepGraph, theParent: unknown): BRepGraph_DefsWireOfFaceParameters (2)
theGraphtheParent
Instance methods(7)
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(4)
Properties(1)
BRepGraph_EdgesOfVertex
Constructors(2)
- constructor(theGraph: BRepGraph, theParents: unknown): BRepGraph_EdgesOfVertexParameters (2)
theGraphtheParents
- constructor(theGraph: BRepGraph, theParents: unknown, theStartIndex: number): BRepGraph_EdgesOfVertexParameters (3)
theGraphtheParentstheStartIndex
Instance methods(9)
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
- BeginDeferredInvalidation(): void
- EndDeferredInvalidation(): void
- IsDeferredMode(): boolean
- CommitMutation(): void
- ValidateMutationBoundary(theIssues?: BRepGraph_EditorView_BoundaryIssue[]): 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(4)
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(4)
Properties(1)
BRepGraph_FacesOfEdge
Constructors(2)
- constructor(theGraph: BRepGraph, theEdge: BRepGraph_EdgeId): BRepGraph_FacesOfEdgeParameters (2)
theGraphtheEdge
- constructor(theGraph: BRepGraph, theEdge: BRepGraph_EdgeId, theStartIndex: number): BRepGraph_FacesOfEdgeParameters (3)
theGraphtheEdgetheStartIndex
Instance methods(7)
BRepGraph_FacesOfWire
Constructors(2)
- constructor(theGraph: BRepGraph, theRefs: BRepGraph_WireRefId[]): BRepGraph_FacesOfWireParameters (2)
theGraphtheRefs
- constructor(theGraph: BRepGraph, theRefs: BRepGraph_WireRefId[], theStartIndex: number): BRepGraph_FacesOfWireParameters (3)
theGraphtheRefstheStartIndex
Instance methods(9)
BRepGraph_FullChildRefIterator
Constructors(2)
- constructor(theGraph: BRepGraph): BRepGraph_FullChildRefIteratorParameters (1)
theGraph
- constructor(theGraph: BRepGraph, theStartId: unknown): BRepGraph_FullChildRefIteratorParameters (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_ItemId
Generic BRepGraph item identifier covering definitions and references. Use-records are NOT included - they are session-local, not graph identity.
Constructors(3)
Construct an invalid item id.
- constructor(theNode: BRepGraph_NodeId): BRepGraph_ItemId
Construct a node item id.
Parameters (1)theNode
- constructor(theRef: BRepGraph_RefId): BRepGraph_ItemId
Construct a reference item id.
Parameters (1)theRef
Instance methods(11)
- IsValid(): boolean
Return true if this item addresses a graph object.
- ItemDomain(): BRepGraph_ItemId_Domain
Return the addressed domain.
- IsNode(): boolean
Return true if this item addresses a definition node.
- IsReference(): boolean
Return true if this item addresses a reference entry.
Convert to node id. Returns invalid id for non-node items.
Convert to reference id. Returns invalid id for non-reference items.
- NodeKind(): BRepGraph_NodeId_Kind
Return node kind. Valid only when
IsNode()is true. - RefKind(): BRepGraph_RefId_Kind
Return reference kind. Valid only when
IsReference()is true. - RawKind(): number
Return item kind encoded in its own domain enum space.
- Kind(): number
Return item kind encoded in its own domain enum space.
- Index(): number
Return item per-kind index.
BRepGraph_ItemUID
Durable BRepGraph item identity covering definition nodes and reference entries.
BRepGraph_ItemId is a transient structural address. BRepGraph_ItemUID is the persistent identity assigned at item creation and kept stable across compaction and vector reordering. Representation/use records are not addressed here because they do not have persisted identity.
Constructors(1)
Construct an invalid UID.
Static methods(3)
- Node(theKind: BRepGraph_NodeId_Kind, theCounter: number): BRepGraph_ItemUID
Construct a node UID.
Parameters (2)theKindtheCounter
- Reference(theKind: BRepGraph_RefId_Kind, theCounter: number): BRepGraph_ItemUID
Construct a reference UID.
Parameters (2)theKindtheCounter
Return an invalid sentinel UID.
Instance methods(9)
- IsValid(): boolean
Return true if this UID has a non-sentinel counter and a valid domain/kind pair.
- ItemDomain(): BRepGraph_ItemUID_Domain
Return the addressed identity domain.
- IsNode(): boolean
- IsReference(): boolean
- NodeKind(): BRepGraph_NodeId_Kind
Return node kind. Valid only for node UIDs.
- RefKind(): BRepGraph_RefId_Kind
Return reference kind. Valid only for reference UIDs.
- RawKind(): number
Return item kind encoded in its own domain enum space.
- Counter(): number
Return the graph-wide monotonic UID counter.
- HashValue(): number
Compute a hash value compatible with operator==.
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(18)
- ID(): Standard_GUID
Layer type identity (unique within a graph).
Layer identity (unique within a graph).
- OnNodeRemoved(theNode: BRepGraph_NodeId): void
Called when a node is soft-removed without a replacement.
Parameters (1)theNode—the removed node Layers should discard or archive data associated with it.
RemarksWarning: Layer callbacks must not throw. They are called from noexcept notification paths (MutGuard destructors, deferred invalidation flush).
- OnItemRemoved(theItem: BRepGraph_ItemId): void
Dispatch a generic item removal to the matching typed removal callback. This is a non-virtual convenience entry point; typed callbacks remain the extension points for derived layers.
Parameters (1)theItem—the removed definition or reference
- OnNodeReplaced(theOldNode: BRepGraph_NodeId, theNewNode: BRepGraph_NodeId): void
Called when a node is soft-removed and replaced by another node.
Parameters (2)theOldNode—the removed nodetheNewNode—the node that replaces theOldNode Layers that store node-keyed data should migrate from theOldNode to theNewNode when the replacement kind is compatible. This is a structural lifecycle event, not an algorithmic history record.
RemarksWarning: Layer callbacks must not throw. They are called from noexcept notification paths (MutGuard destructors, deferred invalidation flush).
- CopyTo(theCopy: BRepGraph_CopyRemap): void
Copy this source layer data into another graph. The source graph is the graph this layer is attached to (
Graph()).Parameters (1)theCopy—source graph, target graph, and source item id -> target item id remap
RemarksWarning: This callback may allocate and is intentionally not noexcept.
- 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
- OnItemModified(theItem: BRepGraph_ItemId): void
Dispatch a generic item modification to the matching typed modification callback. This is a non-virtual convenience entry point; typed callbacks remain the extension points for derived layers.
Parameters (1)theItem—the modified definition or reference
- OnNodesModified(theModifiedNodes: NCollection_Array1_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 array 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_Array1_BRepGraph_RefId): 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 array may contain refs of kinds not subscribed to - layers should filter internally if needed. Default: no-op.Parameters (1)theModifiedRefs—all modified, non-removed refs
- 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.
BRepGraph_LayerDeferred
Base layer for postponed graph item loading.
The layer stores provider-neutral deferred representation records and owns the lock state through BRepGraph_LayerLock. Format-specific loaders, such as ODE or STEP, should derive from this class or use the same representation contract rather than storing deferred ownership in topology definitions.
Constructors(1)
Constructor for generic deferred layers.
Static methods(3)
Return fixed layer type GUID.
- get_type_name(): string
Instance methods(28)
- ID(): Standard_GUID
Return this layer type GUID.
Return deferred entry for an item, or null if none exists.
Parameters (1)theItem
Return deferred entry for a node, or null if none exists.
Parameters (1)theNode
Return deferred entry for a reference, or null if none exists.
Parameters (1)theRef
- HasDeferred(theItem: BRepGraph_ItemId): boolean
Return true if an item has deferred representations.
Parameters (1)theItem
- HasDeferred(theNode: BRepGraph_NodeId): boolean
Return true if a node has deferred representations.
Parameters (1)theNode
- HasDeferred(theRef: BRepGraph_RefId): boolean
Return true if a reference has deferred representations.
Parameters (1)theRef
- RegisterDeferred(theItem: BRepGraph_ItemId, theProvider: TCollection_AsciiString, theSourceKey: TCollection_AsciiString, theRepresentationKind: BRepGraph_LayerDeferred_RepresentationKind, theRepresentationName: TCollection_AsciiString, theSourceIndex: number): void
Register one postponed representation and lock the item.
Parameters (6)theItemtheProvidertheSourceKeytheRepresentationKindtheRepresentationNametheSourceIndex
- RegisterDeferred(theNode: BRepGraph_NodeId, theProvider: TCollection_AsciiString, theSourceKey: TCollection_AsciiString, theRepresentationKind: BRepGraph_LayerDeferred_RepresentationKind, theRepresentationName: TCollection_AsciiString, theSourceIndex: number): void
Register one postponed node representation and lock the node.
Parameters (6)theNodetheProvidertheSourceKeytheRepresentationKindtheRepresentationNametheSourceIndex
- RegisterDeferred(theRef: BRepGraph_RefId, theProvider: TCollection_AsciiString, theSourceKey: TCollection_AsciiString, theRepresentationKind: BRepGraph_LayerDeferred_RepresentationKind, theRepresentationName: TCollection_AsciiString, theSourceIndex: number): void
Register one postponed reference representation and lock the reference.
Parameters (6)theReftheProvidertheSourceKeytheRepresentationKindtheRepresentationNametheSourceIndex
- RegisterDeferredRepresentations(theItem: BRepGraph_ItemId, theProvider: TCollection_AsciiString, theSourceKey: TCollection_AsciiString, theRepresentations: BRepGraph_LayerDeferred_Representation, theNbRepresentations: number): void
Register postponed representations for one item and lock the item once.
Parameters (5)theItemtheProvidertheSourceKeytheRepresentationstheNbRepresentations
- RegisterDeferredRepresentationsDirect(theItem: BRepGraph_ItemId, theProvider: TCollection_AsciiString, theSourceKey: TCollection_AsciiString, theRepresentations: BRepGraph_LayerDeferred_Representation, theNbRepresentations: number): void
Register postponed representations for a new item and lock it once.
This is a trusted bulk-load fast path: the caller must ensure the item is valid, has no existing deferred entry, andtheRepresentationscontains no duplicates.Parameters (5)theItemtheProvidertheSourceKeytheRepresentationstheNbRepresentations
- UnregisterDeferred(theItem: BRepGraph_ItemId): void
Remove all deferred representations for an item and unlock it.
Parameters (1)theItem
- UnregisterDeferred(theNode: BRepGraph_NodeId): void
Remove all deferred representations for a node and unlock it.
Parameters (1)theNode
- UnregisterDeferred(theRef: BRepGraph_RefId): void
Remove all deferred representations for a reference and unlock it.
Parameters (1)theRef
- HasDeferredItems(): boolean
Return true if at least one item has deferred representations.
- FindFirstDeferred(theKind: BRepGraph_LayerDeferred_RepresentationKind, theItem?: BRepGraph_ItemId): BRepGraph_LayerDeferred_Entry
Return first deferred entry with at least one representation of the requested kind, or null.
Parameters (2)theKindtheItem
- ReserveDeferredItems(theNbItems: number): void
Reserve deferred and lock layer buckets for bulk registration.
Parameters (1)theNbItems
- BeginBulkRegistration(): void
Begin bulk deferred registration. Revision updates are postponed until
EndBulkRegistration(). - EndBulkRegistration(): void
Finish bulk deferred registration and publish one revision update if anything changed.
Layer identity (unique within a graph).
- OnNodeRemoved(theNode: BRepGraph_NodeId): void
Called when a node is soft-removed without a replacement.
Parameters (1)theNode—the removed node Layers should discard or archive data associated with it.
RemarksWarning: Layer callbacks must not throw. They are called from noexcept notification paths (MutGuard destructors, deferred invalidation flush).
- OnNodeReplaced(theOldNode: BRepGraph_NodeId, theNewNode: BRepGraph_NodeId): void
Called when a node is soft-removed and replaced by another node.
Parameters (2)theOldNode—the removed nodetheNewNode—the node that replaces theOldNode Layers that store node-keyed data should migrate from theOldNode to theNewNode when the replacement kind is compatible. This is a structural lifecycle event, not an algorithmic history record.
RemarksWarning: Layer callbacks must not throw. They are called from noexcept notification paths (MutGuard destructors, deferred invalidation flush).
- CopyTo(theCopy: BRepGraph_CopyRemap): void
Copy this source layer data into another graph. The source graph is the graph this layer is attached to (
Graph()).Parameters (1)theCopy—source graph, target graph, and source item id -> target item id remap
RemarksWarning: This callback may allocate and is intentionally not noexcept.
- 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
- InvalidateAll(): void
Mark all cached values dirty (bulk invalidation).
- Clear(): void
Clear all stored data.
BRepGraph_LayerDeferred_Entry
Constructors(1)
Properties(3)
BRepGraph_LayerDeferred_Entry_RepresentationStorage
Constructors(2)
- constructor(theOther: BRepGraph_LayerDeferred_Entry_RepresentationStorage): BRepGraph_LayerDeferred_Entry_RepresentationStorageParameters (1)
theOther
Instance methods(8)
- Size(): number
- IsEmpty(): boolean
- ContainsKind(theKind: BRepGraph_LayerDeferred_RepresentationKind): booleanParameters (1)
theKind
- Value(theIndex: number): BRepGraph_LayerDeferred_RepresentationParameters (1)
theIndex
- ChangeValue(theIndex: number): BRepGraph_LayerDeferred_RepresentationParameters (1)
theIndex
- Append(theRepresentation: BRepGraph_LayerDeferred_Representation): voidParameters (1)
theRepresentation
- Clear(): void
BRepGraph_LayerDeferred_Representation
Constructors(1)
Properties(4)
BRepGraph_LayerHistory
History layer for BRepGraph.
BRepGraph_LayerHistory maintains an append-only log of modification events and per-kind lookup maps for efficient queries. Four event kinds are tracked (see BRepGraph_LayerHistory::Kind):
- Modified: input -> { modified images } (default).
- Generated: input -> { generated images } (new entities born from the input but not sharing its identity).
- Deleted: input has been consumed and has no image in the result.
- Replaced: input was structurally detached and replaced by another node; this maps as Modified and also marks the input as deleted.
Recording can be toggled on/off at runtime. Graph-owned history is registered as a layer and accessed through #Ensure / #Find; algorithms wrapping OCCT'sBRepTools_Historycan import results throughAbsorb.
Constructors(1)
Default constructor.
Static methods(3)
Stable layer GUID.
- get_type_name(): string
Instance methods(43)
- ID(): Standard_GUID
Layer type identity.
Layer display name.
- Record(theOpLabel: TCollection_AsciiString, theOriginal: BRepGraph_NodeId, theReplacements: NCollection_Array1_BRepGraph_NodeId, theKind: BRepGraph_LayerHistory_Kind): void
Record a modification: theOriginal was replaced by theReplacements.
Parameters (4)theOpLabel—human-readable operation nametheOriginal—node id before the operationtheReplacements—node ids after the operationtheKind—classification of this record (default Modified)
RemarksNote: When
theReplacementsis empty the record is auto-downgraded toKind::DeletedandtheOriginalis added to the deleted set, regardless oftheKind. UseRecordDeleteddirectly for the deletion case to avoid relying on this implicit conversion. - Record(theRecordIdx: number): BRepGraph_LayerHistory_Event
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_Array1_BRepGraph_NodeId, theReplacements: NCollection_Array1_BRepGraph_NodeId, theExtraInfo?: TCollection_AsciiString, theKind?: BRepGraph_LayerHistory_Kind): void
Record a batch of 1-to-1 modifications in a single history event. Each original is paired with the replacement at the same logical position. More efficient than calling
Record()in a loop: creates one HistoryRecord and updates the per-kind maps with minimal overhead.Parameters (5)theOpLabel—human-readable operation nametheOriginals—node ids before the operationtheReplacements—node ids after the operation (same length)theExtraInfo—optional diagnostic info stored on the recordtheKind—classification of this record (default Modified)
- RecordDeleted(theOpLabel: TCollection_AsciiString, theDeleted: NCollection_Array1_BRepGraph_NodeId): void
Record that a collection of inputs has been consumed by the operation and has no image in the result. Each input is appended to the deleted set and emits a single audit record with empty replacements.
Parameters (2)theOpLabel—human-readable operation nametheDeleted—node ids that have been removed
- RecordReplaced(theOpLabel: TCollection_AsciiString, theOriginal: BRepGraph_NodeId, theReplacement: BRepGraph_NodeId): void
Record replacements: each original is logically removed/detached and continued by the corresponding replacement. Replaced records participate in modified-image queries and also mark originals as deleted.
Parameters (3)theOpLabeltheOriginaltheReplacement
- RecordReplacedBatch(theOpLabel: TCollection_AsciiString, theOriginals: NCollection_Array1_BRepGraph_NodeId, theReplacements: NCollection_Array1_BRepGraph_NodeId, theExtraInfo?: TCollection_AsciiString): void
Record a batch of 1-to-1 replacements in a single history event.
Parameters (4)theOpLabeltheOriginalstheReplacementstheExtraInfo
- RecordUid(theOpLabel: TCollection_AsciiString, theOriginal: BRepGraph_UID, theReplacements: NCollection_Array1_BRepGraph_UID, theKind?: BRepGraph_LayerHistory_Kind): void
Record a UID-keyed modification/generation event.
This is the durable-history path for operations whose source and result identities may live in differentBRepGraphinstances. Existing NodeId records remain available for in-graph algorithms; UID records are queried directly by cross-graph consumers.Parameters (4)theOpLabeltheOriginaltheReplacementstheKind
- RecordDeletedUid(theOpLabel: TCollection_AsciiString, theDeleted: NCollection_Array1_BRepGraph_UID): void
Record UID-keyed deletions.
Parameters (2)theOpLabeltheDeleted
- RecordItemUid(theOpLabel: TCollection_AsciiString, theOriginal: BRepGraph_ItemUID, theReplacements: NCollection_Array1_BRepGraph_ItemUID, theKind?: BRepGraph_LayerHistory_Kind): void
Record an all-domain ItemUID-keyed modification/generation event.
Parameters (4)theOpLabeltheOriginaltheReplacementstheKind
- RecordDeletedItemUid(theOpLabel: TCollection_AsciiString, theDeleted: NCollection_Array1_BRepGraph_ItemUID): void
Record ItemUID-keyed deletions.
Parameters (2)theOpLabeltheDeleted
- Absorb(theInputs: NCollection_DataMap_TopoDS_Shape_BRepGraph_NodeId_TopTools_ShapeMapHasher, theOutputs: NCollection_DataMap_TopoDS_Shape_BRepGraph_NodeId_TopTools_ShapeMapHasher, theSource: BRepTools_History, theOpLabel: TCollection_AsciiString): void
Import a
BRepTools_Historyinto this graph-native history log.
IteratestheInputs, queriestheSourcefor Modified / Generated / IsRemoved, translates eachTopoDS_Shapeimage to a NodeId viatheOutputs, and emits the corresponding records.
Semantics:- For every input shape whose
Modified()list is non-empty: emit a Modified record. - For every input shape whose
Generated()list is non-empty: emit a Generated record. - For every input shape with IsRemoved() == true: accumulate into a single Deleted record (IsRemoved takes precedence over Modified/Generated to handle a known OCCT bug where a shape can appear in both the removed set and the generated map).
Output TopoDS_Shapes that do not appear intheOutputsare silently dropped (expected for subshapes merged into a parent compound whose identity is preserved at a higher level).
Parameters (4)theInputs—TopoDS_Shape-> NodeId for every input subshape that should be trackedtheOutputs—TopoDS_Shape-> NodeId for every subshape added to the graph by this operation (typically fromBRepGraph::ShapesView::Addwith TrackAddedNodes)theSource—BRepTools_Historyfrom the OCCT algorithm. Null is accepted (no-op).theOpLabel—record label written into every emitted record
- For every input shape whose
- Absorb(theInputGraph: BRepGraph, theOutputGraph: BRepGraph, theInputs: NCollection_DataMap_TopoDS_Shape_BRepGraph_NodeId_TopTools_ShapeMapHasher, theOutputs: NCollection_DataMap_TopoDS_Shape_BRepGraph_NodeId_TopTools_ShapeMapHasher, theSource: BRepTools_History, theOpLabel: TCollection_AsciiString): void
Import a
BRepTools_Historyusing persistent UIDs from source/result graphs.
This overload is the canonical bridge for cross-graph algorithms: input shapes are resolved intheInputGraph, output shapes are resolved intheOutputGraph, and the resulting history is stored by UID.Parameters (6)theInputGraphtheOutputGraphtheInputstheOutputstheSourcetheOpLabel
- 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): BRepGraph_NodeId[]
Walk forwards from an original node to all derived nodes, including both Modified and Generated descendants. Follows the forward maps recursively, collecting every transitively-reachable descendant (intermediate nodes and leaves alike, but not
theOriginalitself).Parameters (1)theOriginal—node id to trace forward
Returnsall transitively derived node ids in breadth-first order
- FindModified(theOriginal: BRepGraph_NodeId): BRepGraph_NodeId[]
Direct lookup of the Modified images of
theOriginal, non-recursive.Parameters (1)theOriginal—node id to query
Returnspointer to the stored vector, or nullptr if
theOriginalhas no Modified record (note: nullptr does not imply IsDeleted). - FindModified(theUID: BRepGraph_UID): BRepGraph_UID[]
UID-keyed Modified images stored directly in this history.
Parameters (1)theUID
- FindModified(theUID: BRepGraph_ItemUID): BRepGraph_ItemUID[]
ItemUID-keyed Modified images stored directly in this history.
Parameters (1)theUID
- FindModified(theGraph: BRepGraph, theUID: BRepGraph_UID): BRepGraph_UID[]
UID-keyed convenience: Modified images of the input identified by
theUID, resolved againsttheGraph. Returns an empty vector if the UID cannot be resolved or has no Modified record.Parameters (2)theGraph—graph used to translate UID <-> NodeIdtheUID—UID of the input entity
ReturnsUIDs of the modified images (in record-insertion order)
- FindGenerated(theOriginal: BRepGraph_NodeId): BRepGraph_NodeId[]
Direct lookup of the Generated images of
theOriginal, non-recursive.Parameters (1)theOriginal—node id to query
Returnspointer to the stored vector, or nullptr if
theOriginalhas no Generated record. - FindGenerated(theUID: BRepGraph_UID): BRepGraph_UID[]
UID-keyed Generated images stored directly in this history.
Parameters (1)theUID
- FindGenerated(theUID: BRepGraph_ItemUID): BRepGraph_ItemUID[]
ItemUID-keyed Generated images stored directly in this history.
Parameters (1)theUID
- FindGenerated(theGraph: BRepGraph, theUID: BRepGraph_UID): BRepGraph_UID[]
UID-keyed convenience: Generated images. See
FindModifiedfor the resolution contract.Parameters (2)theGraph—graph used to translate UID <-> NodeIdtheUID—UID of the input entity
ReturnsUIDs of the generated images (in record-insertion order)
- IsDeleted(theOriginal: BRepGraph_NodeId): boolean
Test whether
theOriginalwas deleted by some recorded operation.Parameters (1)theOriginal—node id to query
Returnstrue if
theOriginalis in the deleted set - IsDeleted(theUID: BRepGraph_UID): boolean
UID-keyed deletion test stored directly in this history.
Parameters (1)theUID
- IsDeleted(theUID: BRepGraph_ItemUID): boolean
ItemUID-keyed deletion test stored directly in this history.
Parameters (1)theUID
- IsDeleted(theGraph: BRepGraph, theUID: BRepGraph_UID): boolean
UID-keyed convenience: deletion test.
Parameters (2)theGraph—graph used to resolve the UIDtheUID—UID of the input entity
Returnstrue if the resolved NodeId is in the deleted set
- DeletedNodes(): any
Borrowed access to the full deleted set.
Returnsreference to the deleted-node set
- FindOriginals(theDerived: BRepGraph_NodeId): BRepGraph_NodeId[]
Direct lookup of all immediate node origins of
theDerived. A derived entity can have more than one parent in reconstructive algorithms.Parameters (1)theDerived
- DeletedUids(): any
UID-keyed deleted set stored directly in this history.
- DeletedUids(theGraph: BRepGraph): BRepGraph_UID[]
UID-keyed convenience: dump the full deleted set as UIDs.
Parameters (1)theGraph—graph used to translate NodeId -> UID
ReturnsUIDs of all deleted entities (insertion order is not stable)
- HasKnownInput(theUID: BRepGraph_UID): boolean
Test whether
theUIDwas registered as an operation input.Parameters (1)theUID
- HasKnownInput(theUID: BRepGraph_ItemUID): boolean
Test whether
theUIDwas registered as an operation input.Parameters (1)theUID
- DeletedItemUids(): any
ItemUID-keyed deleted set stored directly in this history.
- 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.
- OnNodeRemoved(theNode: BRepGraph_NodeId): void
Layer removal callback. Records pure graph deletions when enabled.
Parameters (1)theNode
- CopyTo(theCopy: BRepGraph_CopyRemap): void
Copy history records whose source items have copied target items.
Parameters (1)theCopy
- InvalidateAll(): void
Clear derived caches by dropping collected history.
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_LayerLock
Owner metadata layer for owned BRepGraph items.
Uses a root-based ownership model: only the highest owned item per group is stored in the map. All descendants receive the fast IsOwned bit-flag via automatic downward propagation. Owner lookup traverses upward to find the root entry.
Overlapping roots are forbidden: SetOwner rejects if the item is already covered by an ancestor root with a different GUID.
HasOwner() checks the IsOwned bit-flag (O(1)). FindOwnerId() traverses upward to find the root entry (O(depth)).
Constructors(1)
Create lock-owner storage.
Static methods(3)
Return fixed layer type GUID.
- get_type_name(): string
Instance methods(26)
- ID(): Standard_GUID
Return this layer type GUID.
- FindOwnerId(theItem: BRepGraph_ItemId, theOwnerId: Standard_GUID): boolean
Return owner ID for an item. Traverses upward for nodes/refs to find the root owner entry.
Parameters (2)theItemtheOwnerId—Mutated in place; read the updated value from this argument after the call.
Returnstrue when the item has a resolved owner and
theOwnerIdwas filled. - FindOwnerId(theNode: BRepGraph_NodeId, theOwnerId: Standard_GUID): boolean
Return owner ID for a node.
Parameters (2)theNodetheOwnerId—Mutated in place; read the updated value from this argument after the call.
- FindOwnerId(theRef: BRepGraph_RefId, theOwnerId: Standard_GUID): boolean
Return owner ID for a reference.
Parameters (2)theReftheOwnerId—Mutated in place; read the updated value from this argument after the call.
- HasOwner(theItem: BRepGraph_ItemId): boolean
Return true if an item's IsOwned bit-flag is set. This is an O(1) check. Use
FindOwnerId()to resolve the actual owner GUID.Parameters (1)theItem
- HasOwner(theNode: BRepGraph_NodeId): boolean
Return true if a node's IsOwned bit-flag is set.
Parameters (1)theNode
- HasOwner(theRef: BRepGraph_RefId): boolean
Return true if a reference's IsOwned bit-flag is set.
Parameters (1)theRef
- SetOwner(theItem: BRepGraph_ItemId, theOwnerId: Standard_GUID): void
Register an owner ID and set the graph item's ownership flag. For nodes, propagates the IsOwned bit-flag to all descendants. Rejects if the item is already covered by an ancestor root with a different GUID.
Parameters (2)theItemtheOwnerId
- SetOwner(theNode: BRepGraph_NodeId, theOwnerId: Standard_GUID): void
Register an owner ID and set the node ownership flag.
Parameters (2)theNodetheOwnerId
- SetOwner(theRef: BRepGraph_RefId, theOwnerId: Standard_GUID): void
Register an owner ID and set the reference ownership flag.
Parameters (2)theReftheOwnerId
- SetOwner(theItem: BRepGraph_ItemId, theOwnerId: Standard_GUID, theToUpdateRevision: boolean): boolean
Register an owner ID and set the graph item's ownership flag. Returns true when owner storage changed. Revision update can be deferred by bulk callers.
Parameters (3)theItemtheOwnerIdtheToUpdateRevision
- UnsetOwner(theItem: BRepGraph_ItemId): void
Remove an owner and clear the graph item's ownership flag. For node roots, clears the IsOwned bit-flag on all descendants.
Parameters (1)theItem
- UnsetOwner(theNode: BRepGraph_NodeId): void
Remove an owner and clear the node ownership flag.
Parameters (1)theNode
- UnsetOwner(theRef: BRepGraph_RefId): void
Remove an owner and clear the reference ownership flag.
Parameters (1)theRef
- UnsetOwner(theItem: BRepGraph_ItemId, theOwnerId: Standard_GUID): void
Remove an owner and clear the graph item's ownership flag if owner ID matches.
Parameters (2)theItemtheOwnerId
- HasOwners(): boolean
Return true if at least one root entry exists.
- ReserveOwners(theNbOwners: number): void
Reserve owner map buckets for bulk registration.
Parameters (1)theNbOwners
- TouchOwners(): void
Mark owner metadata changed after a bulk update.
Layer identity (unique within a graph).
- OnNodeRemoved(theNode: BRepGraph_NodeId): void
Called when a node is soft-removed without a replacement.
Parameters (1)theNode—the removed node Layers should discard or archive data associated with it.
RemarksWarning: Layer callbacks must not throw. They are called from noexcept notification paths (MutGuard destructors, deferred invalidation flush).
- OnNodeReplaced(theOldNode: BRepGraph_NodeId, theNewNode: BRepGraph_NodeId): void
Called when a node is soft-removed and replaced by another node.
Parameters (2)theOldNode—the removed nodetheNewNode—the node that replaces theOldNode Layers that store node-keyed data should migrate from theOldNode to theNewNode when the replacement kind is compatible. This is a structural lifecycle event, not an algorithmic history record.
RemarksWarning: Layer callbacks must not throw. They are called from noexcept notification paths (MutGuard destructors, deferred invalidation flush).
- CopyTo(theCopy: BRepGraph_CopyRemap): void
Copy this source layer data into another graph. The source graph is the graph this layer is attached to (
Graph()).Parameters (1)theCopy—source graph, target graph, and source item id -> target item id remap
RemarksWarning: This callback may allocate and is intentionally not noexcept.
- 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
- InvalidateAll(): void
Mark all cached values dirty (bulk invalidation).
- Clear(): void
Clear all stored data.
BRepGraph_LayerLock_ScopedOwnerEdit
Constructors(1)
- constructor(theLayer: BRepGraph_LayerLock, theItem: BRepGraph_ItemId, theOwnerId: Standard_GUID): BRepGraph_LayerLock_ScopedOwnerEditParameters (3)
theLayertheItemtheOwnerId
BRepGraph_LayerParametric
Base layer for graph-owned parametric generators.
The class defines the common instance identity, generation flags, mesh quality controls, and graph access helpers shared by higher-level parametric layers. Concrete layers such as BRepGraphPrim box, plane, or loft generators build their own parameter schema and manifest storage on top of this base.
Static methods(5)
- GenerationMask(theFlag: BRepGraph_LayerParametric_GenerationFlag): number
Convert one generation flag into its bit-mask value.
Parameters (1)theFlag—generation flag to convert
Returnsbit-mask value for the requested generation flag
- HasGenerationFlag(theFlags: number, theFlag: BRepGraph_LayerParametric_GenerationFlag): boolean
Return true when the flag mask contains the requested generation flag.
Parameters (2)theFlags—generation mask built from GenerationFlag bitstheFlag—generation flag to test
Returnstrue when the flag is present in the mask
- MeshQualityValue(theQuality: BRepGraph_LayerParametric_MeshQuality, theVeryCoarse: number, theCoarse: number, theMedium: number, theFine: number, theVeryFine: number): number
Select one integer value from a mesh-quality ladder.
Parameters (6)theQuality—requested shared mesh qualitytheVeryCoarse—value forMeshQuality::VeryCoarsetheCoarse—value forMeshQuality::CoarsetheMedium—value forMeshQuality::MediumtheFine—value forMeshQuality::FinetheVeryFine—value forMeshQuality::VeryFine
Returnsselected value for the requested quality
- get_type_name(): string
Instance methods(1)
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(23)
- 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.
- 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, theSlot?: number): { returnValue: boolean; theSlot: number }
Return current slot for a GUID.
Parameters (2)theGUIDtheSlot
ReturnsA result object with fields:
returnValue: the C++ return valuetheSlot: updated value from the call.
- Layer(theSlot: number): BRepGraph_Layer
Return layer by slot index, or null handle if the slot is out of range.
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): void
Dispatch OnNodeRemoved to all registered layers.
Parameters (1)theNode
- DispatchOnItemRemoved(theItem: BRepGraph_ItemId): void
Dispatch generic item removal to all registered layers.
Parameters (1)theItem
- DispatchOnNodeReplaced(theOldNode: BRepGraph_NodeId, theNewNode: BRepGraph_NodeId): void
Dispatch OnNodeReplaced to all registered layers.
Parameters (2)theOldNodetheNewNode
- DispatchNodeModified(theNode: BRepGraph_NodeId): void
Dispatch OnNodeModified to subscribed layers.
Parameters (1)theNode
- DispatchItemModified(theItem: BRepGraph_ItemId): void
Dispatch generic item modification through the matching typed subscription path.
Parameters (1)theItem
- DispatchNodesModified(theModifiedNodes: NCollection_Array1_BRepGraph_NodeId, theModifiedKindsMask: number): void
Dispatch OnNodesModified to subscribed layers.
Parameters (2)theModifiedNodestheModifiedKindsMask
- CopyLayersTo(theTargetGraph: BRepGraph, theItemRemap: any, theMode: BRepGraph_CopyRemap_Mode): void
Ask every registered source layer to copy itself into the target graph. For Mode::Compact, layers are unregistered first and CopyTo creates fresh instances.
Parameters (3)theTargetGraph—target graph to receive layer datatheItemRemap—source -> target item id mappingtheMode—Copy or Compact semantics
- CopyLayersTo(theTargetGraph: BRepGraph, theMappingKind: BRepGraph_CopyRemap_MappingKind, theMode: BRepGraph_CopyRemap_Mode): void
Ask every registered source layer to copy itself using identity mapping. Source item ids are the same as target item ids (full identity copy).
Parameters (3)theTargetGraph—target graph to receive layer datatheMappingKind—identity or explicit mappingtheMode—Copy or Compact semantics
- 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_Array1_BRepGraph_RefId, theModifiedRefKindsMask: number): void
Dispatch OnRefsModified to subscribed layers (deferred/batch mode).
Parameters (2)theModifiedRefstheModifiedRefKindsMask
- ClearAll(): void
Clear all registered layer data without unregistering services.
- InvalidateAll(): void
Invalidate all registered layer data.
BRepGraph_LayerTopoSupplement
Runtime-only storage for supplemental TopoDS topology fragments.
This layer stores non-core topology extracted from a source shape and attached to supported core graph owners. These attachments are not serialized and are intended only to preserve live TopoDS -> Graph -> TopoDS behavior.
Constructors(1)
Static methods(3)
Return the fixed layer type GUID.
- get_type_name(): string
Instance methods(14)
- ID(): Standard_GUID
Return the runtime type GUID for this layer instance.
Return a short stable layer name for diagnostics and registry lookup.
- FindByUid(theUid: number): BRepGraph_LayerTopoSupplement_Entry
Find one attachment entry by its layer-local uid.
Parameters (1)theUid—layer-local attachment uid
Returnspointer to the entry, or
nullptrwhen not found - AttachedTo(theOwner: BRepGraph_NodeId): number[]
Return all attachment uids currently owned by one core node.
Parameters (1)theOwner—core topology owner node
Returnsowner-local insertion-ordered list of attachment uids
- AddAttachment(theOwner: BRepGraph_NodeId, theKind: BRepGraph_LayerTopoSupplement_AttachmentKind, theShape: TopoDS_Shape): number
Add one supplemental shape attachment to a supported core owner node. Supported owner kinds are vertex, edge, face, shell, solid, compsolid, and compound.
Parameters (3)theOwner—active core topology ownertheKind—semantic attachment kindtheShape—attached supplemental shape
Returnsnon-zero layer-local uid on success,
0on rejection - AddAttachmentWithUid(theOwner: BRepGraph_NodeId, theUid: number, theKind: BRepGraph_LayerTopoSupplement_AttachmentKind, theShape: TopoDS_Shape): boolean
Add one supplemental shape attachment with an explicitly preserved uid. Supported owner kinds are vertex, edge, face, shell, solid, compsolid, and compound.
Parameters (4)theOwner—active core topology ownertheUid—layer-local attachment uid to preservetheKind—semantic attachment kindtheShape—attached supplemental shape
Returnstrueon success,falsewhen the uid or input is rejected - RemoveAttachment(theUid: number): boolean
Remove one supplemental attachment by uid.
Parameters (1)theUid—layer-local attachment uid
Returnstruewhen the attachment existed and was removed - Validate(): void
Validate internal owner/uid bookkeeping invariants.
- OnNodeRemoved(theNode: BRepGraph_NodeId): void
Drop all attachments owned by a removed node.
Parameters (1)theNode—removed core node
- OnNodeReplaced(theOldNode: BRepGraph_NodeId, theNewNode: BRepGraph_NodeId): void
Migrate attachments from one owner node to another compatible node.
Parameters (2)theOldNode—previous owner nodetheNewNode—replacement owner node
- CopyTo(theCopy: BRepGraph_CopyRemap): void
Copy remapped attachments to the target graph.
Parameters (1)theCopy
- InvalidateAll(): void
Invalidate all cached state in the layer.
- Clear(): void
Remove every stored supplemental attachment.
BRepGraph_MeshView
Instance methods(5)
BRepGraph_MeshView_CacheView
Instance methods(3)
BRepGraph_MeshView_CacheView_CoEdgeOps
Instance methods(4)
- Has(theCoEdge: BRepGraph_CoEdgeId): booleanParameters (1)
theCoEdge
- Parameters (1)
theCoEdge
- Parameters (1)
theCoEdge
- FindRaw(theCoEdge: BRepGraph_CoEdgeId): BRepGraph_CacheMesh_CoEdgeMeshEntryParameters (1)
theCoEdge
BRepGraph_MeshView_CacheView_EdgeOps
Instance methods(3)
- Has(theEdge: BRepGraph_EdgeId): booleanParameters (1)
theEdge
- Polygon3D(theEdge: BRepGraph_EdgeId): Poly_Polygon3DParameters (1)
theEdge
- Parameters (1)
theEdge
BRepGraph_MeshView_CacheView_FaceOps
Instance methods(3)
- Has(theFace: BRepGraph_FaceId): booleanParameters (1)
theFace
- Triangulation(theFace: BRepGraph_FaceId): Poly_TriangulationParameters (1)
theFace
- Parameters (1)
theFace
BRepGraph_MeshView_EditorView
Instance methods(4)
- PromoteToPersistent(): void
BRepGraph_MeshView_EditorView_CoEdgeOps
Instance methods(3)
- AppendCachedPolygonOnTri(theCoEdge: BRepGraph_CoEdgeId, thePolygonOnTri: Poly_PolygonOnTriangulation): voidParameters (2)
theCoEdgethePolygonOnTri
- SetCachedPolygon2D(theCoEdge: BRepGraph_CoEdgeId, thePolygon2D: Poly_Polygon2D): voidParameters (2)
theCoEdgethePolygon2D
- Clear(theCoEdge: BRepGraph_CoEdgeId): voidParameters (1)
theCoEdge
BRepGraph_MeshView_EditorView_EdgeOps
Instance methods(2)
- SetCachedPolygon3D(theEdge: BRepGraph_EdgeId, thePolygon3D: Poly_Polygon3D): voidParameters (2)
theEdgethePolygon3D
- Clear(theEdge: BRepGraph_EdgeId): voidParameters (1)
theEdge
BRepGraph_MeshView_EditorView_FaceOps
Instance methods(2)
- SetCachedTriangulation(theFace: BRepGraph_FaceId, theTriangulation: Poly_Triangulation): voidParameters (2)
theFacetheTriangulation
- Clear(theFace: BRepGraph_FaceId): voidParameters (1)
theFace
BRepGraph_MeshView_EffectiveView
Instance methods(3)
BRepGraph_MeshView_EffectiveView_CoEdgeOps
Instance methods(5)
- Has(theCoEdge: BRepGraph_CoEdgeId): booleanParameters (1)
theCoEdge
- HasPolygonOnSurface(theCoEdge: BRepGraph_CoEdgeId): booleanParameters (1)
theCoEdge
- PolygonOnSurface(theCoEdge: BRepGraph_CoEdgeId): Poly_Polygon2DParameters (1)
theCoEdge
- HasPolygonOnTriangulation(theCoEdge: BRepGraph_CoEdgeId): booleanParameters (1)
theCoEdge
- Parameters (1)
theCoEdge
BRepGraph_MeshView_EffectiveView_EdgeOps
Instance methods(2)
- Has(theEdge: BRepGraph_EdgeId): booleanParameters (1)
theEdge
- Polygon3D(theEdge: BRepGraph_EdgeId): Poly_Polygon3DParameters (1)
theEdge
BRepGraph_MeshView_EffectiveView_FaceOps
Instance methods(2)
- Has(theFace: BRepGraph_FaceId): booleanParameters (1)
theFace
- Triangulation(theFace: BRepGraph_FaceId): Poly_TriangulationParameters (1)
theFace
BRepGraph_MeshView_PersistentView
Instance methods(3)
BRepGraph_MeshView_PersistentView_CoEdgeOps
Instance methods(4)
- Has(theCoEdge: BRepGraph_CoEdgeId): booleanParameters (1)
theCoEdge
- PolygonOnSurface(theCoEdge: BRepGraph_CoEdgeId): Poly_Polygon2DParameters (1)
theCoEdge
- HasPolygonOnTriangulation(theCoEdge: BRepGraph_CoEdgeId): booleanParameters (1)
theCoEdge
- Parameters (1)
theCoEdge
BRepGraph_MeshView_PersistentView_EdgeOps
Instance methods(4)
- Has(theEdge: BRepGraph_EdgeId): booleanParameters (1)
theEdge
- Polygon3D(theEdge: BRepGraph_EdgeId): Poly_Polygon3DParameters (1)
theEdge
- HasPolygonOnTriangulation(theEdge: BRepGraph_EdgeId, theFace: BRepGraph_FaceId): booleanParameters (2)
theEdgetheFace
- PolygonOnTriangulation(theEdge: BRepGraph_EdgeId, theFace: BRepGraph_FaceId): Poly_PolygonOnTriangulationParameters (2)
theEdgetheFace
BRepGraph_MeshView_PersistentView_FaceOps
Instance methods(2)
- Has(theFace: BRepGraph_FaceId): booleanParameters (1)
theFace
- Triangulation(theFace: BRepGraph_FaceId): Poly_TriangulationParameters (1)
theFace
BRepGraph_MeshView_PolyOps
Instance methods(8)
- NbFaceTriangulations(): number
- NbEdgePolygons3D(): number
- NbCoEdgePolygons2D(): number
- NbCoEdgePolygonsOnTri(): number
- NbActiveTriangulations(): number
- NbActivePolygons3D(): number
- NbActivePolygons2D(): number
- NbActivePolygonsOnTri(): number
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(5)
- IsValidKind(theKind: BRepGraph_NodeId_Kind): boolean
True if the kind value is one of the supported node kinds.
Parameters (1)theKind
- 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(4)
- IsValid(): boolean
True if this id points to an allocated node slot.
- IsValid(theMaxCount: number): boolean
True if this id points to an allocated slot within [0, theMaxCount). UINT32_MAX (invalid sentinel) always fails this check for any realistic count.
Parameters (1)theMaxCount
Return true if this node has been soft-removed in the given graph.
Parameters (1)theGraph
Return true if this node has an active owner in the given graph.
Parameters (1)theGraph
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(4)
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(4)
Properties(1)
BRepGraph_OccurrencesOfChild
Constructors(2)
- constructor(theGraph: BRepGraph, theRefs: BRepGraph_OccurrenceRefId[]): BRepGraph_OccurrencesOfChildParameters (2)
theGraphtheRefs
- constructor(theGraph: BRepGraph, theRefs: BRepGraph_OccurrenceRefId[], theStartIndex: number): BRepGraph_OccurrencesOfChildParameters (3)
theGraphtheRefstheStartIndex
Instance methods(9)
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)theAllowParallel—whether parallel mode is allowed by the callertheWorkers—effective logical worker counttheWorkload—estimated workload for the phase
Returnstrue if parallel execution should be used
- ShouldRun(theAllowParallel: boolean, theWorkload: BRepGraph_ParallelPolicy_Workload): boolean
Overload that queries the active worker count lazily.
Parameters (2)theAllowParallel—whether parallel mode is allowed by the callertheWorkload—estimated workload for the phase
Returnstrue if parallel execution should be used
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, topology root -> Occurrence, Product child -> Occurrence, Occurrence -> parent Product.
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)theGraph—graph to walktheNode—starting node whose ancestors are explored
- 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
Explore parents of the starting node using the given traversal mode.
Parameters (3)theGraph—graph to walktheNode—starting node whose ancestors are exploredtheMode—traversal strategy (recursive or direct parents)
- constructor(theGraph: BRepGraph, theNode: BRepGraph_NodeId, theTargetKind: BRepGraph_NodeId_Kind): BRepGraph_ParentExplorer
Explore only parents of the given kind.
Parameters (3)theGraph—graph to walktheNode—starting node whose ancestors are exploredtheTargetKind—kind of nodes to emit
- 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)theGraph—graph to walktheNode—starting node whose ancestors are exploredtheTargetKind—kind of nodes to emittheMode—traversal strategy
- 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)theGraph—graph to walktheNode—starting node whose ancestors are exploredtheAvoidKind—node kind to avoid ascending throughtheEmitAvoidKind—if true, emit matching avoid-kind ancestors oncetheMode—traversal strategy
- 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)theGraph—graph to walktheNode—starting node whose ancestors are exploredtheTargetKind—kind of nodes to emittheAvoidKind—node kind to avoid ascending throughtheEmitAvoidKind—if true, emit matching avoid-kind ancestors oncetheMode—traversal strategy
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 and Occurrence->Product/topology-root.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_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(4)
Properties(1)
BRepGraph_ProductsOfOccurrence
Constructors(2)
- constructor(theGraph: BRepGraph, theRefs: BRepGraph_OccurrenceRefId[]): BRepGraph_ProductsOfOccurrenceParameters (2)
theGraphtheRefs
- constructor(theGraph: BRepGraph, theRefs: BRepGraph_OccurrenceRefId[], theStartIndex: number): BRepGraph_ProductsOfOccurrenceParameters (3)
theGraphtheRefstheStartIndex
Instance methods(9)
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(4)
- IsValidKind(theKind: BRepGraph_RefId_Kind): boolean
True if the kind value is one of the supported reference kinds.
Parameters (1)theKind
- 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(4)
- IsValid(): boolean
- IsValid(theMaxCount: number): boolean
True if this id points to an allocated slot within [0, theMaxCount). UINT32_MAX (invalid sentinel) always fails this check for any realistic count.
Parameters (1)theMaxCount
Return true if this reference entry has been soft-removed in the given graph.
Parameters (1)theGraph
Return true if this reference entry has an active owner in the given graph.
Parameters (1)theGraph
Properties(2)
BRepGraph_RefUID
Unique reference-entry identifier within a BRepGraph.
Identity = (RefKind, Counter). Counter 0 is an invalid sentinel.
Constructors(2)
- constructor(theKind: BRepGraph_RefId_Kind, theCounter: number): BRepGraph_RefUIDParameters (2)
theKindtheCounter