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