Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:02:56

0001 // Copyright (c) 1995-1999 Matra Datavision
0002 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0003 //
0004 // This file is part of Open CASCADE Technology software library.
0005 //
0006 // This library is free software; you can redistribute it and/or modify it under
0007 // the terms of the GNU Lesser General Public License version 2.1 as published
0008 // by the Free Software Foundation, with special exception defined in the file
0009 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0010 // distribution for complete text of the license and disclaimer of any warranty.
0011 //
0012 // Alternatively, this file may be used under the terms of Open CASCADE
0013 // commercial license or contractual agreement.
0014 
0015 #ifndef AppCont_Function_HeaderFile
0016 #define AppCont_Function_HeaderFile
0017 
0018 #include <gp_Pnt.hxx>
0019 #include <gp_Pnt2d.hxx>
0020 #include <gp_Vec.hxx>
0021 #include <gp_Vec2d.hxx>
0022 #include <NCollection_Array1.hxx>
0023 #include <Standard_Integer.hxx>
0024 
0025 //! Class describing a continuous 3d and/or function f(u).
0026 //! This class must be provided by the user to use the approximation algorithm FittingCurve.
0027 class AppCont_Function
0028 {
0029 public:
0030 
0031   AppCont_Function()
0032   {
0033     myNbPnt = -1;
0034     myNbPnt2d = -1;
0035   }
0036 
0037   //! Get number of 3d and 2d points returned by "Value" and "D1" functions.
0038   void GetNumberOfPoints(Standard_Integer& theNbPnt, Standard_Integer& theNbPnt2d) const
0039   {
0040     theNbPnt = myNbPnt;
0041     theNbPnt2d = myNbPnt2d;
0042   }
0043 
0044   //! Get number of 3d points returned by "Value" and "D1" functions.
0045   Standard_Integer GetNbOf3dPoints() const
0046   {
0047     return myNbPnt;
0048   }
0049 
0050   //! Get number of 2d points returned by "Value" and "D1" functions.
0051   Standard_Integer GetNbOf2dPoints() const
0052   {
0053     return myNbPnt2d;
0054   }
0055 
0056   //! Destructor
0057   virtual ~AppCont_Function() {}
0058 
0059   //! Returns the first parameter of the function.
0060   virtual Standard_Real FirstParameter() const = 0;
0061 
0062   //! Returns the last parameter of the function.
0063   virtual Standard_Real LastParameter() const = 0;
0064 
0065   //! Returns the point at parameter <theU>.
0066   virtual Standard_Boolean Value (const Standard_Real   theU,
0067                                   NCollection_Array1<gp_Pnt2d>& thePnt2d,
0068                                   NCollection_Array1<gp_Pnt>&   thePnt) const = 0;
0069 
0070   //! Returns the derivative at parameter <theU>.
0071   virtual Standard_Boolean D1 (const Standard_Real   theU,
0072                                NCollection_Array1<gp_Vec2d>& theVec2d,
0073                                NCollection_Array1<gp_Vec>&   theVec) const = 0;
0074 
0075   //! Return information about peridicity in output paramateters space. 
0076   //! @param theDimIdx Defines index in output parameters space. 1 <= theDimIdx <= 3 * myNbPnt + 2 * myNbPnt2d.
0077   virtual void PeriodInformation (const Standard_Integer /*theDimIdx*/,
0078                                   Standard_Boolean&      IsPeriodic,
0079                                   Standard_Real&         thePeriod) const
0080   {
0081     IsPeriodic = Standard_False;
0082     thePeriod = 0.0;
0083   };
0084 
0085 
0086 protected:
0087   Standard_Integer myNbPnt;
0088   Standard_Integer myNbPnt2d;
0089 };
0090 
0091 #endif