0025256: Small optimization in Convert comp bezier to BSpline
[occt.git] / src / Convert / Convert_ConicToBSplineCurve.cdl
CommitLineData
b311480e 1-- Created on: 1991-10-10
2-- Created by: Jean Claude VAUTHIER
3-- Copyright (c) 1991-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
17deferred class ConicToBSplineCurve from Convert
18
19 ---Purpose: Root class for algorithms which convert a conic curve into
20 -- a BSpline curve (CircleToBSplineCurve, EllipseToBSplineCurve,
21 -- HyperbolaToBSplineCurve, ParabolaToBSplineCurve).
22 -- These algorithms all work on 2D curves from the gp
23 -- package and compute all the data needed to construct a
24 -- BSpline curve equivalent to the conic curve. This data consists of:
25 -- - the degree of the curve,
26 -- - the periodic characteristics of the curve,
27 -- - a poles table with associated weights,
28 -- - a knots table with associated multiplicities.
29 -- The abstract class ConicToBSplineCurve provides a
30 -- framework for storing and consulting this computed data.
31 -- The data may then be used to construct a
32 -- Geom2d_BSplineCurve curvSuper class of the following classes :
33 -- This abstract class implements the methods to get the geometric
34 -- representation of the B-spline curve equivalent to the conic.
35 -- The B-spline is computed at the creation time in the sub classes.
36 -- The B-spline curve is defined with its degree, its control points
37 -- (Poles), its weights, its knots and their multiplicity.
38 -- All the geometric entities used in this package are defined in 2D
39 -- space.
40 -- KeyWords :
41 -- Convert, Conic, BSplineCurve, 2D.
42
43uses Array1OfInteger from TColStd,
44 Array1OfReal from TColStd,
45 HArray1OfInteger from TColStd,
46 HArray1OfReal from TColStd,
47 HArray1OfPnt2d from TColgp,
48 ParameterisationType from Convert,
49 Pnt2d from gp
50
51
52raises OutOfRange from Standard,
53 ConstructionError from Standard
54
55
56is
57
58 Degree (me) returns Integer is static;
59 ---Purpose: Returns the degree of the BSpline curve whose data is
60 -- computed in this framework.
61
62 NbPoles (me) returns Integer is static;
63 ---Purpose: Returns the number of poles of the BSpline curve whose
64 -- data is computed in this framework.
65
66 NbKnots (me) returns Integer is static;
67 ---Purpose: Returns the number of knots of the BSpline curve whose
68 -- data is computed in this framework.
69
70 IsPeriodic(me) returns Boolean is static;
71 --- Purpose: Returns true if the BSpline curve whose data is computed in
72 -- this framework is periodic.
73
74 Pole (me; Index : Integer) returns Pnt2d
75 --- Purpose : Returns the pole of index Index to the poles table of the
76 -- BSpline curve whose data is computed in this framework.
77 -- Exceptions
78 -- Standard_OutOfRange if Index is outside the bounds of
79 -- the poles table of the BSpline curve whose data is computed in this framework.
80 raises OutOfRange
81 is static;
82
83
84 Weight (me; Index : Integer) returns Real
85 --- Purpose : Returns the weight of the pole of index Index to the poles
86 -- table of the BSpline curve whose data is computed in this framework.
87 -- Exceptions
88 -- Standard_OutOfRange if Index is outside the bounds of
89 -- the poles table of the BSpline curve whose data is computed in this framework.
90 raises OutOfRange
91 is static;
92
93
94 Knot (me; Index : Integer) returns Real
95 --- Purpose : Returns the knot of index Index to the knots table of the
96 -- BSpline curve whose data is computed in this framework.
97 -- Exceptions
98 -- Standard_OutOfRange if Index is outside the bounds of
99 -- the knots table of the BSpline curve whose data is computed in this framework.
100 raises OutOfRange
101 is static;
102
103
104 Multiplicity (me; Index : Integer) returns Integer
105 --- Purpose : Returns the multiplicity of the knot of index Index to the
106 -- knots table of the BSpline curve whose data is computed in this framework.
107 -- Exceptions
108 -- Standard_OutOfRange if Index is outside the bounds of
109 -- the knots table of the BSpline curve whose data is computed in this framework.
110 raises OutOfRange
111 is static;
112
113
114 Initialize (NumberOfPoles, NumberOfKnots, Degree : Integer);
115
116 BuildCosAndSin(me ;
117 Parametrisation : ParameterisationType from Convert ;
118 --
119 -- allowed parameterisation are TgtThetaOver2 and RationalC1
120 -- will raise otherwise
121 CosNumerator : in out HArray1OfReal from TColStd ;
122 -- Array has the following dimensions :
123 -- <1, NbPoles> without multiplying by the weights
124
125 SinNumerator : in out HArray1OfReal from TColStd ;
126 -- Array has the following dimensions :
127 -- <1, NbPoles> without multiplying by the weights
128 Denominator : in out HArray1OfReal from TColStd ;
129 -- Array has the following dimension
130 -- <1, NbPoles>
131 Degree : in out Integer from Standard ;
132 Knots : in out HArray1OfReal from TColStd ;
133 Mults : in out HArray1OfInteger from TColStd)
134 raises ConstructionError
135 -- see above
136 is static ;
137 -- builds a full periodic circle
138 --
139 BuildCosAndSin(me;
140 Parametrisation : ParameterisationType from Convert ;
141 UFirst : Real from Standard ;
142 ULast : Real from Standard ;
143 CosNumerator : in out HArray1OfReal from TColStd ;
144 -- Array has the following dimensions :
145 -- <1, NbPoles> without multiplying by the weights
146
147 SinNumerator : in out HArray1OfReal from TColStd ;
148 -- Array has the following dimensions :
149 -- <1, NbPoles> without multiplying by the weights
150 Denominator : in out HArray1OfReal from TColStd ;
151 -- Array has the following dimension
152 -- <1, NbPoles>
153 Degree : in out Integer from Standard ;
154 Knots : in out HArray1OfReal from TColStd ;
155 Mults : in out HArray1OfInteger from TColStd)
156 raises ConstructionError
157 is static ;
158
159fields
160
161 poles : HArray1OfPnt2d is protected;
162 weights : HArray1OfReal is protected;
163 knots : HArray1OfReal is protected;
164 mults : HArray1OfInteger is protected;
165 degree : Integer is protected;
166 nbPoles : Integer is protected;
167 nbKnots : Integer is protected;
168 isperiodic : Boolean is protected;
169
170end ConicToBSplineCurve;
171
172