0023024: Update headers of OCCT files
[occt.git] / src / Convert / Convert.cdl
CommitLineData
b311480e 1-- Created on: 1991-10-10
2-- Created by: Jean Claude VAUTHIER
3-- Copyright (c) 1991-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
24
25package Convert
26
27 --- Purpose:
28 --The Convert package provides algorithms to convert the following into a BSpline curve or surface:
29 -- - a bounded curve based on an elementary 2D curve (line, circle or conic) from the gp package,
30 -- - a bounded surface based on an elementary surface (cylinder, cone, sphere or torus) from the gp package,
31 -- - a series of adjacent 2D or 3D Bezier curves defined by their poles.
32 -- These algorithms compute the data needed to define the resulting BSpline curve or surface.
33 -- This elementary data (degrees, periodic characteristics, poles and weights, knots and
34 -- multiplicities) may then be used directly in an algorithm, or can be used to construct the curve
35 -- or the surface by calling the appropriate constructor provided by the classes
36 -- Geom2d_BSplineCurve, Geom_BSplineCurve or Geom_BSplineSurface.
37
38uses TColStd,
39 TColgp,
40 StdFail,
41 gp,
42 GeomAbs,
43 TCollection
44
45is
46
47enumeration ParameterisationType is
48 TgtThetaOver2,
49 TgtThetaOver2_1,
50 TgtThetaOver2_2,
51 TgtThetaOver2_3,
52 TgtThetaOver2_4,
53 ---Purpose:
54 -- Identifies a type of parameterization of a circle or ellipse represented as a BSpline curve.
55 -- For a circle with a center C and a radius R (for example a Geom2d_Circle or a Geom_Circle),
56 -- the natural parameterization is angular. It uses the angle Theta made by the vector CM with
57 -- the 'X Axis' of the circle's local coordinate system as parameter for the current point M. The
58 -- coordinates of the point M are as follows:
59 -- X = R *cos ( Theta )
60 -- y = R * sin ( Theta )
61 -- Similarly, for an ellipse with a center C, a major radius R and a minor radius r, the circle Circ
62 -- with center C and radius R (and located in the same plane as the ellipse) lends its natural
63 -- angular parameterization to the ellipse. This is achieved by an affine transformation in the plane
64 -- of the ellipse, in the ratio r / R, about the 'X Axis' of its local coordinate system. The
65 -- coordinates of the current point M are as follows:
66 -- X = R * cos ( Theta )
67 -- y = r * sin ( Theta )
68 -- The process of converting a circle or an ellipse into a rational or non-rational BSpline curve
69 -- transforms the Theta angular parameter into a parameter t. This ensures the rational or
70 -- polynomial parameterization of the resulting BSpline curve. Several types of parametric
71 -- transformations are available.
72 -- TgtThetaOver2
73 -- The most usual method is Convert_TgtThetaOver2 where the parameter t on the BSpline
74 -- curve is obtained by means of transformation of the following type:
75 -- t = tan ( Theta / 2 )
76 -- The result of this definition is:
77 -- cos ( Theta ) = ( 1. - t**2 ) / ( 1. + t**2 )
78 -- sin ( Theta ) = 2. * t / ( 1. + t**2 )
79 -- which ensures the rational parameterization of the circle or the ellipse. However, this is not the
80 -- most suitable parameterization method where the arc of the circle or ellipse has a large opening
81 -- angle. In such cases, the curve will be represented by a BSpline with intermediate knots. Each
82 -- span, i.e. each portion of curve between two different knot values, will use parameterization of
83 -- this type.
84 -- The number of spans is calculated using the following rule:
85 -- ( 1.2 * Delta / Pi ) + 1
86 -- where Delta is equal to the opening angle (in radians) of the arc of the circle (Delta is
87 -- equal to 2.* Pi in the case of a complete circle).
88 -- The resulting BSpline curve is "exact", i.e. computing any point of parameter t on the BSpline
89 -- curve gives an exact point on the circle or the ellipse.
90 -- TgtThetaOver2_N
91 -- Where N is equal to 1, 2, 3 or 4, this ensures the same type of parameterization as
92 -- Convert_TgtThetaOver2 but sets the number of spans in the resulting BSpline curve to N
93 -- rather than allowing the algorithm to make this calculation.
94 -- However, the opening angle Delta (parametric angle, given in radians) of the arc of the circle
95 -- (or of the ellipse) must comply with the following:
96 -- - Delta <= 0.9999 * Pi for the Convert_TgtThetaOver2_1 method, or
97 -- - Delta <= 1.9999 * Pi for the Convert_TgtThetaOver2_2 method.
98 -- QuasiAngular
99 -- The Convert_QuasiAngular method of parameterization uses a different type of rational
100 -- parameterization. This method ensures that the parameter t along the resulting BSpline curve is
101 -- very close to the natural parameterization angle Theta of the circle or ellipse (i.e. which uses
102 -- the functions sin ( Theta ) and cos ( Theta ).
103 -- The resulting BSpline curve is "exact", i.e. computing any point of parameter t on the BSpline
104 -- curve gives an exact point on the circle or the ellipse.
105 -- RationalC1
106 -- The Convert_RationalC1 method of parameterization uses a further type of rational
107 -- parameterization. This method ensures that the equation relating to the resulting BSpline curve
108 -- has a "C1" continuous denominator, which is not the case with the above methods. RationalC1
109 -- enhances the degree of continuity at the junction point of the different spans of the curve.
110 -- The resulting BSpline curve is "exact", i.e. computing any point of parameter t on the BSpline
111 -- curve gives an exact point on the circle or the ellipse.
112 -- Polynomial
113 -- The Convert_Polynomial method is used to produce polynomial (i.e. non-rational)
114 -- parameterization of the resulting BSpline curve with 8 poles (i.e. a polynomial degree equal to 7).
115 -- However, the result is an approximation of the circle or ellipse (i.e. computing the point of
116 -- parameter t on the BSpline curve does not give an exact point on the circle or the ellipse).
117 QuasiAngular,
118 RationalC1,
119 Polynomial;
120
121
122
123 imported CosAndSinEvalFunction ;
124 -- typedef void *CosAndSinEvalFunction(Standard_Real,
125 -- const Standard_Integer,
126 -- const TColgp_Array1OfPnt2d&
127 -- const TColStd_Array1OfReal&
128 -- const TColStd_Array1OfInteger&
129 -- Standard_Real Result[2]
130 --
131
132
133 deferred class ConicToBSplineCurve;
134 --- Purpose :
135 -- Super class of the following classes :
136
137 class CircleToBSplineCurve;
138 --- Purpose : Converts a circle into a B-spline curve.
139
140 class EllipseToBSplineCurve;
141 --- Purpose : Converts an ellipse into a B-spline curve.
142
143 class HyperbolaToBSplineCurve;
144 --- Purpose : Converts an hyperbola into a B-spline curve.
145
146 class ParabolaToBSplineCurve;
147 --- Purpose : Converts a parabola into a B-spline curve.
148
149
150
151
152 deferred class ElementarySurfaceToBSplineSurface;
153 -- Super class of the following classes :
154
155 class CylinderToBSplineSurface;
156 --- Purpose : Converts a bounded cylinder into a B-spline surface.
157
158 class ConeToBSplineSurface;
159 --- Purpose : Converts a bounded cone into a B-spline surface.
160
161 class TorusToBSplineSurface;
162 --- Purpose : Converts a torus into a B-spline surface.
163
164 class SphereToBSplineSurface;
165 --- Purpose : Converts a sphere into a B-spline surface.
166
167
168
169 class SequenceOfArray1OfPoles
170 instantiates Sequence from TCollection( HArray1OfPnt from TColgp);
171
172 class CompBezierCurvesToBSplineCurve;
173 ---Purpose: Converts a list of connecting BezierCurves
174 -- into a B-spline curve.
175
176 alias SequenceOfArray1OfPoles2d is SequenceOfArray1OfPnt2d from TColgp;
177
178
179 class CompBezierCurves2dToBSplineCurve2d;
180 ---Purpose: Converts a list of connecting BezierCurves
181 -- into a B-spline curve.
182
183 class CompPolynomialToPoles;
184 ---Purpose: Convert a serie of Polynomial N-Dimensional
185 -- Curves that are have continuity CM to an
186 -- N-Dimensional Bspline Curve that has continuity
187 -- CM
188
189 class GridPolynomialToPoles;
190 ---Purpose: Convert a grid of Polynomial Surfaces
191 -- that are have continuity CM to an
192 -- Bspline Surface that has continuity
193 -- CM
194
195
196end Convert;