File indexing completed on 2026-09-28 09:19:36
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #ifndef _BRepGraph_RefsView_HeaderFile
0015 #define _BRepGraph_RefsView_HeaderFile
0016
0017 #include <BRepGraph.hxx>
0018 #include <BRepGraphInc_Reference.hxx>
0019 #include <BRepGraph_VersionStamp.hxx>
0020 #include <NCollection_LinearVector.hxx>
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052
0053
0054
0055
0056
0057
0058
0059
0060
0061
0062
0063
0064
0065
0066
0067
0068
0069
0070 class BRepGraph::RefsView
0071 {
0072 public:
0073
0074 class ShellOps
0075 {
0076 public:
0077 [[nodiscard]] Standard_EXPORT uint32_t Nb() const;
0078 [[nodiscard]] Standard_EXPORT uint32_t NbActive() const;
0079
0080 [[nodiscard]] BRepGraph_ShellRefId StartId() const { return BRepGraph_ShellRefId::Start(); }
0081
0082 [[nodiscard]] BRepGraph_ShellRefId EndId() const { return BRepGraph_ShellRefId(Nb()); }
0083
0084 [[nodiscard]] Standard_EXPORT const BRepGraphInc::ShellRef& Entry(
0085 const BRepGraph_ShellRefId theRefId) const;
0086 [[nodiscard]] Standard_EXPORT const NCollection_LinearVector<BRepGraph_ShellRefId>& IdsOf(
0087 const BRepGraph_SolidId theSolid) const;
0088
0089 private:
0090 friend class RefsView;
0091
0092 explicit ShellOps(BRepGraph* theGraph)
0093 : myGraph(theGraph)
0094 {
0095 }
0096
0097 BRepGraph* myGraph;
0098 };
0099
0100
0101 class FaceOps
0102 {
0103 public:
0104 [[nodiscard]] Standard_EXPORT uint32_t Nb() const;
0105 [[nodiscard]] Standard_EXPORT uint32_t NbActive() const;
0106
0107 [[nodiscard]] BRepGraph_FaceRefId StartId() const { return BRepGraph_FaceRefId::Start(); }
0108
0109 [[nodiscard]] BRepGraph_FaceRefId EndId() const { return BRepGraph_FaceRefId(Nb()); }
0110
0111 [[nodiscard]] Standard_EXPORT const BRepGraphInc::FaceRef& Entry(
0112 const BRepGraph_FaceRefId theRefId) const;
0113 [[nodiscard]] Standard_EXPORT const NCollection_LinearVector<BRepGraph_FaceRefId>& IdsOf(
0114 const BRepGraph_ShellId theShell) const;
0115
0116 private:
0117 friend class RefsView;
0118
0119 explicit FaceOps(BRepGraph* theGraph)
0120 : myGraph(theGraph)
0121 {
0122 }
0123
0124 BRepGraph* myGraph;
0125 };
0126
0127
0128 class WireOps
0129 {
0130 public:
0131 [[nodiscard]] Standard_EXPORT uint32_t Nb() const;
0132 [[nodiscard]] Standard_EXPORT uint32_t NbActive() const;
0133
0134 [[nodiscard]] BRepGraph_WireRefId StartId() const { return BRepGraph_WireRefId::Start(); }
0135
0136 [[nodiscard]] BRepGraph_WireRefId EndId() const { return BRepGraph_WireRefId(Nb()); }
0137
0138 [[nodiscard]] Standard_EXPORT const BRepGraphInc::WireRef& Entry(
0139 const BRepGraph_WireRefId theRefId) const;
0140 [[nodiscard]] Standard_EXPORT const NCollection_LinearVector<BRepGraph_WireRefId>& IdsOf(
0141 const BRepGraph_FaceId theFace) const;
0142
0143 private:
0144 friend class RefsView;
0145
0146 explicit WireOps(BRepGraph* theGraph)
0147 : myGraph(theGraph)
0148 {
0149 }
0150
0151 BRepGraph* myGraph;
0152 };
0153
0154
0155 class VertexOps
0156 {
0157 public:
0158 [[nodiscard]] Standard_EXPORT uint32_t Nb() const;
0159 [[nodiscard]] Standard_EXPORT uint32_t NbActive() const;
0160
0161 [[nodiscard]] BRepGraph_VertexRefId StartId() const { return BRepGraph_VertexRefId::Start(); }
0162
0163 [[nodiscard]] BRepGraph_VertexRefId EndId() const { return BRepGraph_VertexRefId(Nb()); }
0164
0165 [[nodiscard]] Standard_EXPORT const BRepGraphInc::VertexRef& Entry(
0166 const BRepGraph_VertexRefId theRefId) const;
0167
0168 private:
0169 friend class RefsView;
0170
0171 explicit VertexOps(BRepGraph* theGraph)
0172 : myGraph(theGraph)
0173 {
0174 }
0175
0176 BRepGraph* myGraph;
0177 };
0178
0179
0180 class SolidOps
0181 {
0182 public:
0183 [[nodiscard]] Standard_EXPORT uint32_t Nb() const;
0184 [[nodiscard]] Standard_EXPORT uint32_t NbActive() const;
0185
0186 [[nodiscard]] BRepGraph_SolidRefId StartId() const { return BRepGraph_SolidRefId::Start(); }
0187
0188 [[nodiscard]] BRepGraph_SolidRefId EndId() const { return BRepGraph_SolidRefId(Nb()); }
0189
0190 [[nodiscard]] Standard_EXPORT const BRepGraphInc::SolidRef& Entry(
0191 const BRepGraph_SolidRefId theRefId) const;
0192 [[nodiscard]] Standard_EXPORT const NCollection_LinearVector<BRepGraph_SolidRefId>& IdsOf(
0193 const BRepGraph_CompSolidId theCompSolid) const;
0194
0195 private:
0196 friend class RefsView;
0197
0198 explicit SolidOps(BRepGraph* theGraph)
0199 : myGraph(theGraph)
0200 {
0201 }
0202
0203 BRepGraph* myGraph;
0204 };
0205
0206
0207 class ChildOps
0208 {
0209 public:
0210 [[nodiscard]] Standard_EXPORT uint32_t Nb() const;
0211 [[nodiscard]] Standard_EXPORT uint32_t NbActive() const;
0212
0213 [[nodiscard]] BRepGraph_ChildRefId StartId() const { return BRepGraph_ChildRefId::Start(); }
0214
0215 [[nodiscard]] BRepGraph_ChildRefId EndId() const { return BRepGraph_ChildRefId(Nb()); }
0216
0217 [[nodiscard]] Standard_EXPORT const BRepGraphInc::ChildRef& Entry(
0218 const BRepGraph_ChildRefId theRefId) const;
0219 [[nodiscard]] Standard_EXPORT const NCollection_LinearVector<BRepGraph_ChildRefId>& IdsOf(
0220 const BRepGraph_CompoundId theCompound) const;
0221 [[nodiscard]] Standard_EXPORT const NCollection_LinearVector<BRepGraph_ChildRefId>&
0222 IdsReferencing(const BRepGraph_NodeId theChild) const;
0223
0224 private:
0225 friend class RefsView;
0226
0227 explicit ChildOps(BRepGraph* theGraph)
0228 : myGraph(theGraph)
0229 {
0230 }
0231
0232 BRepGraph* myGraph;
0233 };
0234
0235
0236 class OccurrenceOps
0237 {
0238 public:
0239 [[nodiscard]] Standard_EXPORT uint32_t Nb() const;
0240 [[nodiscard]] Standard_EXPORT uint32_t NbActive() const;
0241
0242 [[nodiscard]] BRepGraph_OccurrenceRefId StartId() const
0243 {
0244 return BRepGraph_OccurrenceRefId::Start();
0245 }
0246
0247 [[nodiscard]] BRepGraph_OccurrenceRefId EndId() const
0248 {
0249 return BRepGraph_OccurrenceRefId(Nb());
0250 }
0251
0252 [[nodiscard]] Standard_EXPORT const BRepGraphInc::OccurrenceRef& Entry(
0253 const BRepGraph_OccurrenceRefId theRefId) const;
0254 [[nodiscard]] Standard_EXPORT const NCollection_LinearVector<BRepGraph_OccurrenceRefId>& IdsOf(
0255 const BRepGraph_ProductId theProduct) const;
0256 [[nodiscard]] Standard_EXPORT const NCollection_LinearVector<BRepGraph_OccurrenceRefId>&
0257 IdsReferencing(const BRepGraph_NodeId theChild) const;
0258
0259 private:
0260 friend class RefsView;
0261
0262 explicit OccurrenceOps(BRepGraph* theGraph)
0263 : myGraph(theGraph)
0264 {
0265 }
0266
0267 BRepGraph* myGraph;
0268 };
0269
0270
0271 class GenOps
0272 {
0273 public:
0274
0275 [[nodiscard]] Standard_EXPORT uint32_t Nb(const BRepGraph_RefId::Kind theKind) const;
0276
0277
0278 [[nodiscard]] Standard_EXPORT bool IsValid(const BRepGraph_RefId theRef) const;
0279
0280
0281 [[nodiscard]] Standard_EXPORT bool IsActive(const BRepGraph_RefId theRef) const;
0282
0283
0284 [[nodiscard]] Standard_EXPORT bool IsRemoved(const BRepGraph_RefId theRef) const;
0285
0286
0287
0288
0289 [[nodiscard]] Standard_EXPORT BRepGraph_RefId RefAtStep(const BRepGraph_NodeId theParent,
0290 const int theStep) const;
0291
0292
0293 [[nodiscard]] Standard_EXPORT BRepGraph_NodeId ChildNode(const BRepGraph_RefId theRef) const;
0294
0295
0296
0297 [[nodiscard]] Standard_EXPORT TopLoc_Location LocalLocation(const BRepGraph_RefId theRef) const;
0298
0299
0300
0301 [[nodiscard]] Standard_EXPORT TopAbs_Orientation
0302 Orientation(const BRepGraph_RefId theRef) const;
0303
0304 private:
0305 friend class RefsView;
0306
0307 explicit GenOps(BRepGraph* theGraph)
0308 : myGraph(theGraph)
0309 {
0310 }
0311
0312 BRepGraph* myGraph;
0313 };
0314
0315
0316 [[nodiscard]] const ShellOps& Shells() const { return myShells; }
0317
0318
0319 [[nodiscard]] const FaceOps& Faces() const { return myFaces; }
0320
0321
0322 [[nodiscard]] const WireOps& Wires() const { return myWires; }
0323
0324
0325 [[nodiscard]] const VertexOps& Vertices() const { return myVertices; }
0326
0327
0328 [[nodiscard]] const SolidOps& Solids() const { return mySolids; }
0329
0330
0331 [[nodiscard]] const ChildOps& Children() const { return myChildren; }
0332
0333
0334 [[nodiscard]] const OccurrenceOps& Occurrences() const { return myOccurrences; }
0335
0336
0337 [[nodiscard]] const GenOps& Gen() const { return myGen; }
0338
0339 private:
0340 friend class BRepGraph;
0341 friend struct BRepGraph_Data;
0342
0343 explicit RefsView(BRepGraph* theGraph)
0344 : myGraph(theGraph),
0345 myShells(theGraph),
0346 myFaces(theGraph),
0347 myWires(theGraph),
0348 myVertices(theGraph),
0349 mySolids(theGraph),
0350 myChildren(theGraph),
0351 myOccurrences(theGraph),
0352 myGen(theGraph)
0353 {
0354 }
0355
0356 BRepGraph* myGraph;
0357 ShellOps myShells;
0358 FaceOps myFaces;
0359 WireOps myWires;
0360 VertexOps myVertices;
0361 SolidOps mySolids;
0362 ChildOps myChildren;
0363 OccurrenceOps myOccurrences;
0364 GenOps myGen;
0365 };
0366
0367 #endif