Open CASCADE Technology Reference Manual 8.0.2
Loading...
Searching...
No Matches
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 , Vertex = 3 ,
  Solid = 4 , Child = 5 , Occurrence = 6
}
 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_RefId & operator++ ()
 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.
bool IsRemoved (const BRepGraph &theGraph) const
 Return true if this reference entry has been soft-removed in the given graph.
bool IsOwned (const BRepGraph &theGraph) const
 Return true if this reference entry has an active owner in the given graph.

Static Public Member Functions

static bool IsValidKind (const Kind theKind)
 True if the kind value is one of the supported reference kinds.
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

enum class BRepGraph_RefId::Kind : int
strong

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)

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

BRepGraph_RefId BRepGraph_RefId::Invalid ( const Kind theKind = Kind::Shell)
inlinestaticnodiscard

Invalid sentinel id for the specified kind.

◆ IsOwned()

bool BRepGraph_RefId::IsOwned ( const BRepGraph & theGraph) const
nodiscard

Return true if this reference entry has an active owner in the given graph.

◆ IsRemoved()

bool BRepGraph_RefId::IsRemoved ( const BRepGraph & theGraph) const
nodiscard

Return true if this reference entry has been soft-removed in the given graph.

◆ IsTopologyRefKind()

bool BRepGraph_RefId::IsTopologyRefKind ( const Kind theKind)
inlinestatic

◆ IsValid() [1/2]

bool BRepGraph_RefId::IsValid ( ) const
inlinenodiscard

◆ IsValid() [2/2]

bool BRepGraph_RefId::IsValid ( const uint32_t theMaxCount) const
inlinenodiscard

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]

template<typename CountProviderT>
auto BRepGraph_RefId::IsValidIn ( const CountProviderT & theProvider) const -> decltype(theProvider.Nb(), bool())
inlinenodiscard

◆ IsValidIn() [2/2]

template<typename CountProviderT>
auto BRepGraph_RefId::IsValidIn ( const CountProviderT & theProvider) const -> decltype(theProvider.Size(), bool())
inlinenodiscard

◆ IsValidKind()

bool BRepGraph_RefId::IsValidKind ( const Kind theKind)
inlinestatic

True if the kind value is one of the supported reference kinds.

◆ operator!=()

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

◆ operator+()

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

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
inlinenodiscard

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

BRepGraph_RefId BRepGraph_RefId::Start ( const Kind theKind)
inlinestaticnodiscard

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

◆ Visit()

template<typename FuncT>
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

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

◆ THE_START_INDEX

uint32_t BRepGraph_RefId::THE_START_INDEX = 0u
staticconstexpr

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