File indexing completed on 2026-09-28 09:19:35
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #ifndef _BRepGraph_MeshView_HeaderFile
0015 #define _BRepGraph_MeshView_HeaderFile
0016
0017 #include <BRepGraph.hxx>
0018 #include <BRepGraph_CacheMesh.hxx>
0019 #include <Poly_Polygon2D.hxx>
0020 #include <Poly_Polygon3D.hxx>
0021 #include <Poly_PolygonOnTriangulation.hxx>
0022 #include <Poly_Triangulation.hxx>
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041 class BRepGraph::MeshView
0042 {
0043 public:
0044
0045
0046 class CacheView
0047 {
0048 public:
0049 class FaceOps
0050 {
0051 public:
0052
0053
0054
0055 [[nodiscard]] Standard_EXPORT bool Has(const BRepGraph_FaceId theFace) const;
0056
0057
0058
0059
0060 [[nodiscard]] Standard_EXPORT const occ::handle<Poly_Triangulation>& Triangulation(
0061 const BRepGraph_FaceId theFace) const;
0062
0063
0064
0065
0066 [[nodiscard]] Standard_EXPORT const BRepGraph_CacheMesh::FaceMeshEntry* Entry(
0067 const BRepGraph_FaceId theFace) const;
0068
0069 private:
0070 friend class CacheView;
0071
0072 explicit FaceOps(BRepGraph* theGraph)
0073 : myGraph(theGraph)
0074 {
0075 }
0076
0077 BRepGraph* myGraph;
0078 };
0079
0080 class EdgeOps
0081 {
0082 public:
0083
0084
0085
0086 [[nodiscard]] Standard_EXPORT bool Has(const BRepGraph_EdgeId theEdge) const;
0087
0088
0089
0090
0091 [[nodiscard]] Standard_EXPORT const occ::handle<Poly_Polygon3D>& Polygon3D(
0092 const BRepGraph_EdgeId theEdge) const;
0093
0094
0095
0096
0097 [[nodiscard]] Standard_EXPORT const BRepGraph_CacheMesh::EdgeMeshEntry* Entry(
0098 const BRepGraph_EdgeId theEdge) const;
0099
0100 private:
0101 friend class CacheView;
0102
0103 explicit EdgeOps(BRepGraph* theGraph)
0104 : myGraph(theGraph)
0105 {
0106 }
0107
0108 BRepGraph* myGraph;
0109 };
0110
0111 class CoEdgeOps
0112 {
0113 public:
0114
0115
0116
0117 [[nodiscard]] Standard_EXPORT bool Has(const BRepGraph_CoEdgeId theCoEdge) const;
0118
0119
0120
0121
0122 [[nodiscard]] Standard_EXPORT const BRepGraph_CacheMesh::CoEdgeMeshEntry* FindPolygon2D(
0123 const BRepGraph_CoEdgeId theCoEdge) const;
0124
0125
0126
0127
0128 [[nodiscard]] Standard_EXPORT const BRepGraph_CacheMesh::CoEdgeMeshEntry* FindPolygonOnTri(
0129 const BRepGraph_CoEdgeId theCoEdge) const;
0130
0131
0132
0133
0134
0135 [[nodiscard]] Standard_EXPORT const BRepGraph_CacheMesh::CoEdgeMeshEntry* FindRaw(
0136 const BRepGraph_CoEdgeId theCoEdge) const;
0137
0138 private:
0139 friend class CacheView;
0140
0141 explicit CoEdgeOps(BRepGraph* theGraph)
0142 : myGraph(theGraph)
0143 {
0144 }
0145
0146 BRepGraph* myGraph;
0147 };
0148
0149
0150 [[nodiscard]] const FaceOps& Faces() const { return myFaces; }
0151
0152
0153 [[nodiscard]] const EdgeOps& Edges() const { return myEdges; }
0154
0155
0156 [[nodiscard]] const CoEdgeOps& CoEdges() const { return myCoEdges; }
0157
0158 private:
0159 friend class MeshView;
0160
0161 explicit CacheView(BRepGraph* theGraph)
0162 : myFaces(theGraph),
0163 myEdges(theGraph),
0164 myCoEdges(theGraph)
0165 {
0166 }
0167
0168 FaceOps myFaces;
0169 EdgeOps myEdges;
0170 CoEdgeOps myCoEdges;
0171 };
0172
0173
0174
0175 class PersistentView
0176 {
0177 public:
0178 class FaceOps
0179 {
0180 public:
0181
0182
0183
0184 [[nodiscard]] Standard_EXPORT bool Has(const BRepGraph_FaceId theFace) const;
0185
0186
0187
0188
0189 [[nodiscard]] Standard_EXPORT const occ::handle<Poly_Triangulation>& Triangulation(
0190 const BRepGraph_FaceId theFace) const;
0191
0192 private:
0193 friend class PersistentView;
0194
0195 explicit FaceOps(BRepGraph* theGraph)
0196 : myGraph(theGraph)
0197 {
0198 }
0199
0200 BRepGraph* myGraph;
0201 };
0202
0203 class EdgeOps
0204 {
0205 public:
0206
0207
0208
0209 [[nodiscard]] Standard_EXPORT bool Has(const BRepGraph_EdgeId theEdge) const;
0210
0211
0212
0213
0214 [[nodiscard]] Standard_EXPORT const occ::handle<Poly_Polygon3D>& Polygon3D(
0215 const BRepGraph_EdgeId theEdge) const;
0216
0217
0218
0219
0220
0221 [[nodiscard]] Standard_EXPORT bool HasPolygonOnTriangulation(
0222 const BRepGraph_EdgeId theEdge,
0223 const BRepGraph_FaceId theFace) const;
0224
0225
0226
0227
0228
0229 [[nodiscard]] Standard_EXPORT const occ::handle<Poly_PolygonOnTriangulation>&
0230 PolygonOnTriangulation(const BRepGraph_EdgeId theEdge,
0231 const BRepGraph_FaceId theFace) const;
0232
0233 private:
0234 friend class PersistentView;
0235
0236 explicit EdgeOps(BRepGraph* theGraph)
0237 : myGraph(theGraph)
0238 {
0239 }
0240
0241 BRepGraph* myGraph;
0242 };
0243
0244 class CoEdgeOps
0245 {
0246 public:
0247
0248
0249
0250 [[nodiscard]] Standard_EXPORT bool Has(const BRepGraph_CoEdgeId theCoEdge) const;
0251
0252
0253
0254
0255 [[nodiscard]] Standard_EXPORT const occ::handle<Poly_Polygon2D>& PolygonOnSurface(
0256 const BRepGraph_CoEdgeId theCoEdge) const;
0257
0258
0259
0260
0261 [[nodiscard]] Standard_EXPORT bool HasPolygonOnTriangulation(
0262 const BRepGraph_CoEdgeId theCoEdge) const;
0263
0264
0265
0266
0267 [[nodiscard]] Standard_EXPORT const occ::handle<Poly_PolygonOnTriangulation>&
0268 PolygonOnTriangulation(const BRepGraph_CoEdgeId theCoEdge) const;
0269
0270 private:
0271 friend class PersistentView;
0272
0273 explicit CoEdgeOps(BRepGraph* theGraph)
0274 : myGraph(theGraph)
0275 {
0276 }
0277
0278 BRepGraph* myGraph;
0279 };
0280
0281
0282 [[nodiscard]] const FaceOps& Faces() const { return myFaces; }
0283
0284
0285 [[nodiscard]] const EdgeOps& Edges() const { return myEdges; }
0286
0287
0288 [[nodiscard]] const CoEdgeOps& CoEdges() const { return myCoEdges; }
0289
0290 private:
0291 friend class MeshView;
0292
0293 explicit PersistentView(BRepGraph* theGraph)
0294 : myFaces(theGraph),
0295 myEdges(theGraph),
0296 myCoEdges(theGraph)
0297 {
0298 }
0299
0300 FaceOps myFaces;
0301 EdgeOps myEdges;
0302 CoEdgeOps myCoEdges;
0303 };
0304
0305
0306
0307
0308 class EffectiveView
0309 {
0310 public:
0311 class FaceOps
0312 {
0313 public:
0314
0315
0316
0317 [[nodiscard]] Standard_EXPORT bool Has(const BRepGraph_FaceId theFace) const;
0318
0319
0320
0321
0322 [[nodiscard]] Standard_EXPORT const occ::handle<Poly_Triangulation>& Triangulation(
0323 const BRepGraph_FaceId theFace) const;
0324
0325 private:
0326 friend class EffectiveView;
0327
0328 explicit FaceOps(BRepGraph* theGraph)
0329 : myGraph(theGraph)
0330 {
0331 }
0332
0333 BRepGraph* myGraph;
0334 };
0335
0336 class EdgeOps
0337 {
0338 public:
0339
0340
0341
0342 [[nodiscard]] Standard_EXPORT bool Has(const BRepGraph_EdgeId theEdge) const;
0343
0344
0345
0346
0347 [[nodiscard]] Standard_EXPORT const occ::handle<Poly_Polygon3D>& Polygon3D(
0348 const BRepGraph_EdgeId theEdge) const;
0349
0350 private:
0351 friend class EffectiveView;
0352
0353 explicit EdgeOps(BRepGraph* theGraph)
0354 : myGraph(theGraph)
0355 {
0356 }
0357
0358 BRepGraph* myGraph;
0359 };
0360
0361 class CoEdgeOps
0362 {
0363 public:
0364
0365
0366
0367 [[nodiscard]] Standard_EXPORT bool Has(const BRepGraph_CoEdgeId theCoEdge) const;
0368
0369
0370
0371
0372 [[nodiscard]] Standard_EXPORT bool HasPolygonOnSurface(
0373 const BRepGraph_CoEdgeId theCoEdge) const;
0374
0375
0376
0377
0378 [[nodiscard]] Standard_EXPORT const occ::handle<Poly_Polygon2D>& PolygonOnSurface(
0379 const BRepGraph_CoEdgeId theCoEdge) const;
0380
0381
0382
0383
0384 [[nodiscard]] Standard_EXPORT bool HasPolygonOnTriangulation(
0385 const BRepGraph_CoEdgeId theCoEdge) const;
0386
0387
0388
0389
0390 [[nodiscard]] Standard_EXPORT const occ::handle<Poly_PolygonOnTriangulation>&
0391 PolygonOnTriangulation(const BRepGraph_CoEdgeId theCoEdge) const;
0392
0393 private:
0394 friend class EffectiveView;
0395
0396 explicit CoEdgeOps(BRepGraph* theGraph)
0397 : myGraph(theGraph)
0398 {
0399 }
0400
0401 BRepGraph* myGraph;
0402 };
0403
0404
0405 [[nodiscard]] const FaceOps& Faces() const { return myFaces; }
0406
0407
0408 [[nodiscard]] const EdgeOps& Edges() const { return myEdges; }
0409
0410
0411 [[nodiscard]] const CoEdgeOps& CoEdges() const { return myCoEdges; }
0412
0413 private:
0414 friend class MeshView;
0415
0416 explicit EffectiveView(BRepGraph* theGraph)
0417 : myFaces(theGraph),
0418 myEdges(theGraph),
0419 myCoEdges(theGraph)
0420 {
0421 }
0422
0423 FaceOps myFaces;
0424 EdgeOps myEdges;
0425 CoEdgeOps myCoEdges;
0426 };
0427
0428
0429
0430
0431
0432 class EditorView
0433 {
0434 public:
0435 class FaceOps
0436 {
0437 public:
0438
0439
0440
0441 Standard_EXPORT void SetCachedTriangulation(
0442 const BRepGraph_FaceId theFace,
0443 const occ::handle<Poly_Triangulation>& theTriangulation);
0444
0445
0446
0447 Standard_EXPORT void Clear(const BRepGraph_FaceId theFace);
0448
0449 private:
0450 friend class EditorView;
0451
0452 explicit FaceOps(BRepGraph* theGraph)
0453 : myGraph(theGraph)
0454 {
0455 }
0456
0457 BRepGraph* myGraph;
0458 };
0459
0460 class EdgeOps
0461 {
0462 public:
0463
0464
0465
0466 Standard_EXPORT void SetCachedPolygon3D(const BRepGraph_EdgeId theEdge,
0467 const occ::handle<Poly_Polygon3D>& thePolygon3D);
0468
0469
0470
0471 Standard_EXPORT void Clear(const BRepGraph_EdgeId theEdge);
0472
0473 private:
0474 friend class EditorView;
0475
0476 explicit EdgeOps(BRepGraph* theGraph)
0477 : myGraph(theGraph)
0478 {
0479 }
0480
0481 BRepGraph* myGraph;
0482 };
0483
0484 class CoEdgeOps
0485 {
0486 public:
0487
0488
0489
0490 Standard_EXPORT void AppendCachedPolygonOnTri(
0491 const BRepGraph_CoEdgeId theCoEdge,
0492 const occ::handle<Poly_PolygonOnTriangulation>& thePolygonOnTri);
0493
0494
0495
0496
0497 Standard_EXPORT void SetCachedPolygon2D(const BRepGraph_CoEdgeId theCoEdge,
0498 const occ::handle<Poly_Polygon2D>& thePolygon2D);
0499
0500
0501
0502 Standard_EXPORT void Clear(const BRepGraph_CoEdgeId theCoEdge);
0503
0504 private:
0505 friend class EditorView;
0506
0507 explicit CoEdgeOps(BRepGraph* theGraph)
0508 : myGraph(theGraph)
0509 {
0510 }
0511
0512 BRepGraph* myGraph;
0513 };
0514
0515
0516 [[nodiscard]] FaceOps& Faces() { return myFaces; }
0517
0518
0519 [[nodiscard]] EdgeOps& Edges() { return myEdges; }
0520
0521
0522 [[nodiscard]] CoEdgeOps& CoEdges() { return myCoEdges; }
0523
0524
0525 Standard_EXPORT void PromoteToPersistent();
0526
0527 private:
0528 friend class MeshView;
0529
0530 explicit EditorView(BRepGraph* theGraph)
0531 : myGraph(theGraph),
0532 myFaces(theGraph),
0533 myEdges(theGraph),
0534 myCoEdges(theGraph)
0535 {
0536 }
0537
0538 BRepGraph* myGraph;
0539 FaceOps myFaces;
0540 EdgeOps myEdges;
0541 CoEdgeOps myCoEdges;
0542 };
0543
0544
0545 class PolyOps
0546 {
0547 public:
0548
0549 [[nodiscard]] Standard_EXPORT uint32_t NbFaceTriangulations() const;
0550
0551 [[nodiscard]] Standard_EXPORT uint32_t NbEdgePolygons3D() const;
0552
0553 [[nodiscard]] Standard_EXPORT uint32_t NbCoEdgePolygons2D() const;
0554
0555 [[nodiscard]] Standard_EXPORT uint32_t NbCoEdgePolygonsOnTri() const;
0556
0557
0558 [[nodiscard]] Standard_EXPORT uint32_t NbActiveTriangulations() const;
0559
0560 [[nodiscard]] Standard_EXPORT uint32_t NbActivePolygons3D() const;
0561
0562 [[nodiscard]] Standard_EXPORT uint32_t NbActivePolygons2D() const;
0563
0564 [[nodiscard]] Standard_EXPORT uint32_t NbActivePolygonsOnTri() const;
0565
0566 private:
0567 friend class MeshView;
0568
0569 explicit PolyOps(BRepGraph* theGraph)
0570 : myGraph(theGraph)
0571 {
0572 }
0573
0574 BRepGraph* myGraph;
0575 };
0576
0577
0578 [[nodiscard]] const CacheView& Cache() const { return myCache; }
0579
0580
0581 [[nodiscard]] const PersistentView& Persistent() const { return myPersistent; }
0582
0583
0584 [[nodiscard]] const EffectiveView& Effective() const { return myEffective; }
0585
0586
0587 [[nodiscard]] EditorView& Editor() { return myEditor; }
0588
0589
0590 [[nodiscard]] const PolyOps& Poly() const { return myPoly; }
0591
0592 private:
0593 friend class BRepGraph;
0594 friend struct BRepGraph_Data;
0595
0596 explicit MeshView(BRepGraph* theGraph)
0597 : myGraph(theGraph),
0598 myPoly(theGraph),
0599 myCache(theGraph),
0600 myPersistent(theGraph),
0601 myEffective(theGraph),
0602 myEditor(theGraph)
0603 {
0604 }
0605
0606 BRepGraph* myGraph;
0607 PolyOps myPoly;
0608 CacheView myCache;
0609 PersistentView myPersistent;
0610 EffectiveView myEffective;
0611 EditorView myEditor;
0612 };
0613
0614 #endif