Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-28 09:19:35

0001 // Copyright (c) 2026 OPEN CASCADE SAS
0002 //
0003 // This file is part of Open CASCADE Technology software library.
0004 //
0005 // This library is free software; you can redistribute it and/or modify it under
0006 // the terms of the GNU Lesser General Public License version 2.1 as published
0007 // by the Free Software Foundation, with special exception defined in the file
0008 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0009 // distribution for complete text of the license and disclaimer of any warranty.
0010 //
0011 // Alternatively, this file may be used under the terms of Open CASCADE
0012 // commercial license or contractual agreement.
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 //! @brief Read/write view over mesh data.
0025 //!
0026 //! Splits mesh access into three explicit sub-views:
0027 //! - `Cache()`     - reads from the BRepGraphMesh cache only (algorithm-derived,
0028 //!                   freshness-checked against the entity's OwnGen).
0029 //! - `Persistent()` - reads from definition-resident mesh (FaceDef.TriangulationRepId,
0030 //!                   EdgeDef.Polygon3DRepId, CoEdgeDef.Polygon2DRepId,
0031 //!                   CoEdgeDef.PolygonOnTriRepId).
0032 //! - `Editor()`    - cache mutations (append/clear). Persistent rep creation lives on
0033 //!                   `BRepGraph::Editor().Edges()`, `BRepGraph::Editor().CoEdges()`,
0034 //!                   `BRepGraph::Editor().Faces()` since reps back the topology defs.
0035 //! - `Poly()`      - mesh element count queries (shared by all paths).
0036 //!
0037 //! There is no fallback path that mixes cache and persistent - callers pick the
0038 //! source explicitly.
0039 //!
0040 //! Obtained via `BRepGraph::Mesh()` (const) or `BRepGraph::Mesh()` (non-const for Editor).
0041 class BRepGraph::MeshView
0042 {
0043 public:
0044   //! Cache reads. Each accessor returns data only if a fresh cache entry exists
0045   //! for the given entity (matched against its current OwnGen).
0046   class CacheView
0047   {
0048   public:
0049     class FaceOps
0050     {
0051     public:
0052       //! True if a fresh cached triangulation is present.
0053       //! @param[in] theFace typed face definition identifier
0054       //! @return true if Entry() would return non-null
0055       [[nodiscard]] Standard_EXPORT bool Has(const BRepGraph_FaceId theFace) const;
0056 
0057       //! Cached triangulation handle.
0058       //! @param[in] theFace typed face definition identifier
0059       //! @return triangulation handle, or null handle if absent
0060       [[nodiscard]] Standard_EXPORT const occ::handle<Poly_Triangulation>& Triangulation(
0061         const BRepGraph_FaceId theFace) const;
0062 
0063       //! Raw cached face mesh entry, or nullptr if absent or stale.
0064       //! @param[in] theFace typed face definition identifier
0065       //! @return cache entry pointer, or nullptr
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       //! True if a fresh cached Polygon3D is bound to the edge.
0084       //! @param[in] theEdge typed edge definition identifier
0085       //! @return true if a fresh Polygon3D is present in cache
0086       [[nodiscard]] Standard_EXPORT bool Has(const BRepGraph_EdgeId theEdge) const;
0087 
0088       //! Cached Polygon3D handle.
0089       //! @param[in] theEdge typed edge definition identifier
0090       //! @return polygon-3D handle, or null handle if absent
0091       [[nodiscard]] Standard_EXPORT const occ::handle<Poly_Polygon3D>& Polygon3D(
0092         const BRepGraph_EdgeId theEdge) const;
0093 
0094       //! Raw cached edge mesh entry, or nullptr if absent or stale.
0095       //! @param[in] theEdge typed edge definition identifier
0096       //! @return cache entry pointer, or nullptr
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       //! True if a fresh cached entry exists (any of polygon-2D / polygon-on-tri).
0115       //! @param[in] theCoEdge typed coedge definition identifier
0116       //! @return true if a fresh cache entry exists
0117       [[nodiscard]] Standard_EXPORT bool Has(const BRepGraph_CoEdgeId theCoEdge) const;
0118 
0119       //! Return coedge entry if Polygon2D is fresh, nullptr otherwise.
0120       //! @param[in] theCoEdge typed coedge definition identifier
0121       //! @return cache entry pointer, or nullptr
0122       [[nodiscard]] Standard_EXPORT const BRepGraph_CacheMesh::CoEdgeMeshEntry* FindPolygon2D(
0123         const BRepGraph_CoEdgeId theCoEdge) const;
0124 
0125       //! Return coedge entry if PolygonsOnTri is fresh, nullptr otherwise.
0126       //! @param[in] theCoEdge typed coedge definition identifier
0127       //! @return cache entry pointer, or nullptr
0128       [[nodiscard]] Standard_EXPORT const BRepGraph_CacheMesh::CoEdgeMeshEntry* FindPolygonOnTri(
0129         const BRepGraph_CoEdgeId theCoEdge) const;
0130 
0131       //! Raw coedge entry access (no freshness filtering). Returns nullptr if
0132       //! the entry has no representation. For internal/testing use.
0133       //! @param[in] theCoEdge typed coedge definition identifier
0134       //! @return cache entry pointer, or nullptr if absent
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     //! Grouped face cache queries.
0150     [[nodiscard]] const FaceOps& Faces() const { return myFaces; }
0151 
0152     //! Grouped edge cache queries.
0153     [[nodiscard]] const EdgeOps& Edges() const { return myEdges; }
0154 
0155     //! Grouped coedge cache queries.
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   //! Persistent reads. Resolves data through the rep id stored on the entity's
0174   //! definition (FaceDef / EdgeDef / CoEdgeDef). Independent of the cache.
0175   class PersistentView
0176   {
0177   public:
0178     class FaceOps
0179     {
0180     public:
0181       //! True if FaceDef.TriangulationRepId is valid and the rep is not removed.
0182       //! @param[in] theFace typed face definition identifier
0183       //! @return true if a persistent triangulation is bound
0184       [[nodiscard]] Standard_EXPORT bool Has(const BRepGraph_FaceId theFace) const;
0185 
0186       //! Persistent triangulation handle.
0187       //! @param[in] theFace typed face definition identifier
0188       //! @return triangulation handle, or null handle if absent
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       //! True if EdgeDef.Polygon3DRepId is bound (dominant kind on edges).
0207       //! @param[in] theEdge typed edge definition identifier
0208       //! @return true if a persistent Polygon3D is bound
0209       [[nodiscard]] Standard_EXPORT bool Has(const BRepGraph_EdgeId theEdge) const;
0210 
0211       //! Persistent Polygon3D handle.
0212       //! @param[in] theEdge typed edge definition identifier
0213       //! @return polygon-3D handle, or null handle if absent
0214       [[nodiscard]] Standard_EXPORT const occ::handle<Poly_Polygon3D>& Polygon3D(
0215         const BRepGraph_EdgeId theEdge) const;
0216 
0217       //! True if the (edge, face) coedge has a polygon-on-triangulation.
0218       //! @param[in] theEdge typed edge definition identifier
0219       //! @param[in] theFace typed face definition identifier
0220       //! @return true if persistent polygon-on-triangulation is bound
0221       [[nodiscard]] Standard_EXPORT bool HasPolygonOnTriangulation(
0222         const BRepGraph_EdgeId theEdge,
0223         const BRepGraph_FaceId theFace) const;
0224 
0225       //! Polygon-on-triangulation for the (edge, face) coedge.
0226       //! @param[in] theEdge typed edge definition identifier
0227       //! @param[in] theFace typed face definition identifier
0228       //! @return polygon-on-triangulation handle, or null handle if absent
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       //! True if CoEdgeDef.Polygon2DRepId is bound (dominant kind on coedges).
0248       //! @param[in] theCoEdge typed coedge definition identifier
0249       //! @return true if a persistent polygon-on-surface is bound
0250       [[nodiscard]] Standard_EXPORT bool Has(const BRepGraph_CoEdgeId theCoEdge) const;
0251 
0252       //! Persistent polygon-on-surface (2D polygon) bound to the coedge.
0253       //! @param[in] theCoEdge typed coedge definition identifier
0254       //! @return polygon-2D handle, or null handle if absent
0255       [[nodiscard]] Standard_EXPORT const occ::handle<Poly_Polygon2D>& PolygonOnSurface(
0256         const BRepGraph_CoEdgeId theCoEdge) const;
0257 
0258       //! True if CoEdgeDef.PolygonOnTriRepId is bound.
0259       //! @param[in] theCoEdge typed coedge definition identifier
0260       //! @return true if persistent polygon-on-triangulation is bound
0261       [[nodiscard]] Standard_EXPORT bool HasPolygonOnTriangulation(
0262         const BRepGraph_CoEdgeId theCoEdge) const;
0263 
0264       //! Persistent polygon-on-triangulation bound to the coedge.
0265       //! @param[in] theCoEdge typed coedge definition identifier
0266       //! @return polygon-on-triangulation handle, or null handle if absent
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     //! Grouped face persistent queries.
0282     [[nodiscard]] const FaceOps& Faces() const { return myFaces; }
0283 
0284     //! Grouped edge persistent queries.
0285     [[nodiscard]] const EdgeOps& Edges() const { return myEdges; }
0286 
0287     //! Grouped coedge persistent queries.
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   //! Resolves mesh data by checking the cache first and the persistent (def-resident)
0306   //! source second. Callers that do not care which source supplies the data go
0307   //! through this view; callers that do care use Cache() or Persistent() directly.
0308   class EffectiveView
0309   {
0310   public:
0311     class FaceOps
0312     {
0313     public:
0314       //! True if the face has a triangulation in either cache or persistent storage.
0315       //! @param[in] theFace typed face definition identifier
0316       //! @return true if any triangulation is reachable
0317       [[nodiscard]] Standard_EXPORT bool Has(const BRepGraph_FaceId theFace) const;
0318 
0319       //! Cached triangulation handle (cache first, persistent fallback).
0320       //! @param[in] theFace typed face definition identifier
0321       //! @return triangulation handle, or null handle if absent
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       //! True if the edge has a Polygon3D in either cache or persistent storage.
0340       //! @param[in] theEdge typed edge definition identifier
0341       //! @return true if any Polygon3D is reachable
0342       [[nodiscard]] Standard_EXPORT bool Has(const BRepGraph_EdgeId theEdge) const;
0343 
0344       //! Polygon3D handle (cache first, persistent fallback).
0345       //! @param[in] theEdge typed edge definition identifier
0346       //! @return polygon-3D handle, or null handle if absent
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       //! True if the coedge has any polygon-2D / polygon-on-tri in either source.
0365       //! @param[in] theCoEdge typed coedge definition identifier
0366       //! @return true if any coedge mesh data is reachable
0367       [[nodiscard]] Standard_EXPORT bool Has(const BRepGraph_CoEdgeId theCoEdge) const;
0368 
0369       //! True if a polygon-on-surface (2D) is reachable in either source.
0370       //! @param[in] theCoEdge typed coedge definition identifier
0371       //! @return true if a polygon-2D is bound on either side
0372       [[nodiscard]] Standard_EXPORT bool HasPolygonOnSurface(
0373         const BRepGraph_CoEdgeId theCoEdge) const;
0374 
0375       //! Polygon-on-surface (2D) handle (cache first, persistent fallback).
0376       //! @param[in] theCoEdge typed coedge definition identifier
0377       //! @return polygon-2D handle, or null handle if absent
0378       [[nodiscard]] Standard_EXPORT const occ::handle<Poly_Polygon2D>& PolygonOnSurface(
0379         const BRepGraph_CoEdgeId theCoEdge) const;
0380 
0381       //! True if a polygon-on-triangulation is reachable in either source.
0382       //! @param[in] theCoEdge typed coedge definition identifier
0383       //! @return true if a polygon-on-tri is bound on either side
0384       [[nodiscard]] Standard_EXPORT bool HasPolygonOnTriangulation(
0385         const BRepGraph_CoEdgeId theCoEdge) const;
0386 
0387       //! Polygon-on-triangulation handle (cache first, persistent fallback).
0388       //! @param[in] theCoEdge typed coedge definition identifier
0389       //! @return polygon-on-tri handle, or null handle if absent
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     //! Grouped face effective queries.
0405     [[nodiscard]] const FaceOps& Faces() const { return myFaces; }
0406 
0407     //! Grouped edge effective queries.
0408     [[nodiscard]] const EdgeOps& Edges() const { return myEdges; }
0409 
0410     //! Grouped coedge effective queries.
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   //! Cache mutation surface. Mutates the BRepGraphMesh cache only - does not
0429   //! touch persistent definition data. Persistent rep creation/edit lives on
0430   //! `BRepGraph::Editor().Edges()`, `BRepGraph::Editor().CoEdges()`,
0431   //! `BRepGraph::Editor().Faces()`.
0432   class EditorView
0433   {
0434   public:
0435     class FaceOps
0436     {
0437     public:
0438       //! Set the cached triangulation for a face.
0439       //! @param[in] theFace         typed face definition identifier
0440       //! @param[in] theTriangulation triangulation to store (null clears)
0441       Standard_EXPORT void SetCachedTriangulation(
0442         const BRepGraph_FaceId                 theFace,
0443         const occ::handle<Poly_Triangulation>& theTriangulation);
0444 
0445       //! Clear the face's cached mesh entry (no effect if absent).
0446       //! @param[in] theFace typed face definition identifier
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       //! Bind a Polygon3D to the edge's cached entry.
0464       //! @param[in] theEdge     typed edge definition identifier
0465       //! @param[in] thePolygon3D polygon-3D handle (null clears the cached binding)
0466       Standard_EXPORT void SetCachedPolygon3D(const BRepGraph_EdgeId             theEdge,
0467                                               const occ::handle<Poly_Polygon3D>& thePolygon3D);
0468 
0469       //! Clear the edge's cached mesh entry.
0470       //! @param[in] theEdge typed edge definition identifier
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       //! Append a polygon-on-triangulation to the coedge's cached list.
0488       //! @param[in] theCoEdge    typed coedge definition identifier
0489       //! @param[in] thePolygonOnTri polygon-on-tri to append
0490       Standard_EXPORT void AppendCachedPolygonOnTri(
0491         const BRepGraph_CoEdgeId                        theCoEdge,
0492         const occ::handle<Poly_PolygonOnTriangulation>& thePolygonOnTri);
0493 
0494       //! Bind a polygon-2D to the coedge's cached entry.
0495       //! @param[in] theCoEdge   typed coedge definition identifier
0496       //! @param[in] thePolygon2D polygon-2D handle (null clears the cached binding)
0497       Standard_EXPORT void SetCachedPolygon2D(const BRepGraph_CoEdgeId           theCoEdge,
0498                                               const occ::handle<Poly_Polygon2D>& thePolygon2D);
0499 
0500       //! Clear the coedge's cached mesh entry.
0501       //! @param[in] theCoEdge typed coedge definition identifier
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     //! Grouped face cache mutations.
0516     [[nodiscard]] FaceOps& Faces() { return myFaces; }
0517 
0518     //! Grouped edge cache mutations.
0519     [[nodiscard]] EdgeOps& Edges() { return myEdges; }
0520 
0521     //! Grouped coedge cache mutations.
0522     [[nodiscard]] CoEdgeOps& CoEdges() { return myCoEdges; }
0523 
0524     //! Promote all currently fresh default-slot cache mesh entries to persistent mesh reps.
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   //! @brief Polygonal and triangulation count queries.
0545   class PolyOps
0546   {
0547   public:
0548     //! Total number of face triangulation slots (including removed).
0549     [[nodiscard]] Standard_EXPORT uint32_t NbFaceTriangulations() const;
0550     //! Total number of edge polygon-3D slots (including removed).
0551     [[nodiscard]] Standard_EXPORT uint32_t NbEdgePolygons3D() const;
0552     //! Total number of coedge polygon-2D slots (including removed).
0553     [[nodiscard]] Standard_EXPORT uint32_t NbCoEdgePolygons2D() const;
0554     //! Total number of coedge polygon-on-triangulation slots (including removed).
0555     [[nodiscard]] Standard_EXPORT uint32_t NbCoEdgePolygonsOnTri() const;
0556 
0557     //! Number of non-removed face triangulation entries.
0558     [[nodiscard]] Standard_EXPORT uint32_t NbActiveTriangulations() const;
0559     //! Number of non-removed edge polygon-3D entries.
0560     [[nodiscard]] Standard_EXPORT uint32_t NbActivePolygons3D() const;
0561     //! Number of non-removed coedge polygon-2D entries.
0562     [[nodiscard]] Standard_EXPORT uint32_t NbActivePolygons2D() const;
0563     //! Number of non-removed coedge polygon-on-triangulation entries.
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   //! Cache-only reads.
0578   [[nodiscard]] const CacheView& Cache() const { return myCache; }
0579 
0580   //! Persistent (definition-resident) reads.
0581   [[nodiscard]] const PersistentView& Persistent() const { return myPersistent; }
0582 
0583   //! Effective reads - cache first, persistent fallback. Use when source is irrelevant.
0584   [[nodiscard]] const EffectiveView& Effective() const { return myEffective; }
0585 
0586   //! Cache mutations.
0587   [[nodiscard]] EditorView& Editor() { return myEditor; }
0588 
0589   //! Polygon/triangulation count queries.
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 // _BRepGraph_MeshView_HeaderFile