b311480e |
1 | -- Created on: 1997-09-11 |
2 | -- Created by: Roman BORISOV |
3 | -- Copyright (c) 1997-1999 Matra Datavision |
4 | -- Copyright (c) 1999-2012 OPEN CASCADE SAS |
5 | -- |
6 | -- The content of this file is subject to the Open CASCADE Technology Public |
7 | -- License Version 6.5 (the "License"). You may not use the content of this file |
8 | -- except in compliance with the License. Please obtain a copy of the License |
9 | -- at http://www.opencascade.org and read it completely before using this file. |
10 | -- |
11 | -- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its |
12 | -- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France. |
13 | -- |
14 | -- The Original Code and all software distributed under the License is |
15 | -- distributed on an "AS IS" basis, without warranty of any kind, and the |
16 | -- Initial Developer hereby disclaims all such warranties, including without |
17 | -- limitation, any warranties of merchantability, fitness for a particular |
18 | -- purpose or non-infringement. Please see the License for the specific terms |
19 | -- and conditions governing the rights and limitations under the License. |
20 | |
7fd59977 |
21 | |
22 | |
23 | class ApproxCurve from Geom2dConvert |
24 | ---Purpose: A framework to convert a 2D curve to a BSpline. |
25 | -- This is done by approximation within a given tolerance. |
26 | |
27 | uses |
28 | Curve from Geom2d, |
29 | BSplineCurve from Geom2d, |
30 | Shape from GeomAbs, |
31 | OutOfRange from Standard |
32 | |
33 | raises OutOfRange from Standard |
34 | |
35 | is |
36 | |
37 | Create (Curve: Curve from Geom2d; |
38 | Tol2d: Real; |
39 | Order: Shape from GeomAbs; |
40 | MaxSegments: Integer; |
41 | MaxDegree: Integer) returns ApproxCurve from Geom2dConvert; |
42 | ---Purpose: Constructs an approximation framework defined by |
43 | -- - the 2D conic Curve |
44 | -- - the tolerance value Tol2d |
45 | -- - the degree of continuity Order |
46 | -- - the maximum number of segments allowed MaxSegments |
47 | -- - the highest degree MaxDegree which the |
48 | -- polynomial defining the BSpline is allowed to have. |
49 | |
50 | Curve(me) returns BSplineCurve from Geom2d; |
51 | ---Purpose: Returns the 2D BSpline curve resulting from the |
52 | -- approximation algorithm. |
53 | |
54 | IsDone(me) returns Boolean from Standard; |
55 | ---Purpose: returns Standard_True if the approximation has |
56 | -- been done with within requiered tolerance |
57 | |
58 | HasResult(me) returns Boolean; |
59 | ---Purpose: returns Standard_True if the approximation did come out |
60 | -- with a result that is not NECESSARELY within the required tolerance |
61 | |
62 | MaxError(me) returns Real from Standard; |
63 | ---Purpose: Returns the greatest distance between a point on the |
64 | -- source conic and the BSpline curve resulting from the |
65 | -- approximation. (>0 when an approximation |
66 | -- has been done, 0 if no approximation) |
67 | |
68 | Dump(me; o: in out OStream); |
69 | ---Purpose: Print on the stream o information about the object |
70 | |
71 | fields |
72 | myCurve : Curve from Geom2d; |
73 | myIsDone : Boolean from Standard; |
74 | myHasResult : Boolean from Standard; |
75 | myBSplCurve : BSplineCurve from Geom2d; |
76 | myMaxError : Real from Standard; |
77 | |
78 | end ApproxCurve; |