Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:04:05

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 
0031   //! Destructor.
0032   virtual ~IMeshData_PCurve()
0033   {
0034   }
0035 
0036   //! Inserts new discretization point at the given position.
0037   Standard_EXPORT virtual void InsertPoint(
0038     const Standard_Integer thePosition,
0039     const gp_Pnt2d&        thePoint,
0040     const Standard_Real    theParamOnPCurve) = 0;
0041 
0042   //! Adds new discretization point to pcurve.
0043   Standard_EXPORT virtual void AddPoint (
0044     const gp_Pnt2d&     thePoint,
0045     const Standard_Real theParamOnPCurve) = 0;
0046 
0047   //! Returns discretization point with the given index.
0048   Standard_EXPORT virtual gp_Pnt2d& GetPoint (const Standard_Integer theIndex) = 0;
0049 
0050   //! Returns index in mesh corresponded to discretization point with the given index.
0051   Standard_EXPORT virtual Standard_Integer& GetIndex(const Standard_Integer theIndex) = 0;
0052 
0053   //! Removes point with the given index.
0054   Standard_EXPORT virtual void RemovePoint (const Standard_Integer theIndex) = 0;
0055 
0056   //! Returns forward flag of this pcurve.
0057   Standard_Boolean IsForward () const
0058   {
0059     return (myOrientation != TopAbs_REVERSED);
0060   }
0061 
0062   //! Returns internal flag of this pcurve.
0063   Standard_Boolean IsInternal() const
0064   {
0065     return (myOrientation == TopAbs_INTERNAL);
0066   }
0067 
0068   //! Returns orientation of the edge associated with current pcurve.
0069   TopAbs_Orientation GetOrientation() const
0070   {
0071     return myOrientation;
0072   }
0073 
0074   //! Returns discrete face pcurve is associated to.
0075   const IMeshData::IFacePtr& GetFace () const
0076   {
0077     return myDFace;
0078   }
0079 
0080   DEFINE_STANDARD_RTTIEXT(IMeshData_PCurve, IMeshData_ParametersList)
0081 
0082 protected:
0083 
0084   //! Constructor.
0085   IMeshData_PCurve (
0086     const IMeshData::IFacePtr& theDFace,
0087     const TopAbs_Orientation   theOrientation)
0088     : myDFace(theDFace),
0089       myOrientation(theOrientation)
0090   {
0091   }
0092 
0093 private:
0094 
0095   IMeshData::IFacePtr myDFace;
0096   TopAbs_Orientation  myOrientation;
0097 };
0098 
0099 #endif