Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-13 09:16:54

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 _IMeshData_PCurve_HeaderFile
0017 #define _IMeshData_PCurve_HeaderFile
0018 
0019 #include <IMeshData_ParametersList.hxx>
0020 #include <Standard_Type.hxx>
0021 #include <IMeshData_Face.hxx>
0022 
0023 class gp_Pnt2d;
0024 
0025 //! Interface class representing pcurve of edge associated with discrete face.
0026 //! Indexation of points starts from zero.
0027 class IMeshData_PCurve : public IMeshData_ParametersList
0028 {
0029 public:
0030   //! Destructor.
0031   ~IMeshData_PCurve() override = default;
0032 
0033   //! Inserts new discretization point at the given position.
0034   Standard_EXPORT virtual void InsertPoint(const int       thePosition,
0035                                            const gp_Pnt2d& thePoint,
0036                                            const double    theParamOnPCurve) = 0;
0037 
0038   //! Adds new discretization point to pcurve.
0039   Standard_EXPORT virtual void AddPoint(const gp_Pnt2d& thePoint,
0040                                         const double    theParamOnPCurve) = 0;
0041 
0042   //! Returns discretization point with the given index.
0043   Standard_EXPORT virtual gp_Pnt2d& GetPoint(const int theIndex) = 0;
0044 
0045   //! Returns index in mesh corresponded to discretization point with the given index.
0046   Standard_EXPORT virtual int& GetIndex(const int theIndex) = 0;
0047 
0048   //! Removes point with the given index.
0049   Standard_EXPORT virtual void RemovePoint(const int theIndex) = 0;
0050 
0051   //! Returns forward flag of this pcurve.
0052   bool IsForward() const { return (myOrientation != TopAbs_REVERSED); }
0053 
0054   //! Returns internal flag of this pcurve.
0055   bool IsInternal() const { return (myOrientation == TopAbs_INTERNAL); }
0056 
0057   //! Returns orientation of the edge associated with current pcurve.
0058   TopAbs_Orientation GetOrientation() const { return myOrientation; }
0059 
0060   //! Returns discrete face pcurve is associated to.
0061   const IMeshData::IFacePtr& GetFace() const { return myDFace; }
0062 
0063   DEFINE_STANDARD_RTTIEXT(IMeshData_PCurve, IMeshData_ParametersList)
0064 
0065 protected:
0066   //! Constructor.
0067   IMeshData_PCurve(const IMeshData::IFacePtr& theDFace, const TopAbs_Orientation theOrientation)
0068       : myDFace(theDFace),
0069         myOrientation(theOrientation)
0070   {
0071   }
0072 
0073 private:
0074   IMeshData::IFacePtr myDFace;
0075   TopAbs_Orientation  myOrientation;
0076 };
0077 
0078 #endif