| 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 |
| 5 | // |
| 6 | // This file is part of Open CASCADE Technology software library. |
| 7 | // |
| 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. |
| 13 | // |
| 14 | // Alternatively, this file may be used under the terms of Open CASCADE |
| 15 | // commercial license or contractual agreement. |
| 16 | |
| 17 | #ifndef _GeomLib_MakeCurvefromApprox_HeaderFile |
| 18 | #define _GeomLib_MakeCurvefromApprox_HeaderFile |
| 19 | |
| 20 | #include <Standard.hxx> |
| 21 | #include <Standard_DefineAlloc.hxx> |
| 22 | #include <Standard_Handle.hxx> |
| 23 | |
| 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; |
| 32 | |
| 33 | |
| 34 | //! this class is used to construct the BSpline curve |
| 35 | //! from an Approximation ( ApproxAFunction from AdvApprox). |
| 36 | class GeomLib_MakeCurvefromApprox |
| 37 | { |
| 38 | public: |
| 39 | |
| 40 | DEFINE_STANDARD_ALLOC |
| 41 | |
| 42 | |
| 43 | Standard_EXPORT GeomLib_MakeCurvefromApprox(const AdvApprox_ApproxAFunction& Approx); |
| 44 | |
| 45 | Standard_Boolean IsDone() const; |
| 46 | |
| 47 | //! returns the number of 1D spaces of the Approx |
| 48 | Standard_EXPORT Standard_Integer Nb1DSpaces() const; |
| 49 | |
| 50 | //! returns the number of 3D spaces of the Approx |
| 51 | Standard_EXPORT Standard_Integer Nb2DSpaces() const; |
| 52 | |
| 53 | //! returns the number of 3D spaces of the Approx |
| 54 | Standard_EXPORT Standard_Integer Nb3DSpaces() const; |
| 55 | |
| 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; |
| 61 | |
| 62 | //! returns a 2D curve building it from the 1D curve |
| 63 | //! in x at Index1d and y at Index2d amongst the |
| 64 | //! 1D curves |
| 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; |
| 69 | |
| 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; |
| 77 | |
| 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; |
| 83 | |
| 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; |
| 91 | |
| 92 | |
| 93 | |
| 94 | |
| 95 | protected: |
| 96 | |
| 97 | |
| 98 | |
| 99 | |
| 100 | |
| 101 | private: |
| 102 | |
| 103 | |
| 104 | |
| 105 | AdvApprox_ApproxAFunction myApprox; |
| 106 | |
| 107 | |
| 108 | }; |
| 109 | |
| 110 | |
| 111 | #include <GeomLib_MakeCurvefromApprox.lxx> |
| 112 | |
| 113 | |
| 114 | |
| 115 | |
| 116 | |
| 117 | #endif // _GeomLib_MakeCurvefromApprox_HeaderFile |