Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-07-29 09:14:24

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   AppCont_Function()
0031   {
0032     myNbPnt   = -1;
0033     myNbPnt2d = -1;
0034   }
0035 
0036   //! Get number of 3d and 2d points returned by "Value" and "D1" functions.
0037   void GetNumberOfPoints(Standard_Integer& theNbPnt, Standard_Integer& theNbPnt2d) const
0038   {
0039     theNbPnt   = myNbPnt;
0040     theNbPnt2d = myNbPnt2d;
0041   }
0042 
0043   //! Get number of 3d points returned by "Value" and "D1" functions.
0044   Standard_Integer GetNbOf3dPoints() const { return myNbPnt; }
0045 
0046   //! Get number of 2d points returned by "Value" and "D1" functions.
0047   Standard_Integer GetNbOf2dPoints() const { return myNbPnt2d; }
0048 
0049   //! Destructor
0050   virtual ~AppCont_Function() {}
0051 
0052   //! Returns the first parameter of the function.
0053   virtual Standard_Real FirstParameter() const = 0;
0054 
0055   //! Returns the last parameter of the function.
0056   virtual Standard_Real LastParameter() const = 0;
0057 
0058   //! Returns the point at parameter <theU>.
0059   virtual Standard_Boolean Value(const Standard_Real           theU,
0060                                  NCollection_Array1<gp_Pnt2d>& thePnt2d,
0061                                  NCollection_Array1<gp_Pnt>&   thePnt) const = 0;
0062 
0063   //! Returns the derivative at parameter <theU>.
0064   virtual Standard_Boolean D1(const Standard_Real           theU,
0065                               NCollection_Array1<gp_Vec2d>& theVec2d,
0066                               NCollection_Array1<gp_Vec>&   theVec) const = 0;
0067 
0068   //! Return information about peridicity in output paramateters space.
0069   //! @param theDimIdx Defines index in output parameters space. 1 <= theDimIdx <= 3 * myNbPnt + 2 *
0070   //! myNbPnt2d.
0071   virtual void PeriodInformation(const Standard_Integer /*theDimIdx*/,
0072                                  Standard_Boolean& IsPeriodic,
0073                                  Standard_Real&    thePeriod) const
0074   {
0075     IsPeriodic = Standard_False;
0076     thePeriod  = 0.0;
0077   };
0078 
0079 protected:
0080   Standard_Integer myNbPnt;
0081   Standard_Integer myNbPnt2d;
0082 };
0083 
0084 #endif