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_PCurve_HeaderFile
0017 #define _BRepMeshData_PCurve_HeaderFile
0018 
0019 #include <IMeshData_PCurve.hxx>
0020 #include <Standard_Type.hxx>
0021 #include <NCollection_IncAllocator.hxx>
0022 
0023 //! Default implementation of pcurve data model entity.
0024 class BRepMeshData_PCurve : public IMeshData_PCurve
0025 {
0026 public:
0027 
0028   DEFINE_INC_ALLOC
0029 
0030   //! Constructor.
0031   Standard_EXPORT BRepMeshData_PCurve (
0032     const IMeshData::IFacePtr&               theDFace,
0033     const TopAbs_Orientation                 theOrientation,
0034     const Handle (NCollection_IncAllocator)& theAllocator);
0035 
0036   //! Destructor.
0037   Standard_EXPORT virtual ~BRepMeshData_PCurve ();
0038 
0039   //! Inserts new discretization point at the given position.
0040   Standard_EXPORT virtual void InsertPoint(
0041     const Standard_Integer thePosition,
0042     const gp_Pnt2d&        thePoint,
0043     const Standard_Real    theParamOnPCurve) Standard_OVERRIDE;
0044 
0045   //! Adds new discretization point to pcurve.
0046   Standard_EXPORT virtual void AddPoint (
0047     const gp_Pnt2d&     thePoint,
0048     const Standard_Real theParamOnPCurve) Standard_OVERRIDE;
0049 
0050   //! Returns discretization point with the given index.
0051   Standard_EXPORT virtual gp_Pnt2d& GetPoint (const Standard_Integer theIndex) Standard_OVERRIDE;
0052 
0053   //! Returns index in mesh corresponded to discretization point with the given index.
0054   Standard_EXPORT virtual Standard_Integer& GetIndex(const Standard_Integer theIndex) Standard_OVERRIDE;
0055 
0056   //! Removes point with the given index.
0057   Standard_EXPORT virtual void RemovePoint (const Standard_Integer theIndex) Standard_OVERRIDE;
0058 
0059   //! Returns parameter with the given index.
0060   Standard_EXPORT virtual Standard_Real& GetParameter (const Standard_Integer theIndex) Standard_OVERRIDE;
0061 
0062   //! Returns number of parameters stored in pcurve.
0063   Standard_EXPORT virtual Standard_Integer ParametersNb() const Standard_OVERRIDE;
0064 
0065   //! Clears parameters list.
0066   Standard_EXPORT virtual void Clear(const Standard_Boolean isKeepEndPoints) Standard_OVERRIDE;
0067 
0068   DEFINE_STANDARD_RTTIEXT(BRepMeshData_PCurve, IMeshData_PCurve)
0069 
0070 protected:
0071 
0072   //! Removes parameter with the given index.
0073   Standard_EXPORT virtual void removeParameter (const Standard_Integer theIndex) Standard_OVERRIDE;
0074 
0075 private:
0076 
0077   IMeshData::Model::SequenceOfPnt2d   myPoints2d;
0078   IMeshData::Model::SequenceOfReal    myParameters;
0079   IMeshData::Model::SequenceOfInteger myIndices;
0080 };
0081 
0082 #endif