0032630: Coding - get rid of unsused forward declarations [BinMDF to IFSelect]
[occt.git] / src / GeomAPI / GeomAPI_PointsToBSpline.hxx
1 // Created on: 1994-03-21
2 // Created by: Bruno DUMORTIER
3 // Copyright (c) 1994-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 _GeomAPI_PointsToBSpline_HeaderFile
18 #define _GeomAPI_PointsToBSpline_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
23
24 #include <Standard_Boolean.hxx>
25 #include <TColgp_Array1OfPnt.hxx>
26 #include <Standard_Integer.hxx>
27 #include <GeomAbs_Shape.hxx>
28 #include <Standard_Real.hxx>
29 #include <Approx_ParametrizationType.hxx>
30 #include <TColStd_Array1OfReal.hxx>
31 class Geom_BSplineCurve;
32
33
34 //! This  class  is  used  to  approximate a  BsplineCurve
35 //! passing  through an  array  of points,  with  a  given Continuity.
36 //! Describes functions for building a 3D BSpline
37 //! curve which approximates a set of points.
38 //! A PointsToBSpline object provides a framework for:
39 //! -   defining the data of the BSpline curve to be built,
40 //! -   implementing the approximation algorithm, and consulting the results.
41 class GeomAPI_PointsToBSpline 
42 {
43 public:
44
45   DEFINE_STANDARD_ALLOC
46
47   
48   //! Constructs an empty approximation algorithm.
49   //! Use an Init function to define and build the BSpline curve.
50   Standard_EXPORT GeomAPI_PointsToBSpline();
51   
52   //! Approximate  a BSpline  Curve passing  through  an
53   //! array of  Point.  The resulting BSpline will  have
54   //! the following properties:
55   //! 1- his degree will be in the range [Degmin,Degmax]
56   //! 2- his  continuity will be  at  least <Continuity>
57   //! 3- the distance from the point <Points> to the
58   //! BSpline will be lower to Tol3D
59   Standard_EXPORT GeomAPI_PointsToBSpline(const TColgp_Array1OfPnt& Points, const Standard_Integer DegMin = 3, const Standard_Integer DegMax = 8, const GeomAbs_Shape Continuity = GeomAbs_C2, const Standard_Real Tol3D = 1.0e-3);
60   
61   //! Approximate  a BSpline  Curve passing  through  an
62   //! array of  Point.  The resulting BSpline will  have
63   //! the following properties:
64   //! 1- his degree will be in the range [Degmin,Degmax]
65   //! 2- his  continuity will be  at  least <Continuity>
66   //! 3- the distance from the point <Points> to the
67   //! BSpline will be lower to Tol3D
68   Standard_EXPORT GeomAPI_PointsToBSpline(const TColgp_Array1OfPnt& Points, const Approx_ParametrizationType ParType, const Standard_Integer DegMin = 3, const Standard_Integer DegMax = 8, const GeomAbs_Shape Continuity = GeomAbs_C2, const Standard_Real Tol3D = 1.0e-3);
69   
70   //! Approximate  a  BSpline  Curve  passing through an
71   //! array of Point,  which parameters are given by the
72   //! array <Parameters>.
73   //! The resulting  BSpline   will have the   following
74   //! properties:
75   //! 1- his degree will be in the range [Degmin,Degmax]
76   //! 2- his  continuity will be  at  least <Continuity>
77   //! 3- the distance from the point <Points> to the
78   //! BSpline will be lower to Tol3D
79   Standard_EXPORT GeomAPI_PointsToBSpline(const TColgp_Array1OfPnt& Points, const TColStd_Array1OfReal& Parameters, const Standard_Integer DegMin = 3, const Standard_Integer DegMax = 8, const GeomAbs_Shape Continuity = GeomAbs_C2, const Standard_Real Tol3D = 1.0e-3);
80   
81   //! Approximate a BSpline Curve  passing through an
82   //! array of Point using variational smoothing algorithm,
83   //! which tries to minimize additional criterium:
84   //! Weight1*CurveLength + Weight2*Curvature + Weight3*Torsion
85   Standard_EXPORT GeomAPI_PointsToBSpline(const TColgp_Array1OfPnt& Points, const Standard_Real Weight1, const Standard_Real Weight2, const Standard_Real Weight3, const Standard_Integer DegMax = 8, const GeomAbs_Shape Continuity = GeomAbs_C2, const Standard_Real Tol3D = 1.0e-3);
86   
87   //! Approximate  a BSpline  Curve passing  through  an
88   //! array of  Point.  The resulting BSpline will  have
89   //! the following properties:
90   //! 1- his degree will be in the range [Degmin,Degmax]
91   //! 2- his  continuity will be  at  least <Continuity>
92   //! 3- the distance from the point <Points> to the
93   //! BSpline will be lower to Tol3D
94   Standard_EXPORT void Init (const TColgp_Array1OfPnt& Points, const Standard_Integer DegMin = 3, const Standard_Integer DegMax = 8, const GeomAbs_Shape Continuity = GeomAbs_C2, const Standard_Real Tol3D = 1.0e-3);
95   
96   //! Approximate  a BSpline  Curve passing  through  an
97   //! array of  Point.  The resulting BSpline will  have
98   //! the following properties:
99   //! 1- his degree will be in the range [Degmin,Degmax]
100   //! 2- his  continuity will be  at  least <Continuity>
101   //! 3- the distance from the point <Points> to the
102   //! BSpline will be lower to Tol3D
103   Standard_EXPORT void Init (const TColgp_Array1OfPnt& Points, const Approx_ParametrizationType ParType, const Standard_Integer DegMin = 3, const Standard_Integer DegMax = 8, const GeomAbs_Shape Continuity = GeomAbs_C2, const Standard_Real Tol3D = 1.0e-3);
104   
105   //! Approximate  a  BSpline  Curve  passing through an
106   //! array of Point,  which parameters are given by the
107   //! array <Parameters>.
108   //! The resulting  BSpline   will have the   following
109   //! properties:
110   //! 1- his degree will be in the range [Degmin,Degmax]
111   //! 2- his  continuity will be  at  least <Continuity>
112   //! 3- the distance from the point <Points> to the
113   //! BSpline will be lower to Tol3D
114   Standard_EXPORT void Init (const TColgp_Array1OfPnt& Points, const TColStd_Array1OfReal& Parameters, const Standard_Integer DegMin = 3, const Standard_Integer DegMax = 8, const GeomAbs_Shape Continuity = GeomAbs_C2, const Standard_Real Tol3D = 1.0e-3);
115   
116   //! Approximate a BSpline Curve  passing through an
117   //! array of Point using variational smoothing algorithm,
118   //! which tries to minimize additional criterium:
119   //! Weight1*CurveLength + Weight2*Curvature + Weight3*Torsion
120   Standard_EXPORT void Init (const TColgp_Array1OfPnt& Points, const Standard_Real Weight1, const Standard_Real Weight2, const Standard_Real Weight3, const Standard_Integer DegMax = 8, const GeomAbs_Shape Continuity = GeomAbs_C2, const Standard_Real Tol3D = 1.0e-3);
121   
122   //! Returns the computed BSpline curve.
123   //! Raises StdFail_NotDone if the curve is not built.
124   Standard_EXPORT const Handle(Geom_BSplineCurve)& Curve() const;
125 Standard_EXPORT  operator Handle(Geom_BSplineCurve)() const;
126   
127   Standard_EXPORT Standard_Boolean IsDone() const;
128
129
130
131
132 protected:
133
134
135
136
137
138 private:
139
140
141
142   Standard_Boolean myIsDone;
143   Handle(Geom_BSplineCurve) myCurve;
144
145
146 };
147
148
149
150
151
152
153
154 #endif // _GeomAPI_PointsToBSpline_HeaderFile