Open CASCADE Technology Reference Manual 8.0.2
Loading...
Searching...
No Matches
BRepGraph::UIDsView Class Reference

Read-only view for persistent node and reference identifiers. More...

#include <BRepGraph_UIDsView.hxx>

Public Member Functions

BRepGraph_UID Of (const BRepGraph_NodeId theNode) const
 Return the UID assigned to a node.
BRepGraph_RefUID Of (const BRepGraph_RefId theRefId) const
 Return the RefUID assigned to a reference.
BRepGraph_ItemUID Of (const BRepGraph_ItemId theItem) const
 Return the persistent UID assigned to a generic graph item.
BRepGraph_NodeId NodeIdFrom (const BRepGraph_UID &theUID) const
 Resolve a UID back to a NodeId using the internal reverse index.
BRepGraph_RefId RefIdFrom (const BRepGraph_RefUID &theUID) const
 Resolve a RefUID back to a RefId using the internal reverse index.
BRepGraph_ItemId ItemIdFrom (const BRepGraph_ItemUID &theUID) const
 Resolve a generic item UID back to a transient item id.
bool Has (const BRepGraph_UID &theUID) const
 Check if a UID is valid and exists in this graph generation.
bool Has (const BRepGraph_RefUID &theUID) const
 Check if a RefUID is valid and exists in this graph generation.
bool Has (const BRepGraph_ItemUID &theUID) const
 Check if a generic item UID exists in this graph generation.
uint32_t Generation () const
 Return the current generation counter (incremented on each BRepGraph::Clear()).
const Standard_GUID & GraphGUID () const
 Return the graph-level identity GUID. Generated randomly at BRepGraph::Clear() time; changes on each rebuild.
BRepGraph_VersionStamp StampOf (const BRepGraph_NodeId theNode) const
 Produce a version stamp for the given node. Combines the node's UID with its current OwnGen and graph Generation.
BRepGraph_VersionStamp StampOf (const BRepGraph_RefId theRefId) const
 Produce a version stamp for the given reference. Combines the reference's RefUID with its current OwnGen and graph Generation.
BRepGraph_VersionStamp StampOf (const BRepGraph_RepId theRepId) const
 Produce a version stamp for an owner-scoped use record. Use records have no durable UID or mutation generation; the stamp uses the owning definition-node UID, OwnGen, and graph Generation.
BRepGraph_VersionStamp StampOf (const BRepGraph_ItemId theItem) const
 Produce a version stamp for the given definition-node or reference-entry item.
bool IsStale (const BRepGraph_VersionStamp &theStamp) const
 Check if a previously-taken stamp is stale. A stamp is stale when the stamped item has been mutated, removed, or the graph was rebuilt since the stamp was taken.

Detailed Description

Read-only view for persistent node and reference identifiers.

UIDs are (Kind, Counter) pairs that persist across graph mutations (Compact, node removal). Counters are monotonic and independent of vector indices. Clear() starts a new graph generation and refreshes the graph GUID, enabling stale-reference detection when a graph is rebuilt. Provides bidirectional NodeId/UID and RefId/RefUID resolution.

Version stamps are exposed here for graph-owned cache and layer freshness checks. They reuse node/reference UID identity and do not introduce a persistent representation identity.

Member Function Documentation

◆ Generation()

uint32_t BRepGraph::UIDsView::Generation ( ) const
nodiscard

Return the current generation counter (incremented on each BRepGraph::Clear()).

Returns
graph generation number

◆ GraphGUID()

const Standard_GUID & BRepGraph::UIDsView::GraphGUID ( ) const
nodiscard

Return the graph-level identity GUID. Generated randomly at BRepGraph::Clear() time; changes on each rebuild.

Returns
reference to the graph identity GUID

◆ Has() [1/3]

bool BRepGraph::UIDsView::Has ( const BRepGraph_ItemUID & theUID) const
nodiscard

Check if a generic item UID exists in this graph generation.

◆ Has() [2/3]

bool BRepGraph::UIDsView::Has ( const BRepGraph_RefUID & theUID) const
nodiscard

Check if a RefUID is valid and exists in this graph generation.

Parameters
[in]theUIDunique reference identifier to check
Returns
true if the RefUID resolves to an active reference in this graph generation

◆ Has() [3/3]

bool BRepGraph::UIDsView::Has ( const BRepGraph_UID & theUID) const
nodiscard

Check if a UID is valid and exists in this graph generation.

Parameters
[in]theUIDunique identifier to check
Returns
true if the UID resolves to an active node in this graph generation

◆ IsStale()

bool BRepGraph::UIDsView::IsStale ( const BRepGraph_VersionStamp & theStamp) const
nodiscard

Check if a previously-taken stamp is stale. A stamp is stale when the stamped item has been mutated, removed, or the graph was rebuilt since the stamp was taken.

Parameters
[in]theStampversion stamp to check
Returns
true if the stamp no longer matches the current graph state

◆ ItemIdFrom()

BRepGraph_ItemId BRepGraph::UIDsView::ItemIdFrom ( const BRepGraph_ItemUID & theUID) const
nodiscard

Resolve a generic item UID back to a transient item id.

Parameters
[in]theUIDdurable node/reference item identity
Returns
active item id, or invalid item id if the UID cannot be resolved

◆ NodeIdFrom()

BRepGraph_NodeId BRepGraph::UIDsView::NodeIdFrom ( const BRepGraph_UID & theUID) const
nodiscard

Resolve a UID back to a NodeId using the internal reverse index.

Parameters
[in]theUIDunique identifier to resolve
Returns
corresponding active NodeId, or invalid NodeId if not found/removed

◆ Of() [1/3]

BRepGraph_ItemUID BRepGraph::UIDsView::Of ( const BRepGraph_ItemId theItem) const
nodiscard

Return the persistent UID assigned to a generic graph item.

Parameters
[in]theItemdefinition-node or reference-entry item id
Returns
durable item UID, or invalid UID if the item is out of bounds or removed

◆ Of() [2/3]

BRepGraph_UID BRepGraph::UIDsView::Of ( const BRepGraph_NodeId theNode) const
nodiscard

Return the UID assigned to a node.

Parameters
[in]theNodenode identifier
Returns
UID for the active node, or invalid UID if theNode is out of bounds or removed

◆ Of() [3/3]

BRepGraph_RefUID BRepGraph::UIDsView::Of ( const BRepGraph_RefId theRefId) const
nodiscard

Return the RefUID assigned to a reference.

Parameters
[in]theRefIdreference identifier
Returns
RefUID for the active reference, or invalid RefUID if theRefId is out of bounds or removed

◆ RefIdFrom()

BRepGraph_RefId BRepGraph::UIDsView::RefIdFrom ( const BRepGraph_RefUID & theUID) const
nodiscard

Resolve a RefUID back to a RefId using the internal reverse index.

Parameters
[in]theUIDunique reference identifier to resolve
Returns
corresponding active RefId, or invalid RefId if not found/removed

◆ StampOf() [1/4]

BRepGraph_VersionStamp BRepGraph::UIDsView::StampOf ( const BRepGraph_ItemId theItem) const
nodiscard

Produce a version stamp for the given definition-node or reference-entry item.

◆ StampOf() [2/4]

BRepGraph_VersionStamp BRepGraph::UIDsView::StampOf ( const BRepGraph_NodeId theNode) const
nodiscard

Produce a version stamp for the given node. Combines the node's UID with its current OwnGen and graph Generation.

Parameters
[in]theNodenode identifier
Returns
version stamp, or invalid stamp if theNode is invalid, removed, or out of bounds

◆ StampOf() [3/4]

BRepGraph_VersionStamp BRepGraph::UIDsView::StampOf ( const BRepGraph_RefId theRefId) const
nodiscard

Produce a version stamp for the given reference. Combines the reference's RefUID with its current OwnGen and graph Generation.

Parameters
[in]theRefIdreference identifier
Returns
version stamp, or invalid stamp if theRefId is invalid, removed, or out of bounds

◆ StampOf() [4/4]

BRepGraph_VersionStamp BRepGraph::UIDsView::StampOf ( const BRepGraph_RepId theRepId) const
nodiscard

Produce a version stamp for an owner-scoped use record. Use records have no durable UID or mutation generation; the stamp uses the owning definition-node UID, OwnGen, and graph Generation.

Parameters
[in]theRepIduse-record identifier
Returns
version stamp, or invalid stamp if theRepId is invalid, removed, or out of bounds

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