Open CASCADE Technology Reference Manual 8.0.0
Loading...
Searching...
No Matches
Data Structures | Public Types | Public Member Functions | Static Public Member Functions | Data Fields | Static Public Attributes
BRepGraph_NodeId Struct Reference

Lightweight typed index into a per-kind node vector inside BRepGraph. More...

#include <BRepGraph_NodeId.hxx>

Data Structures

struct  Typed
 Compile-time typed wrapper around BRepGraph_NodeId. More...
 

Public Types

enum class  Kind : int {
  Solid = 0 , Shell = 1 , Face = 2 , Wire = 3 ,
  Edge = 4 , Vertex = 5 , Compound = 6 , CompSolid = 7 ,
  CoEdge = 8 , Product = 10 , Occurrence = 11
}
 Enumeration of node kinds within a BRepGraph. More...
 

Public Member Functions

 BRepGraph_NodeId ()
 Default: invalid NodeId (Index = UINT32_MAX). NodeKind is set to Kind::Solid but is meaningless when !IsValid().
 
 BRepGraph_NodeId (const Kind theKind, const uint32_t theIdx)
 
bool IsValid () const
 True if this id points to an allocated node slot.
 
bool IsValid (const uint32_t theMaxCount) const
 True if this id points to an allocated slot within [0, theMaxCount). UINT32_MAX (invalid sentinel) always fails this check for any realistic count.
 
template<typename CountProviderT >
auto IsValidIn (const CountProviderT &theProvider) const -> decltype(theProvider.Nb(), bool())
 True if this id is within the dense range exposed by a provider with Nb().
 
template<typename CountProviderT >
auto IsValidIn (const CountProviderT &theProvider) const -> decltype(theProvider.Size(), bool())
 True if this id is within the dense range exposed by a provider with Size().
 
bool operator== (const BRepGraph_NodeId &theOther) const
 
bool operator!= (const BRepGraph_NodeId &theOther) const
 
bool operator< (const BRepGraph_NodeId &theOther) const
 
BRepGraph_NodeIdoperator++ ()
 Pre-increment (++id).
 
BRepGraph_NodeId operator++ (int)
 Post-increment (id++).
 
BRepGraph_NodeId operator+ (const uint32_t theOffset) const
 Advance by offset.
 
BRepGraph_NodeId operator- (const uint32_t theOffset) const
 Retreat by offset.
 

Static Public Member Functions

static bool IsTopologyKind (const Kind theKind)
 True if the kind is a core topology kind (Solid..CoEdge).
 
static bool IsAssemblyKind (const Kind theKind)
 True if the kind is an assembly kind (Product or Occurrence).
 
static BRepGraph_NodeId Start (const Kind theKind)
 First valid id in a dense sequence for the specified kind.
 
static BRepGraph_NodeId Invalid (const Kind theKind=Kind::Solid)
 Invalid sentinel id for the specified kind.
 
template<typename FuncT >
static auto Visit (const BRepGraph_NodeId theNodeId, FuncT &&theFunc) -> decltype(std::forward< FuncT >(theFunc)(Typed< Kind::Vertex >()))
 Dispatch a generic node id to a callable taking the matching typed node id.
 

Data Fields

Kind NodeKind
 
uint32_t Index
 

Static Public Attributes

static constexpr int THE_KIND_COUNT = static_cast<int>(Kind::Occurrence) + 1
 Total number of dense kind slots used by per-kind arrays. Includes the reserved gap at enum value 9.
 
static constexpr uint32_t THE_START_INDEX = 0u
 
static constexpr uint32_t THE_INVALID_INDEX = std::numeric_limits<uint32_t>::max()
 

Detailed Description

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.

Member Enumeration Documentation

◆ Kind

Enumeration of node kinds within a BRepGraph.

Topology kinds 0-5 cover core hierarchy; Compound(6)/CompSolid(7) are container kinds. Note: ordering does NOT match TopAbs_ShapeEnum. Geometry kinds start at 10, leaving room for future topology extensions.

Enumerator
Solid 
Shell 
Face 
Wire 
Edge 
Vertex 
Compound 

TopoDS_Compound container.

CompSolid 

TopoDS_CompSolid container.

CoEdge 

Use of an edge on a face (owns PCurve data)

Product 

Reusable shape definition (part or assembly)

Occurrence 

Placed instance of a product within a parent product.

Constructor & Destructor Documentation

◆ BRepGraph_NodeId() [1/2]

BRepGraph_NodeId::BRepGraph_NodeId ( )
inline

Default: invalid NodeId (Index = UINT32_MAX). NodeKind is set to Kind::Solid but is meaningless when !IsValid().

◆ BRepGraph_NodeId() [2/2]

BRepGraph_NodeId::BRepGraph_NodeId ( const Kind theKind,
const uint32_t theIdx )
inline

Member Function Documentation

◆ Invalid()

static BRepGraph_NodeId BRepGraph_NodeId::Invalid ( const Kind theKind = Kind::Solid)
inlinestatic

Invalid sentinel id for the specified kind.

◆ IsAssemblyKind()

static bool BRepGraph_NodeId::IsAssemblyKind ( const Kind theKind)
inlinestatic

True if the kind is an assembly kind (Product or Occurrence).

◆ IsTopologyKind()

static bool BRepGraph_NodeId::IsTopologyKind ( const Kind theKind)
inlinestatic

True if the kind is a core topology kind (Solid..CoEdge).

◆ IsValid() [1/2]

bool BRepGraph_NodeId::IsValid ( ) const
inline

True if this id points to an allocated node slot.

◆ IsValid() [2/2]

bool BRepGraph_NodeId::IsValid ( const uint32_t theMaxCount) const
inline

True if this id points to an allocated slot within [0, theMaxCount). UINT32_MAX (invalid sentinel) always fails this check for any realistic count.

◆ IsValidIn() [1/2]

auto BRepGraph_NodeId::IsValidIn ( const CountProviderT & theProvider) const -> decltype(theProvider.Nb(), bool())
inline

True if this id is within the dense range exposed by a provider with Nb().

◆ IsValidIn() [2/2]

auto BRepGraph_NodeId::IsValidIn ( const CountProviderT & theProvider) const -> decltype(theProvider.Size(), bool())
inline

True if this id is within the dense range exposed by a provider with Size().

◆ operator!=()

bool BRepGraph_NodeId::operator!= ( const BRepGraph_NodeId & theOther) const
inline

◆ operator+()

BRepGraph_NodeId BRepGraph_NodeId::operator+ ( const uint32_t theOffset) const
inline

Advance by offset.

◆ operator++() [1/2]

BRepGraph_NodeId & BRepGraph_NodeId::operator++ ( )
inline

Pre-increment (++id).

◆ operator++() [2/2]

BRepGraph_NodeId BRepGraph_NodeId::operator++ ( int )
inline

Post-increment (id++).

◆ operator-()

BRepGraph_NodeId BRepGraph_NodeId::operator- ( const uint32_t theOffset) const
inline

Retreat by offset.

◆ operator<()

bool BRepGraph_NodeId::operator< ( const BRepGraph_NodeId & theOther) const
inline

◆ operator==()

bool BRepGraph_NodeId::operator== ( const BRepGraph_NodeId & theOther) const
inline

◆ Start()

static BRepGraph_NodeId BRepGraph_NodeId::Start ( const Kind theKind)
inlinestatic

First valid id in a dense sequence for the specified kind.

◆ Visit()

template<typename FuncT >
static auto BRepGraph_NodeId::Visit ( const BRepGraph_NodeId theNodeId,
FuncT && theFunc ) -> decltype(std::forward<FuncT>(theFunc)(Typed<Kind::Vertex>()))
inlinestatic

Dispatch a generic node id to a callable taking the matching typed node id.

Field Documentation

◆ Index

uint32_t BRepGraph_NodeId::Index

◆ NodeKind

Kind BRepGraph_NodeId::NodeKind

◆ THE_INVALID_INDEX

constexpr uint32_t BRepGraph_NodeId::THE_INVALID_INDEX = std::numeric_limits<uint32_t>::max()
staticconstexpr

◆ THE_KIND_COUNT

constexpr int BRepGraph_NodeId::THE_KIND_COUNT = static_cast<int>(Kind::Occurrence) + 1
staticconstexpr

Total number of dense kind slots used by per-kind arrays. Includes the reserved gap at enum value 9.

◆ THE_START_INDEX

constexpr uint32_t BRepGraph_NodeId::THE_START_INDEX = 0u
staticconstexpr

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