File indexing completed on 2026-09-28 09:19:37
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #ifndef _BRepGraph_TopoView_HeaderFile
0015 #define _BRepGraph_TopoView_HeaderFile
0016
0017 #include <BRepGraph.hxx>
0018 #include <BRepGraphInc_RepId.hxx>
0019 #include <BRepGraphInc_Definition.hxx>
0020 #include <BRepGraphInc_Relations.hxx>
0021 #include <BRepGraphInc_Representation.hxx>
0022 #include <GeomAdaptor_TransformedCurve.hxx>
0023 #include <GeomAdaptor_TransformedSurface.hxx>
0024 #include <NCollection_LinearVector.hxx>
0025 #include <TopLoc_Location.hxx>
0026
0027 class Adaptor3d_CurveOnSurface;
0028 class Geom_Surface;
0029 class Geom_Curve;
0030 class Geom2d_Curve;
0031 class Poly_Triangulation;
0032 class BRepGraph_FacesOfEdge;
0033 class BRepGraph_WiresOfEdge;
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 class BRepGraph::TopoView
0060 {
0061 public:
0062
0063 class FaceOps
0064 {
0065 public:
0066
0067 [[nodiscard]] Standard_EXPORT uint32_t Nb() const;
0068
0069
0070 [[nodiscard]] Standard_EXPORT uint32_t NbActive() const;
0071
0072
0073 [[nodiscard]] BRepGraph_FaceId StartId() const { return BRepGraph_FaceId::Start(); }
0074
0075
0076 [[nodiscard]] BRepGraph_FaceId EndId() const { return BRepGraph_FaceId(Nb()); }
0077
0078
0079
0080 [[nodiscard]] Standard_EXPORT const BRepGraphInc::FaceDef& Definition(
0081 const BRepGraph_FaceId theFace) const;
0082
0083
0084
0085 [[nodiscard]] Standard_EXPORT const BRepGraphInc::FaceRelations& Relations(
0086 const BRepGraph_FaceId theFace) const;
0087
0088
0089
0090
0091 [[nodiscard]] Standard_EXPORT occ::handle<Geom_Surface> Surface(
0092 const BRepGraph_FaceId theFace) const;
0093
0094
0095
0096
0097 [[nodiscard]] Standard_EXPORT occ::handle<Poly_Triangulation> ActiveTriangulation(
0098 const BRepGraph_FaceId theFace) const;
0099
0100 private:
0101 friend class TopoView;
0102
0103 explicit FaceOps(BRepGraph* theGraph)
0104 : myGraph(theGraph)
0105 {
0106 }
0107
0108 BRepGraph* myGraph;
0109 };
0110
0111
0112 class EdgeOps
0113 {
0114 public:
0115
0116 [[nodiscard]] Standard_EXPORT uint32_t Nb() const;
0117
0118
0119 [[nodiscard]] Standard_EXPORT uint32_t NbActive() const;
0120
0121
0122 [[nodiscard]] BRepGraph_EdgeId StartId() const { return BRepGraph_EdgeId::Start(); }
0123
0124
0125 [[nodiscard]] BRepGraph_EdgeId EndId() const { return BRepGraph_EdgeId(Nb()); }
0126
0127
0128
0129 [[nodiscard]] Standard_EXPORT const BRepGraphInc::EdgeDef& Definition(
0130 const BRepGraph_EdgeId theEdge) const;
0131
0132
0133
0134 [[nodiscard]] Standard_EXPORT const BRepGraphInc::EdgeRelations& Relations(
0135 const BRepGraph_EdgeId theEdge) const;
0136
0137
0138
0139
0140 [[nodiscard]] Standard_EXPORT uint32_t NbFaces(const BRepGraph_EdgeId theEdge) const;
0141
0142
0143
0144
0145 [[nodiscard]] Standard_EXPORT BRepGraph_WiresOfEdge
0146 WiresOf(const BRepGraph_EdgeId theEdge) const;
0147
0148
0149
0150
0151
0152 [[nodiscard]] Standard_EXPORT BRepGraph_WiresOfEdge WiresOf(const BRepGraph_EdgeId theEdge,
0153 const uint32_t theStartIndex) const;
0154
0155
0156
0157
0158 [[nodiscard]] Standard_EXPORT BRepGraph_FacesOfEdge
0159 FacesOf(const BRepGraph_EdgeId theEdge) const;
0160
0161
0162
0163
0164
0165 [[nodiscard]] Standard_EXPORT BRepGraph_FacesOfEdge FacesOf(const BRepGraph_EdgeId theEdge,
0166 const uint32_t theStartIndex) const;
0167
0168
0169
0170 [[nodiscard]] Standard_EXPORT const NCollection_LinearVector<BRepGraph_CoEdgeId>& CoEdges(
0171 const BRepGraph_EdgeId theEdge) const;
0172
0173
0174
0175
0176 [[nodiscard]] Standard_EXPORT occ::handle<Geom_Curve> Curve3D(
0177 const BRepGraph_EdgeId theEdge) const;
0178
0179 private:
0180 friend class TopoView;
0181
0182 explicit EdgeOps(BRepGraph* theGraph)
0183 : myGraph(theGraph)
0184 {
0185 }
0186
0187 BRepGraph* myGraph;
0188 };
0189
0190
0191 class VertexOps
0192 {
0193 public:
0194
0195 [[nodiscard]] Standard_EXPORT uint32_t Nb() const;
0196
0197
0198 [[nodiscard]] Standard_EXPORT uint32_t NbActive() const;
0199
0200
0201 [[nodiscard]] BRepGraph_VertexId StartId() const { return BRepGraph_VertexId::Start(); }
0202
0203
0204 [[nodiscard]] BRepGraph_VertexId EndId() const { return BRepGraph_VertexId(Nb()); }
0205
0206
0207
0208 [[nodiscard]] Standard_EXPORT const BRepGraphInc::VertexDef& Definition(
0209 const BRepGraph_VertexId theVertex) const;
0210
0211
0212
0213 [[nodiscard]] Standard_EXPORT const BRepGraphInc::VertexRelations& Relations(
0214 const BRepGraph_VertexId theVertex) const;
0215
0216
0217
0218 [[nodiscard]] Standard_EXPORT const NCollection_LinearVector<BRepGraph_EdgeId>& Edges(
0219 const BRepGraph_VertexId theVertex) const;
0220
0221 private:
0222 friend class TopoView;
0223
0224 explicit VertexOps(BRepGraph* theGraph)
0225 : myGraph(theGraph)
0226 {
0227 }
0228
0229 BRepGraph* myGraph;
0230 };
0231
0232
0233 class WireOps
0234 {
0235 public:
0236
0237 [[nodiscard]] Standard_EXPORT uint32_t Nb() const;
0238
0239
0240 [[nodiscard]] Standard_EXPORT uint32_t NbActive() const;
0241
0242
0243 [[nodiscard]] BRepGraph_WireId StartId() const { return BRepGraph_WireId::Start(); }
0244
0245
0246 [[nodiscard]] BRepGraph_WireId EndId() const { return BRepGraph_WireId(Nb()); }
0247
0248
0249
0250 [[nodiscard]] Standard_EXPORT const BRepGraphInc::WireDef& Definition(
0251 const BRepGraph_WireId theWire) const;
0252
0253
0254
0255 [[nodiscard]] Standard_EXPORT const BRepGraphInc::WireRelations& Relations(
0256 const BRepGraph_WireId theWire) const;
0257
0258 private:
0259 friend class TopoView;
0260
0261 explicit WireOps(BRepGraph* theGraph)
0262 : myGraph(theGraph)
0263 {
0264 }
0265
0266 BRepGraph* myGraph;
0267 };
0268
0269
0270 class ShellOps
0271 {
0272 public:
0273
0274 [[nodiscard]] Standard_EXPORT uint32_t Nb() const;
0275
0276
0277 [[nodiscard]] Standard_EXPORT uint32_t NbActive() const;
0278
0279
0280 [[nodiscard]] BRepGraph_ShellId StartId() const { return BRepGraph_ShellId::Start(); }
0281
0282
0283 [[nodiscard]] BRepGraph_ShellId EndId() const { return BRepGraph_ShellId(Nb()); }
0284
0285
0286
0287 [[nodiscard]] Standard_EXPORT const BRepGraphInc::ShellDef& Definition(
0288 const BRepGraph_ShellId theShell) const;
0289
0290
0291
0292 [[nodiscard]] Standard_EXPORT const BRepGraphInc::ShellRelations& Relations(
0293 const BRepGraph_ShellId theShell) const;
0294
0295 private:
0296 friend class TopoView;
0297
0298 explicit ShellOps(BRepGraph* theGraph)
0299 : myGraph(theGraph)
0300 {
0301 }
0302
0303 BRepGraph* myGraph;
0304 };
0305
0306
0307 class SolidOps
0308 {
0309 public:
0310
0311 [[nodiscard]] Standard_EXPORT uint32_t Nb() const;
0312
0313
0314 [[nodiscard]] Standard_EXPORT uint32_t NbActive() const;
0315
0316
0317 [[nodiscard]] BRepGraph_SolidId StartId() const { return BRepGraph_SolidId::Start(); }
0318
0319
0320 [[nodiscard]] BRepGraph_SolidId EndId() const { return BRepGraph_SolidId(Nb()); }
0321
0322
0323
0324 [[nodiscard]] Standard_EXPORT const BRepGraphInc::SolidDef& Definition(
0325 const BRepGraph_SolidId theSolid) const;
0326
0327
0328
0329 [[nodiscard]] Standard_EXPORT const BRepGraphInc::SolidRelations& Relations(
0330 const BRepGraph_SolidId theSolid) const;
0331
0332 private:
0333 friend class TopoView;
0334
0335 explicit SolidOps(BRepGraph* theGraph)
0336 : myGraph(theGraph)
0337 {
0338 }
0339
0340 BRepGraph* myGraph;
0341 };
0342
0343
0344 class CoEdgeOps
0345 {
0346 public:
0347
0348 [[nodiscard]] Standard_EXPORT uint32_t Nb() const;
0349
0350
0351 [[nodiscard]] Standard_EXPORT uint32_t NbActive() const;
0352
0353
0354 [[nodiscard]] BRepGraph_CoEdgeId StartId() const { return BRepGraph_CoEdgeId::Start(); }
0355
0356
0357 [[nodiscard]] BRepGraph_CoEdgeId EndId() const { return BRepGraph_CoEdgeId(Nb()); }
0358
0359
0360
0361 [[nodiscard]] Standard_EXPORT const BRepGraphInc::CoEdgeDef& Definition(
0362 const BRepGraph_CoEdgeId theCoEdge) const;
0363
0364
0365
0366 [[nodiscard]] Standard_EXPORT BRepGraph_EdgeId Edge(const BRepGraph_CoEdgeId theCoEdge) const;
0367
0368
0369
0370 [[nodiscard]] Standard_EXPORT BRepGraph_FaceId Face(const BRepGraph_CoEdgeId theCoEdge) const;
0371
0372
0373
0374 [[nodiscard]] Standard_EXPORT BRepGraph_WireId Wire(const BRepGraph_CoEdgeId theCoEdge) const;
0375
0376
0377
0378
0379 [[nodiscard]] Standard_EXPORT occ::handle<Geom2d_Curve> Curve2D(
0380 const BRepGraph_CoEdgeId theCoEdge) const;
0381
0382 private:
0383 friend class TopoView;
0384
0385 explicit CoEdgeOps(BRepGraph* theGraph)
0386 : myGraph(theGraph)
0387 {
0388 }
0389
0390 BRepGraph* myGraph;
0391 };
0392
0393
0394 class CompoundOps
0395 {
0396 public:
0397
0398 [[nodiscard]] Standard_EXPORT uint32_t Nb() const;
0399
0400
0401 [[nodiscard]] Standard_EXPORT uint32_t NbActive() const;
0402
0403
0404 [[nodiscard]] BRepGraph_CompoundId StartId() const { return BRepGraph_CompoundId::Start(); }
0405
0406
0407 [[nodiscard]] BRepGraph_CompoundId EndId() const { return BRepGraph_CompoundId(Nb()); }
0408
0409
0410
0411 [[nodiscard]] Standard_EXPORT const BRepGraphInc::CompoundDef& Definition(
0412 const BRepGraph_CompoundId theCompound) const;
0413
0414
0415
0416 [[nodiscard]] Standard_EXPORT const BRepGraphInc::CompoundRelations& Relations(
0417 const BRepGraph_CompoundId theCompound) const;
0418
0419 private:
0420 friend class TopoView;
0421
0422 explicit CompoundOps(BRepGraph* theGraph)
0423 : myGraph(theGraph)
0424 {
0425 }
0426
0427 BRepGraph* myGraph;
0428 };
0429
0430
0431 class CompSolidOps
0432 {
0433 public:
0434
0435 [[nodiscard]] Standard_EXPORT uint32_t Nb() const;
0436
0437
0438 [[nodiscard]] Standard_EXPORT uint32_t NbActive() const;
0439
0440
0441 [[nodiscard]] BRepGraph_CompSolidId StartId() const { return BRepGraph_CompSolidId::Start(); }
0442
0443
0444 [[nodiscard]] BRepGraph_CompSolidId EndId() const { return BRepGraph_CompSolidId(Nb()); }
0445
0446
0447
0448 [[nodiscard]] Standard_EXPORT const BRepGraphInc::CompSolidDef& Definition(
0449 const BRepGraph_CompSolidId theCompSolid) const;
0450
0451
0452
0453 [[nodiscard]] Standard_EXPORT const BRepGraphInc::CompSolidRelations& Relations(
0454 const BRepGraph_CompSolidId theCompSolid) const;
0455
0456 private:
0457 friend class TopoView;
0458
0459 explicit CompSolidOps(BRepGraph* theGraph)
0460 : myGraph(theGraph)
0461 {
0462 }
0463
0464 BRepGraph* myGraph;
0465 };
0466
0467
0468 class ProductOps
0469 {
0470 public:
0471
0472 [[nodiscard]] Standard_EXPORT uint32_t Nb() const;
0473
0474
0475 [[nodiscard]] Standard_EXPORT uint32_t NbActive() const;
0476
0477
0478 [[nodiscard]] BRepGraph_ProductId StartId() const { return BRepGraph_ProductId::Start(); }
0479
0480
0481 [[nodiscard]] BRepGraph_ProductId EndId() const { return BRepGraph_ProductId(Nb()); }
0482
0483
0484
0485 [[nodiscard]] Standard_EXPORT const BRepGraphInc::ProductDef& Definition(
0486 const BRepGraph_ProductId theProduct) const;
0487
0488
0489
0490 [[nodiscard]] Standard_EXPORT const BRepGraphInc::ProductRelations& Relations(
0491 const BRepGraph_ProductId theProduct) const;
0492
0493
0494
0495
0496 [[nodiscard]] Standard_EXPORT BRepGraph_NodeId
0497 ShapeRoot(const BRepGraph_ProductId theProduct) const;
0498
0499
0500
0501 [[nodiscard]] Standard_EXPORT bool IsAssembly(const BRepGraph_ProductId theProduct) const;
0502
0503
0504
0505 [[nodiscard]] Standard_EXPORT bool IsPart(const BRepGraph_ProductId theProduct) const;
0506
0507
0508
0509
0510 [[nodiscard]] Standard_EXPORT BRepGraph_NodeId
0511 ShapeRootNode(const BRepGraph_ProductId theProduct) const;
0512
0513
0514
0515 [[nodiscard]] Standard_EXPORT uint32_t NbComponents(const BRepGraph_ProductId theProduct) const;
0516
0517
0518
0519
0520 [[nodiscard]] Standard_EXPORT BRepGraph_OccurrenceId
0521 Component(const BRepGraph_ProductId theProduct, const int theComponentIdx) const;
0522
0523 private:
0524 friend class TopoView;
0525
0526 explicit ProductOps(BRepGraph* theGraph)
0527 : myGraph(theGraph)
0528 {
0529 }
0530
0531 BRepGraph* myGraph;
0532 };
0533
0534
0535 class OccurrenceOps
0536 {
0537 public:
0538
0539 [[nodiscard]] Standard_EXPORT uint32_t Nb() const;
0540
0541
0542 [[nodiscard]] Standard_EXPORT uint32_t NbActive() const;
0543
0544
0545 [[nodiscard]] BRepGraph_OccurrenceId StartId() const { return BRepGraph_OccurrenceId::Start(); }
0546
0547
0548 [[nodiscard]] BRepGraph_OccurrenceId EndId() const { return BRepGraph_OccurrenceId(Nb()); }
0549
0550
0551
0552 [[nodiscard]] Standard_EXPORT const BRepGraphInc::OccurrenceDef& Definition(
0553 const BRepGraph_OccurrenceId theOccurrence) const;
0554
0555
0556
0557 [[nodiscard]] Standard_EXPORT const BRepGraphInc::OccurrenceRelations& Relations(
0558 const BRepGraph_OccurrenceId theOccurrence) const;
0559
0560
0561
0562 [[nodiscard]] Standard_EXPORT BRepGraph_ProductId
0563 Product(const BRepGraph_OccurrenceId theOccurrence) const;
0564
0565
0566
0567 [[nodiscard]] Standard_EXPORT BRepGraph_ProductId
0568 ParentProduct(const BRepGraph_OccurrenceId theOccurrence) const;
0569
0570
0571
0572
0573
0574 [[nodiscard]] Standard_EXPORT TopLoc_Location
0575 OccurrenceLocation(const BRepGraph_OccurrenceId theOccurrence) const;
0576
0577 private:
0578 friend class TopoView;
0579
0580 explicit OccurrenceOps(BRepGraph* theGraph)
0581 : myGraph(theGraph)
0582 {
0583 }
0584
0585 BRepGraph* myGraph;
0586 };
0587
0588
0589 class GenOps
0590 {
0591 public:
0592
0593
0594
0595 [[nodiscard]] Standard_EXPORT const BRepGraphInc::BaseDef* TopoEntity(
0596 const BRepGraph_NodeId theId) const;
0597
0598
0599
0600 [[nodiscard]] Standard_EXPORT const NCollection_LinearVector<BRepGraph_ChildRefId>&
0601 CompoundRefIds(const BRepGraph_NodeId theChild) const;
0602
0603
0604
0605 [[nodiscard]] Standard_EXPORT const NCollection_LinearVector<BRepGraph_OccurrenceRefId>&
0606 OccurrenceRefIds(const BRepGraph_NodeId theChild) const;
0607
0608
0609
0610 [[nodiscard]] Standard_EXPORT bool HasCompoundParents(const BRepGraph_NodeId theNode) const;
0611
0612
0613
0614 [[nodiscard]] Standard_EXPORT bool HasOccurrenceParents(const BRepGraph_NodeId theNode) const;
0615
0616
0617 [[nodiscard]] Standard_EXPORT uint32_t NbNodes() const;
0618
0619
0620 [[nodiscard]] Standard_EXPORT uint32_t Nb(const BRepGraph_NodeId::Kind theKind) const;
0621
0622
0623 [[nodiscard]] Standard_EXPORT bool IsValid(const BRepGraph_NodeId theNode) const;
0624
0625
0626 [[nodiscard]] Standard_EXPORT bool IsActive(const BRepGraph_NodeId theNode) const;
0627
0628
0629
0630 [[nodiscard]] Standard_EXPORT bool IsRemoved(const BRepGraph_NodeId theNode) const;
0631
0632 private:
0633 friend class TopoView;
0634
0635 explicit GenOps(BRepGraph* theGraph)
0636 : myGraph(theGraph)
0637 {
0638 }
0639
0640 BRepGraph* myGraph;
0641 };
0642
0643
0644 class GeometryOps
0645 {
0646 public:
0647
0648 [[nodiscard]] Standard_EXPORT uint32_t NbFaceSurfaces() const;
0649
0650
0651 [[nodiscard]] Standard_EXPORT uint32_t NbEdgeCurves3D() const;
0652
0653
0654 [[nodiscard]] Standard_EXPORT uint32_t NbCoEdgeCurves2D() const;
0655
0656
0657 [[nodiscard]] Standard_EXPORT uint32_t NbActiveFaceSurfaces() const;
0658
0659
0660 [[nodiscard]] Standard_EXPORT uint32_t NbActiveEdgeCurves3D() const;
0661
0662
0663 [[nodiscard]] Standard_EXPORT uint32_t NbActiveCoEdgeCurves2D() const;
0664
0665 private:
0666 friend class TopoView;
0667
0668 explicit GeometryOps(BRepGraph* theGraph)
0669 : myGraph(theGraph)
0670 {
0671 }
0672
0673 BRepGraph* myGraph;
0674 };
0675
0676
0677 [[nodiscard]] const FaceOps& Faces() const { return myFaces; }
0678
0679
0680 [[nodiscard]] const EdgeOps& Edges() const { return myEdges; }
0681
0682
0683 [[nodiscard]] const VertexOps& Vertices() const { return myVertices; }
0684
0685
0686 [[nodiscard]] const WireOps& Wires() const { return myWires; }
0687
0688
0689 [[nodiscard]] const ShellOps& Shells() const { return myShells; }
0690
0691
0692 [[nodiscard]] const SolidOps& Solids() const { return mySolids; }
0693
0694
0695 [[nodiscard]] const CoEdgeOps& CoEdges() const { return myCoEdges; }
0696
0697
0698 [[nodiscard]] const CompoundOps& Compounds() const { return myCompounds; }
0699
0700
0701 [[nodiscard]] const CompSolidOps& CompSolids() const { return myCompSolids; }
0702
0703
0704 [[nodiscard]] const ProductOps& Products() const { return myProducts; }
0705
0706
0707 [[nodiscard]] const OccurrenceOps& Occurrences() const { return myOccurrences; }
0708
0709
0710 [[nodiscard]] const GenOps& Gen() const { return myGen; }
0711
0712
0713 [[nodiscard]] const GeometryOps& Geometry() const { return myGeometry; }
0714
0715
0716
0717
0718
0719
0720
0721
0722
0723
0724 private:
0725 friend class BRepGraph;
0726 friend struct BRepGraph_Data;
0727 friend class BRepGraph_Tool;
0728
0729 explicit TopoView(BRepGraph* theGraph)
0730 : myGraph(theGraph),
0731 myFaces(theGraph),
0732 myEdges(theGraph),
0733 myVertices(theGraph),
0734 myWires(theGraph),
0735 myShells(theGraph),
0736 mySolids(theGraph),
0737 myCoEdges(theGraph),
0738 myCompounds(theGraph),
0739 myCompSolids(theGraph),
0740 myProducts(theGraph),
0741 myOccurrences(theGraph),
0742 myGen(theGraph),
0743 myGeometry(theGraph)
0744 {
0745 }
0746
0747 BRepGraph* myGraph;
0748 FaceOps myFaces;
0749 EdgeOps myEdges;
0750 VertexOps myVertices;
0751 WireOps myWires;
0752 ShellOps myShells;
0753 SolidOps mySolids;
0754 CoEdgeOps myCoEdges;
0755 CompoundOps myCompounds;
0756 CompSolidOps myCompSolids;
0757 ProductOps myProducts;
0758 OccurrenceOps myOccurrences;
0759 GenOps myGen;
0760 GeometryOps myGeometry;
0761 };
0762
0763 #endif