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

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

#include <BRepGraph_RepId.hxx>

Data Structures

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

Public Types

enum class  Kind : int {
  Surface = 0 , Curve3D = 1 , Curve2D = 2 , Triangulation = 3 ,
  Polygon3D = 4 , Polygon2D = 5 , PolygonOnTri = 6
}
 Categories of representation data. More...
 

Public Member Functions

 BRepGraph_RepId ()
 Default: invalid RepId (Index = UINT32_MAX). RepKind is set to Kind::Surface but is meaningless when !IsValid().
 
 BRepGraph_RepId (const Kind theKind, const uint32_t theIdx)
 
bool IsValid () const
 True if this id points to an allocated representation 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_RepId &theOther) const
 
bool operator!= (const BRepGraph_RepId &theOther) const
 
bool operator< (const BRepGraph_RepId &theOther) const
 
BRepGraph_RepIdoperator++ ()
 Pre-increment (++id).
 
BRepGraph_RepId operator++ (int)
 Post-increment (id++).
 
BRepGraph_RepId operator+ (const uint32_t theOffset) const
 Advance by offset.
 
BRepGraph_RepId operator- (const uint32_t theOffset) const
 Retreat by offset.
 

Static Public Member Functions

static bool IsGeometryKind (const Kind theKind)
 True if the kind is a geometry kind (Surface, Curve3D, Curve2D).
 
static bool IsMeshKind (const Kind theKind)
 True if the kind is a mesh kind (Triangulation, Polygon3D, Polygon2D, PolygonOnTri).
 
static BRepGraph_RepId Start (const Kind theKind)
 First valid id in a dense sequence for the specified kind.
 
static BRepGraph_RepId Invalid (const Kind theKind=Kind::Surface)
 Invalid sentinel id for the specified kind.
 
template<typename FuncT >
static auto Visit (const BRepGraph_RepId theRepId, FuncT &&theFunc) -> decltype(std::forward< FuncT >(theFunc)(Typed< Kind::Surface >()))
 Dispatch a generic rep id to a callable taking the matching typed rep id.
 

Data Fields

Kind RepKind
 
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 representation vector inside BRepGraph.

The pair (Kind, Index) forms a unique representation identifier within one graph instance. Default-constructed RepId has Index = UINT32_MAX (invalid).

Representations are NOT topology nodes - they hold geometry or mesh data referenced by topology entities. They do not participate in BFS traversal, reverse index, or parent-child relationships.

RepId is a value type: cheap to copy, compare, hash.

Member Enumeration Documentation

◆ Kind

Categories of representation data.

Enumerator
Surface 

Geom_Surface for faces.

Curve3D 

Geom_Curve for edges.

Curve2D 

Geom2d_Curve for coedges (PCurve geometry)

Triangulation 

Poly_Triangulation for faces.

Polygon3D 

Poly_Polygon3D for edges.

Polygon2D 

Poly_Polygon2D for coedges (polygon-on-surface)

PolygonOnTri 

Poly_PolygonOnTriangulation for coedges.

Constructor & Destructor Documentation

◆ BRepGraph_RepId() [1/2]

BRepGraph_RepId::BRepGraph_RepId ( )
inline

Default: invalid RepId (Index = UINT32_MAX). RepKind is set to Kind::Surface but is meaningless when !IsValid().

◆ BRepGraph_RepId() [2/2]

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

Member Function Documentation

◆ Invalid()

static BRepGraph_RepId BRepGraph_RepId::Invalid ( const Kind theKind = Kind::Surface)
inlinestatic

Invalid sentinel id for the specified kind.

◆ IsGeometryKind()

static bool BRepGraph_RepId::IsGeometryKind ( const Kind theKind)
inlinestatic

True if the kind is a geometry kind (Surface, Curve3D, Curve2D).

◆ IsMeshKind()

static bool BRepGraph_RepId::IsMeshKind ( const Kind theKind)
inlinestatic

True if the kind is a mesh kind (Triangulation, Polygon3D, Polygon2D, PolygonOnTri).

◆ IsValid() [1/2]

bool BRepGraph_RepId::IsValid ( ) const
inline

True if this id points to an allocated representation slot.

◆ IsValid() [2/2]

bool BRepGraph_RepId::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_RepId::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_RepId::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_RepId::operator!= ( const BRepGraph_RepId & theOther) const
inline

◆ operator+()

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

Advance by offset.

◆ operator++() [1/2]

BRepGraph_RepId & BRepGraph_RepId::operator++ ( )
inline

Pre-increment (++id).

◆ operator++() [2/2]

BRepGraph_RepId BRepGraph_RepId::operator++ ( int )
inline

Post-increment (id++).

◆ operator-()

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

Retreat by offset.

◆ operator<()

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

◆ operator==()

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

◆ Start()

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

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

◆ Visit()

template<typename FuncT >
static auto BRepGraph_RepId::Visit ( const BRepGraph_RepId theRepId,
FuncT && theFunc ) -> decltype(std::forward<FuncT>(theFunc)(Typed<Kind::Surface>()))
inlinestatic

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

Field Documentation

◆ Index

uint32_t BRepGraph_RepId::Index

◆ RepKind

Kind BRepGraph_RepId::RepKind

◆ THE_INVALID_INDEX

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

◆ THE_START_INDEX

constexpr uint32_t BRepGraph_RepId::THE_START_INDEX = 0u
staticconstexpr

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