b311480e |
1 | -- Created on: 1997-09-11 |
2 | -- Created by: Roman BORISOV |
3 | -- Copyright (c) 1997-1999 Matra Datavision |
973c2be1 |
4 | -- Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e |
5 | -- |
973c2be1 |
6 | -- This file is part of Open CASCADE Technology software library. |
b311480e |
7 | -- |
d5f74e42 |
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 |
973c2be1 |
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. |
b311480e |
13 | -- |
973c2be1 |
14 | -- Alternatively, this file may be used under the terms of Open CASCADE |
15 | -- commercial license or contractual agreement. |
7fd59977 |
16 | |
17 | class ApproxCurve from GeomConvert |
18 | ---Purpose: A framework to convert a 3D curve to a 3D BSpline. |
19 | -- This is done by approximation to a BSpline curve within a given tolerance. |
20 | |
21 | uses |
22 | Curve from Geom, |
23 | BSplineCurve from Geom, |
be09e9bf |
24 | HCurve from Adaptor3d, |
7fd59977 |
25 | Shape from GeomAbs, |
26 | OutOfRange from Standard |
27 | |
28 | raises OutOfRange from Standard, |
29 | ConstructionError from Standard |
30 | |
31 | is |
32 | |
33 | Create (Curve: Curve from Geom; |
34 | Tol3d: Real; |
35 | Order: Shape from GeomAbs; |
36 | MaxSegments: Integer; |
37 | MaxDegree: Integer) returns ApproxCurve; |
38 | ---Purpose: Constructs a curve approximation framework defined by - |
39 | -- - the conic Curve, |
40 | -- - the tolerance value Tol3d, |
41 | -- - the degree of continuity Order, |
42 | -- - the maximum number of segments |
43 | -- MaxSegments allowed in the resulting BSpline curve, and |
44 | -- - the highest degree MaxDeg which the |
45 | -- polynomial defining the BSpline curve may have. |
be09e9bf |
46 | |
47 | Create (Curve: HCurve from Adaptor3d; |
48 | Tol3d: Real; |
49 | Order: Shape from GeomAbs; |
50 | MaxSegments: Integer; |
51 | MaxDegree: Integer) returns ApproxCurve; |
52 | ---Purpose: Constructs a curve approximation framework defined by - |
53 | -- - the Curve, |
54 | -- - the tolerance value Tol3d, |
55 | -- - the degree of continuity Order, |
56 | -- - the maximum number of segments |
57 | -- MaxSegments allowed in the resulting BSpline curve, and |
58 | -- - the highest degree MaxDeg which the |
59 | -- polynomial defining the BSpline curve may have. |
7fd59977 |
60 | |
61 | Curve(me) returns BSplineCurve from Geom; |
62 | --- Purpose: Returns the BSpline curve resulting from the approximation algorithm. |
63 | |
64 | IsDone(me) returns Boolean from Standard; |
65 | ---Purpose: returns Standard_True if the approximation has |
66 | -- been done within requiered tolerance |
67 | |
68 | HasResult(me) returns Boolean; |
69 | ---Purpose: Returns Standard_True if the approximation did come out |
70 | -- with a result that is not NECESSARELY within the required tolerance |
71 | |
72 | MaxError(me) returns Real from Standard; |
73 | ---Purpose: Returns the greatest distance between a point on the |
74 | -- source conic and the BSpline curve resulting from the |
75 | -- approximation. (>0 when an approximation |
76 | -- has been done, 0 if no approximation) |
77 | |
78 | Dump(me; o: in out OStream); |
79 | ---Purpose: Print on the stream o information about the object |
80 | |
be09e9bf |
81 | Approximate(me: in out; |
82 | theCurve: HCurve from Adaptor3d; |
83 | theTol3d: Real; |
84 | theOrder: Shape from GeomAbs; |
85 | theMaxSegments: Integer; |
86 | theMaxDegree: Integer) is private; |
87 | ---Purpose: Converts a curve to B-spline |
88 | |
7fd59977 |
89 | fields |
7fd59977 |
90 | myIsDone : Boolean from Standard; |
91 | myHasResult : Boolean from Standard; |
92 | myBSplCurve : BSplineCurve from Geom; |
93 | myMaxError : Real from Standard; |
94 | |
95 | end ApproxCurve; |