1 // Created on: 1995-06-13
2 // Created by: Bruno DUMORTIER
3 // Copyright (c) 1995-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _GeomLib_MakeCurvefromApprox_HeaderFile
18 #define _GeomLib_MakeCurvefromApprox_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
24 #include <AdvApprox_ApproxAFunction.hxx>
25 #include <Standard_Boolean.hxx>
26 #include <Standard_Integer.hxx>
27 class StdFail_NotDone;
28 class Standard_OutOfRange;
29 class AdvApprox_ApproxAFunction;
30 class Geom2d_BSplineCurve;
31 class Geom_BSplineCurve;
34 //! this class is used to construct the BSpline curve
35 //! from an Approximation ( ApproxAFunction from AdvApprox).
36 class GeomLib_MakeCurvefromApprox
43 Standard_EXPORT GeomLib_MakeCurvefromApprox(const AdvApprox_ApproxAFunction& Approx);
45 Standard_Boolean IsDone() const;
47 //! returns the number of 1D spaces of the Approx
48 Standard_EXPORT Standard_Integer Nb1DSpaces() const;
50 //! returns the number of 3D spaces of the Approx
51 Standard_EXPORT Standard_Integer Nb2DSpaces() const;
53 //! returns the number of 3D spaces of the Approx
54 Standard_EXPORT Standard_Integer Nb3DSpaces() const;
56 //! returns a polynomial curve whose poles correspond to
57 //! the Index2d 2D space
58 //! if Index2d not in the Range [1,Nb2dSpaces]
59 //! if the Approx is not Done
60 Standard_EXPORT Handle(Geom2d_BSplineCurve) Curve2d (const Standard_Integer Index2d) const;
62 //! returns a 2D curve building it from the 1D curve
63 //! in x at Index1d and y at Index2d amongst the
65 //! if Index1d not in the Range [1,Nb1dSpaces]
66 //! if Index2d not in the Range [1,Nb1dSpaces]
67 //! if the Approx is not Done
68 Standard_EXPORT Handle(Geom2d_BSplineCurve) Curve2dFromTwo1d (const Standard_Integer Index1d, const Standard_Integer Index2d) const;
70 //! returns a rational curve whose poles correspond to
71 //! the index2d of the 2D space and whose weights correspond
72 //! to one dimensional space of index 1d
73 //! if Index1d not in the Range [1,Nb1dSpaces]
74 //! if Index2d not in the Range [1,Nb2dSpaces]
75 //! if the Approx is not Done
76 Standard_EXPORT Handle(Geom2d_BSplineCurve) Curve2d (const Standard_Integer Index1d, const Standard_Integer Index2d) const;
78 //! returns a polynomial curve whose poles correspond to
79 //! the Index3D 3D space
80 //! if Index3D not in the Range [1,Nb3dSpaces]
81 //! if the Approx is not Done
82 Standard_EXPORT Handle(Geom_BSplineCurve) Curve (const Standard_Integer Index3d) const;
84 //! returns a rational curve whose poles correspond to
85 //! the index3D of the 3D space and whose weights correspond
86 //! to the index1d 1D space.
87 //! if Index1D not in the Range [1,Nb1dSpaces]
88 //! if Index3D not in the Range [1,Nb3dSpaces]
89 //! if the Approx is not Done
90 Standard_EXPORT Handle(Geom_BSplineCurve) Curve (const Standard_Integer Index1D, const Standard_Integer Index3D) const;
105 AdvApprox_ApproxAFunction myApprox;
111 #include <GeomLib_MakeCurvefromApprox.lxx>
117 #endif // _GeomLib_MakeCurvefromApprox_HeaderFile