![]() |
Open CASCADE Technology Reference Manual 8.0.1
|
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_NodeId & | operator++ () |
| 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. | |
| bool | IsRemoved (const BRepGraph &theGraph) const |
| Return true if this node has been soft-removed in the given graph. | |
| bool | IsOwned (const BRepGraph &theGraph) const |
| Return true if this node 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 node kinds. | |
| 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() |
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.
|
strong |
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. |
|
inline |
Default: invalid NodeId (Index = UINT32_MAX). NodeKind is set to Kind::Solid but is meaningless when !IsValid().
|
inlinestatic |
Invalid sentinel id for the specified kind.
True if the kind is an assembly kind (Product or Occurrence).
Return true if this node has an active owner in the given graph.
Return true if this node has been soft-removed in the given graph.
True if the kind is a core topology kind (Solid..CoEdge).
|
inline |
True if this id points to an allocated node slot.
True if this id points to an allocated slot within [0, theMaxCount). UINT32_MAX (invalid sentinel) always fails this check for any realistic count.
|
inline |
True if this id is within the dense range exposed by a provider with Nb().
|
inline |
True if this id is within the dense range exposed by a provider with Size().
True if the kind value is one of the supported node kinds.
|
inline |
|
inline |
Advance by offset.
|
inline |
Pre-increment (++id).
|
inline |
Post-increment (id++).
|
inline |
Retreat by offset.
|
inline |
|
inline |
|
inlinestatic |
First valid id in a dense sequence for the specified kind.
|
inlinestatic |
Dispatch a generic node id to a callable taking the matching typed node id.
| uint32_t BRepGraph_NodeId::Index |
| Kind BRepGraph_NodeId::NodeKind |
|
staticconstexpr |
|
staticconstexpr |
Total number of dense kind slots used by per-kind arrays. Includes the reserved gap at enum value 9.