b311480e |
1 | -- Created on: 1993-04-02 |
2 | -- Created by: Bruno DUMORTIER |
3 | -- Copyright (c) 1993-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 | deferred class Curve2d from Adaptor2d |
18 | |
19 | ---Purpose: Root class for 2D curves on which geometric |
20 | -- algorithms work. |
21 | -- An adapted curve is an interface between the |
22 | -- services provided by a curve, and those required of |
23 | -- the curve by algorithms, which use it. |
24 | -- A derived concrete class is provided: |
25 | -- Geom2dAdaptor_Curve for a curve from the Geom2d package. |
26 | |
27 | uses |
28 | |
29 | Array1OfReal from TColStd, |
30 | Shape from GeomAbs, |
31 | CurveType from GeomAbs, |
32 | Vec2d from gp, |
33 | Pnt2d from gp, |
34 | Circ2d from gp, |
35 | Elips2d from gp, |
36 | Hypr2d from gp, |
37 | Parab2d from gp, |
38 | Lin2d from gp, |
39 | BezierCurve from Geom2d, |
40 | BSplineCurve from Geom2d, |
41 | HCurve2d from Adaptor2d |
42 | |
43 | raises |
44 | |
45 | OutOfRange from Standard, |
46 | NoSuchObject from Standard, |
47 | DomainError from Standard |
48 | |
49 | is |
50 | |
51 | -- |
52 | -- Global methods - Apply to the whole curve. |
53 | -- |
54 | |
7fd59977 |
55 | FirstParameter(me) returns Real |
56 | is virtual; |
57 | |
58 | LastParameter(me) returns Real |
59 | is virtual; |
60 | |
61 | Continuity(me) returns Shape from GeomAbs |
62 | is virtual; |
63 | |
64 | NbIntervals(me; S : Shape from GeomAbs) returns Integer |
65 | ---Purpose: If necessary, breaks the curve in intervals of |
66 | -- continuity <S>. And returns the number of |
67 | -- intervals. |
68 | is virtual; |
69 | |
70 | Intervals(me; T : in out Array1OfReal from TColStd; |
71 | S : Shape from GeomAbs) |
72 | ---Purpose: Stores in <T> the parameters bounding the intervals |
73 | -- of continuity <S>. |
74 | -- |
75 | -- The array must provide enough room to accomodate |
76 | -- for the parameters. i.e. T.Length() > NbIntervals() |
77 | raises |
78 | OutOfRange from Standard |
79 | is virtual; |
80 | |
81 | Trim(me; First, Last, Tol : Real) returns HCurve2d from Adaptor2d |
82 | ---Purpose: Returns a curve equivalent of <me> between |
83 | -- parameters <First> and <Last>. <Tol> is used to |
84 | -- test for 3d points confusion. |
85 | raises |
86 | OutOfRange from Standard |
87 | ---Purpose: If <First> >= <Last> |
88 | is virtual; |
89 | |
90 | -- |
91 | -- Local methods - Apply to the current interval. |
92 | -- By default the current interval is the first. |
93 | -- |
94 | |
95 | IsClosed(me) returns Boolean |
96 | is virtual; |
97 | |
98 | IsPeriodic(me) returns Boolean |
99 | is virtual; |
100 | |
101 | Period(me) returns Real |
102 | raises |
103 | DomainError from Standard -- if the curve is not periodic |
104 | is virtual; |
105 | |
106 | Value(me; U : Real) returns Pnt2d from gp |
107 | --- Purpose : Computes the point of parameter U on the curve. |
108 | is virtual; |
109 | |
110 | D0 (me; U : Real; P : out Pnt2d from gp) |
111 | --- Purpose : Computes the point of parameter U on the curve. |
112 | is virtual; |
113 | |
114 | D1 (me; U : Real; P : out Pnt2d from gp ; V : out Vec2d from gp) |
115 | --- Purpose : Computes the point of parameter U on the curve with its |
116 | -- first derivative. |
117 | raises |
118 | DomainError from Standard |
119 | --- Purpose : Raised if the continuity of the current interval |
120 | -- is not C1. |
121 | is virtual; |
122 | |
123 | D2 (me; U : Real; P : out Pnt2d from gp; V1, V2 : out Vec2d from gp) |
124 | --- Purpose : |
125 | -- Returns the point P of parameter U, the first and second |
126 | -- derivatives V1 and V2. |
127 | raises |
128 | DomainError from Standard |
129 | --- Purpose : Raised if the continuity of the current interval |
130 | -- is not C2. |
131 | is virtual; |
132 | |
133 | D3 (me; U : Real; P : out Pnt2d from gp; V1, V2, V3 : out Vec2d from gp) |
134 | --- Purpose : |
135 | -- Returns the point P of parameter U, the first, the second |
136 | -- and the third derivative. |
137 | raises |
138 | DomainError from Standard |
139 | --- Purpose : Raised if the continuity of the current interval |
140 | -- is not C3. |
141 | is virtual; |
142 | |
143 | DN (me; U : Real; N : Integer) returns Vec2d from gp |
144 | --- Purpose : |
145 | -- The returned vector gives the value of the derivative for the |
146 | -- order of derivation N. |
147 | raises |
148 | DomainError from Standard, |
149 | --- Purpose : Raised if the continuity of the current interval |
150 | -- is not CN. |
151 | OutOfRange from Standard |
152 | --- Purpose : Raised if N < 1. |
153 | is virtual; |
154 | |
155 | Resolution(me; R3d : Real) returns Real |
156 | ---Purpose : Returns the parametric resolution corresponding |
157 | -- to the real space resolution <R3d>. |
158 | is virtual; |
159 | |
160 | GetType(me) returns CurveType from GeomAbs |
161 | ---Purpose: Returns the type of the curve in the current |
162 | -- interval : Line, Circle, Ellipse, Hyperbola, |
163 | -- Parabola, BezierCurve, BSplineCurve, OtherCurve. |
164 | is virtual; |
165 | |
166 | -- |
167 | -- The following methods must be called when GetType returned |
168 | -- the corresponding type. |
169 | -- |
170 | |
171 | Line(me) returns Lin2d from gp |
172 | raises |
173 | NoSuchObject from Standard |
174 | is virtual; |
175 | |
176 | Circle(me) returns Circ2d from gp |
177 | raises |
178 | NoSuchObject from Standard |
179 | is virtual; |
180 | |
181 | Ellipse(me) returns Elips2d from gp |
182 | raises |
183 | NoSuchObject from Standard |
184 | is virtual; |
185 | |
186 | Hyperbola(me) returns Hypr2d from gp |
187 | raises |
188 | NoSuchObject from Standard |
189 | is virtual; |
190 | |
191 | Parabola(me) returns Parab2d from gp |
192 | raises |
193 | NoSuchObject from Standard |
194 | is virtual; |
195 | |
196 | |
197 | Degree(me) returns Integer |
198 | raises |
199 | NoSuchObject from Standard |
200 | is virtual; |
201 | |
202 | IsRational(me) returns Boolean |
203 | raises |
204 | NoSuchObject from Standard |
205 | is virtual; |
206 | |
207 | NbPoles(me) returns Integer |
208 | raises |
209 | NoSuchObject from Standard |
210 | is virtual; |
211 | |
212 | |
213 | NbKnots(me) returns Integer |
214 | raises |
215 | NoSuchObject from Standard |
216 | is virtual; |
217 | |
a874a4a0 |
218 | NbSamples(me) returns Integer from Standard is virtual; |
219 | |
7fd59977 |
220 | Bezier(me) returns BezierCurve from Geom2d |
221 | raises |
222 | NoSuchObject from Standard |
223 | is virtual; |
224 | |
225 | BSpline(me) returns BSplineCurve from Geom2d |
226 | raises |
227 | NoSuchObject from Standard |
228 | is virtual; |
6da30ff1 |
229 | |
230 | ---C++: alias " Standard_EXPORT virtual ~Adaptor2d_Curve2d();" |
7fd59977 |
231 | |
232 | end Curve2d; |
233 | |
234 | |