Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-19 09:27:58

0001 // Created on: 1995-06-13
0002 // Created by: Bruno DUMORTIER
0003 // Copyright (c) 1995-1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016 
0017 #ifndef _GeomLib_MakeCurvefromApprox_HeaderFile
0018 #define _GeomLib_MakeCurvefromApprox_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <AdvApprox_ApproxAFunction.hxx>
0025 #include <Standard_Integer.hxx>
0026 class Geom2d_BSplineCurve;
0027 class Geom_BSplineCurve;
0028 
0029 //! this class is used to construct the BSpline curve
0030 //! from an Approximation (ApproxAFunction from AdvApprox).
0031 class GeomLib_MakeCurvefromApprox
0032 {
0033 public:
0034   DEFINE_STANDARD_ALLOC
0035 
0036   Standard_EXPORT GeomLib_MakeCurvefromApprox(const AdvApprox_ApproxAFunction& Approx);
0037 
0038   bool IsDone() const;
0039 
0040   //! returns the number of 1D spaces of the Approx
0041   Standard_EXPORT int Nb1DSpaces() const;
0042 
0043   //! returns the number of 3D spaces of the Approx
0044   Standard_EXPORT int Nb2DSpaces() const;
0045 
0046   //! returns the number of 3D spaces of the Approx
0047   Standard_EXPORT int Nb3DSpaces() const;
0048 
0049   //! returns a polynomial curve whose poles correspond to
0050   //! the Index2d 2D space
0051   //! if Index2d not in the Range [1,Nb2dSpaces]
0052   //! if the Approx is not Done
0053   Standard_EXPORT occ::handle<Geom2d_BSplineCurve> Curve2d(const int Index2d) const;
0054 
0055   //! returns a 2D curve building it from the 1D curve
0056   //! in x at Index1d and y at Index2d amongst the
0057   //! 1D curves
0058   //! if Index1d not in the Range [1,Nb1dSpaces]
0059   //! if Index2d not in the Range [1,Nb1dSpaces]
0060   //! if the Approx is not Done
0061   Standard_EXPORT occ::handle<Geom2d_BSplineCurve> Curve2dFromTwo1d(const int Index1d,
0062                                                                     const int Index2d) const;
0063 
0064   //! returns a rational curve whose poles correspond to
0065   //! the index2d of the 2D space and whose weights correspond
0066   //! to one dimensional space of index 1d
0067   //! if Index1d not in the Range [1,Nb1dSpaces]
0068   //! if Index2d not in the Range [1,Nb2dSpaces]
0069   //! if the Approx is not Done
0070   Standard_EXPORT occ::handle<Geom2d_BSplineCurve> Curve2d(const int Index1d,
0071                                                            const int Index2d) const;
0072 
0073   //! returns a polynomial curve whose poles correspond to
0074   //! the Index3D 3D space
0075   //! if Index3D not in the Range [1,Nb3dSpaces]
0076   //! if the Approx is not Done
0077   Standard_EXPORT occ::handle<Geom_BSplineCurve> Curve(const int Index3d) const;
0078 
0079   //! returns a rational curve whose poles correspond to
0080   //! the index3D of the 3D space and whose weights correspond
0081   //! to the index1d 1D space.
0082   //! if Index1D not in the Range [1,Nb1dSpaces]
0083   //! if Index3D not in the Range [1,Nb3dSpaces]
0084   //! if the Approx is not Done
0085   Standard_EXPORT occ::handle<Geom_BSplineCurve> Curve(const int Index1D, const int Index3D) const;
0086 
0087 private:
0088   AdvApprox_ApproxAFunction myApprox;
0089 };
0090 
0091 #include <GeomLib_MakeCurvefromApprox.lxx>
0092 
0093 #endif // _GeomLib_MakeCurvefromApprox_HeaderFile