Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-20 09:17:10

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   DEFINE_INC_ALLOC
0028 
0029   //! Constructor.
0030   Standard_EXPORT BRepMeshData_PCurve(const IMeshData::IFacePtr&                   theDFace,
0031                                       const TopAbs_Orientation                     theOrientation,
0032                                       const occ::handle<NCollection_IncAllocator>& theAllocator);
0033 
0034   //! Destructor.
0035   Standard_EXPORT ~BRepMeshData_PCurve() override;
0036 
0037   //! Inserts new discretization point at the given position.
0038   Standard_EXPORT void InsertPoint(const int       thePosition,
0039                                    const gp_Pnt2d& thePoint,
0040                                    const double    theParamOnPCurve) override;
0041 
0042   //! Adds new discretization point to pcurve.
0043   Standard_EXPORT void AddPoint(const gp_Pnt2d& thePoint, const double theParamOnPCurve) override;
0044 
0045   //! Returns discretization point with the given index.
0046   Standard_EXPORT gp_Pnt2d& GetPoint(const int theIndex) override;
0047 
0048   //! Returns index in mesh corresponded to discretization point with the given index.
0049   Standard_EXPORT int& GetIndex(const int theIndex) override;
0050 
0051   //! Removes point with the given index.
0052   Standard_EXPORT void RemovePoint(const int theIndex) override;
0053 
0054   //! Returns parameter with the given index.
0055   Standard_EXPORT double& GetParameter(const int theIndex) override;
0056 
0057   //! Returns number of parameters stored in pcurve.
0058   Standard_EXPORT int ParametersNb() const override;
0059 
0060   //! Clears parameters list.
0061   Standard_EXPORT void Clear(const bool isKeepEndPoints) override;
0062 
0063   DEFINE_STANDARD_RTTIEXT(BRepMeshData_PCurve, IMeshData_PCurve)
0064 
0065 protected:
0066   //! Removes parameter with the given index.
0067   Standard_EXPORT void removeParameter(const int theIndex) override;
0068 
0069 private:
0070   IMeshData::Model::SequenceOfPnt2d   myPoints2d;
0071   IMeshData::Model::SequenceOfReal    myParameters;
0072   IMeshData::Model::SequenceOfInteger myIndices;
0073 };
0074 
0075 #endif