Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-16 09:16:42

0001 // Created on: 2016-04-07
0002 // Copyright (c) 2016 OPEN CASCADE SAS
0003 // Created by: Oleg AGASHIN
0004 //
0005 // This file is part of Open CASCADE Technology software library.
0006 //
0007 // This library is free software; you can redistribute it and/or modify it under
0008 // the terms of the GNU Lesser General Public License version 2.1 as published
0009 // by the Free Software Foundation, with special exception defined in the file
0010 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0011 // distribution for complete text of the license and disclaimer of any warranty.
0012 //
0013 // Alternatively, this file may be used under the terms of Open CASCADE
0014 // commercial license or contractual agreement.
0015 
0016 #ifndef _BRepMeshData_Model_HeaderFile
0017 #define _BRepMeshData_Model_HeaderFile
0018 
0019 #include <IMeshData_Model.hxx>
0020 #include <IMeshData_Types.hxx>
0021 #include <NCollection_IncAllocator.hxx>
0022 #include <IMeshData_Edge.hxx>
0023 
0024 //! Default implementation of model entity.
0025 class BRepMeshData_Model : public IMeshData_Model
0026 {
0027 public:
0028   //! Constructor.
0029   //! Initializes empty model.
0030   Standard_EXPORT BRepMeshData_Model(const TopoDS_Shape& theShape);
0031 
0032   //! Destructor.
0033   Standard_EXPORT ~BRepMeshData_Model() override;
0034 
0035   //! Returns maximum size of shape's bounding box.
0036   double GetMaxSize() const override { return myMaxSize; }
0037 
0038   //! Sets maximum size of shape's bounding box.
0039   void SetMaxSize(const double theValue) { myMaxSize = theValue; }
0040 
0041   DEFINE_STANDARD_RTTIEXT(BRepMeshData_Model, IMeshData_Model)
0042 
0043 public: //! @name discrete faces
0044   //! Returns number of faces in discrete model.
0045   Standard_EXPORT int FacesNb() const override;
0046 
0047   //! Adds new face to shape model.
0048   Standard_EXPORT const IMeshData::IFaceHandle& AddFace(const TopoDS_Face& theFace) override;
0049 
0050   //! Gets model's face with the given index.
0051   Standard_EXPORT const IMeshData::IFaceHandle& GetFace(const int theIndex) const override;
0052 
0053 public: //! @name discrete edges
0054   //! Returns number of edges in discrete model.
0055   Standard_EXPORT int EdgesNb() const override;
0056 
0057   //! Adds new edge to shape model.
0058   Standard_EXPORT const IMeshData::IEdgeHandle& AddEdge(const TopoDS_Edge& theEdge) override;
0059 
0060   //! Gets model's edge with the given index.
0061   Standard_EXPORT const IMeshData::IEdgeHandle& GetEdge(const int theIndex) const override;
0062 
0063 private:
0064   double                                myMaxSize;
0065   occ::handle<NCollection_IncAllocator> myAllocator;
0066   IMeshData::VectorOfIFaceHandles       myDFaces;
0067   IMeshData::VectorOfIEdgeHandles       myDEdges;
0068 };
0069 
0070 #endif