Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:03:15

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 
0029   //! Constructor.
0030   //! Initializes empty model.
0031   Standard_EXPORT BRepMeshData_Model (const TopoDS_Shape& theShape);
0032 
0033   //! Destructor.
0034   Standard_EXPORT virtual ~BRepMeshData_Model ();
0035 
0036   //! Returns maximum size of shape's bounding box.
0037   virtual Standard_Real GetMaxSize () const Standard_OVERRIDE
0038   {
0039     return myMaxSize;
0040   }
0041 
0042   //! Sets maximum size of shape's bounding box.
0043   void SetMaxSize (const Standard_Real theValue)
0044   {
0045     myMaxSize = theValue;
0046   }
0047 
0048   DEFINE_STANDARD_RTTIEXT(BRepMeshData_Model, IMeshData_Model)
0049 
0050 public: //! @name discrete faces
0051 
0052   //! Returns number of faces in discrete model.
0053   Standard_EXPORT virtual Standard_Integer FacesNb () const Standard_OVERRIDE;
0054 
0055   //! Adds new face to shape model.
0056   Standard_EXPORT virtual const IMeshData::IFaceHandle& AddFace (const TopoDS_Face& theFace) Standard_OVERRIDE;
0057 
0058   //! Gets model's face with the given index.
0059   Standard_EXPORT virtual const IMeshData::IFaceHandle& GetFace (const Standard_Integer theIndex) const Standard_OVERRIDE;
0060 
0061 public: //! @name discrete edges
0062 
0063   //! Returns number of edges in discrete model.
0064   Standard_EXPORT virtual Standard_Integer EdgesNb () const Standard_OVERRIDE;
0065 
0066   //! Adds new edge to shape model.
0067   Standard_EXPORT virtual const IMeshData::IEdgeHandle& AddEdge (const TopoDS_Edge& theEdge) Standard_OVERRIDE;
0068 
0069   //! Gets model's edge with the given index.
0070   Standard_EXPORT virtual const IMeshData::IEdgeHandle& GetEdge (const Standard_Integer theIndex) const Standard_OVERRIDE;
0071 
0072 private:
0073 
0074   Standard_Real                     myMaxSize;
0075   Handle (NCollection_IncAllocator) myAllocator;
0076   IMeshData::VectorOfIFaceHandles   myDFaces;
0077   IMeshData::VectorOfIEdgeHandles   myDEdges;
0078 };
0079 
0080 #endif