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_RefId Struct Reference

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

#include <BRepGraph_RefId.hxx>

Data Structures

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

Public Types

enum class  Kind : int {
  Shell = 0 , Face = 1 , Wire = 2 , CoEdge = 3 ,
  Vertex = 4 , Solid = 5 , Child = 6 , Occurrence = 7
}
 Enumeration of supported topology reference kinds. More...
 

Public Member Functions

 BRepGraph_RefId ()
 
 BRepGraph_RefId (const Kind theKind, const uint32_t theIdx)
 
bool IsValid () const
 
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())
 
template<typename CountProviderT >
auto IsValidIn (const CountProviderT &theProvider) const -> decltype(theProvider.Size(), bool())
 
bool operator== (const BRepGraph_RefId &theOther) const
 
bool operator!= (const BRepGraph_RefId &theOther) const
 
bool operator< (const BRepGraph_RefId &theOther) const
 
BRepGraph_RefIdoperator++ ()
 Pre-increment (++id).
 
BRepGraph_RefId operator++ (int)
 Post-increment (id++).
 
BRepGraph_RefId operator+ (const uint32_t theOffset) const
 Advance by offset.
 
BRepGraph_RefId operator- (const uint32_t theOffset) const
 Retreat by offset.
 

Static Public Member Functions

static bool IsTopologyRefKind (const Kind theKind)
 
static BRepGraph_RefId Start (const Kind theKind)
 First valid id in a dense sequence for the specified kind.
 
static BRepGraph_RefId Invalid (const Kind theKind=Kind::Shell)
 Invalid sentinel id for the specified kind.
 
template<typename FuncT >
static auto Visit (const BRepGraph_RefId theRefId, FuncT &&theFunc) -> decltype(std::forward< FuncT >(theFunc)(Typed< Kind::Shell >()))
 Dispatch a generic ref id to a callable taking the matching typed ref id.
 

Data Fields

Kind RefKind
 
uint32_t Index
 

Static Public Attributes

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 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).

Member Enumeration Documentation

◆ Kind

Enumeration of supported topology reference kinds.

Enumerator
Shell 

Shell reference entries (usage of shell definitions)

Face 

Face reference entries (usage of face definitions)

Wire 

Wire reference entries (usage of wire definitions)

CoEdge 

CoEdge reference entries (usage of coedge definitions)

Vertex 

Vertex reference entries (usage of vertex definitions)

Solid 

Solid reference entries (usage of solid definitions)

Child 

Generic child references (usage of mixed node definitions)

Occurrence 

Occurrence references (usage of occurrence definitions)

Constructor & Destructor Documentation

◆ BRepGraph_RefId() [1/2]

BRepGraph_RefId::BRepGraph_RefId ( )
inline

◆ BRepGraph_RefId() [2/2]

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

Member Function Documentation

◆ Invalid()

static BRepGraph_RefId BRepGraph_RefId::Invalid ( const Kind theKind = Kind::Shell)
inlinestatic

Invalid sentinel id for the specified kind.

◆ IsTopologyRefKind()

static bool BRepGraph_RefId::IsTopologyRefKind ( const Kind theKind)
inlinestatic

◆ IsValid() [1/2]

bool BRepGraph_RefId::IsValid ( ) const
inline

◆ IsValid() [2/2]

bool BRepGraph_RefId::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_RefId::IsValidIn ( const CountProviderT & theProvider) const -> decltype(theProvider.Nb(), bool())
inline

◆ IsValidIn() [2/2]

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

◆ operator!=()

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

◆ operator+()

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

Advance by offset.

◆ operator++() [1/2]

BRepGraph_RefId & BRepGraph_RefId::operator++ ( )
inline

Pre-increment (++id).

◆ operator++() [2/2]

BRepGraph_RefId BRepGraph_RefId::operator++ ( int )
inline

Post-increment (id++).

◆ operator-()

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

Retreat by offset.

◆ operator<()

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

◆ operator==()

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

◆ Start()

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

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

◆ Visit()

template<typename FuncT >
static auto BRepGraph_RefId::Visit ( const BRepGraph_RefId theRefId,
FuncT && theFunc ) -> decltype(std::forward<FuncT>(theFunc)(Typed<Kind::Shell>()))
inlinestatic

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

Field Documentation

◆ Index

uint32_t BRepGraph_RefId::Index

◆ RefKind

Kind BRepGraph_RefId::RefKind

◆ THE_INVALID_INDEX

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

◆ THE_START_INDEX

constexpr uint32_t BRepGraph_RefId::THE_START_INDEX = 0u
staticconstexpr

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