b311480e |
1 | -- Created on: 1994-02-23 |
2 | -- Created by: model |
3 | -- Copyright (c) 1994-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 HCurve2d from Adaptor2d inherits TShared from MMgt |
18 | |
19 | ---Purpose: Root class for 2D curves manipulated by handles, on |
20 | -- which geometric 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 specific class is provided: |
25 | -- Geom2dAdaptor_HCurve for a curve from the Geom2d package. |
26 | |
27 | |
28 | |
29 | uses |
30 | |
31 | Array1OfReal from TColStd, |
32 | Shape from GeomAbs, |
33 | CurveType from GeomAbs, |
34 | Vec2d from gp, |
35 | Pnt2d from gp, |
36 | Circ2d from gp, |
37 | Elips2d from gp, |
38 | Hypr2d from gp, |
39 | Parab2d from gp, |
40 | Lin2d from gp, |
41 | BezierCurve from Geom2d, |
42 | BSplineCurve from Geom2d, |
43 | Curve2d from Adaptor2d |
44 | |
45 | raises |
46 | |
47 | OutOfRange from Standard, |
48 | NoSuchObject from Standard, |
49 | DomainError from Standard, |
50 | NotImplemented from Standard |
51 | |
52 | is |
53 | |
54 | -- |
55 | -- Access to the curve |
56 | -- |
57 | |
58 | Curve2d(me) returns Curve2d from Adaptor2d |
59 | ---Purpose: Returns a reference to the Curve2d inside the HCurve2d. |
60 | -- |
61 | ---C++: return const & |
62 | is deferred; |
63 | |
64 | |
65 | -- Curve methods, they are provided for convenience. Each |
66 | -- method M() is defined inline as : |
67 | -- |
68 | -- Adaptor_HCurve::M() { Curve().M(); } |
69 | -- |
70 | -- See the class Curve for comments on the methods. |
71 | -- |
72 | -- |
73 | -- Global methods - Apply to the whole curve. |
74 | -- |
75 | |
76 | FirstParameter(me) returns Real ; |
77 | ---C++: inline |
78 | LastParameter(me) returns Real ; |
79 | ---C++: inline |
80 | |
81 | Continuity(me) returns Shape from GeomAbs ; |
82 | ---C++: inline |
83 | -- |
84 | |
85 | NbIntervals(me ; S : Shape from GeomAbs) returns Integer ; |
86 | ---C++: inline |
87 | -- |
88 | |
89 | Intervals(me; T : in out Array1OfReal from TColStd; |
90 | S : Shape from GeomAbs) |
91 | ---C++: inline |
92 | raises |
93 | OutOfRange from Standard |
94 | is static; |
95 | |
96 | Trim(me; First, Last, Tol : Real) returns HCurve2d from Adaptor2d |
97 | ---C++: inline |
98 | raises |
99 | OutOfRange from Standard |
100 | ---Purpose: If <First> >= <Last> |
101 | is static; |
102 | |
103 | -- |
104 | -- Local methods - Apply to the current interval. |
105 | -- By default the current interval is the first. |
106 | -- |
107 | |
108 | IsClosed(me) returns Boolean ; |
109 | ---C++: inline |
110 | -- |
111 | |
112 | IsPeriodic(me) returns Boolean ; |
113 | ---C++: inline |
114 | -- |
115 | |
116 | Period(me) returns Real ; |
117 | ---C++: inline |
118 | -- |
119 | |
120 | Value(me; U : Real) returns Pnt2d from gp ; |
121 | ---C++: inline |
122 | -- |
123 | |
124 | D0 (me; U : Real; P : out Pnt2d from gp) ; |
125 | ---C++: inline |
126 | -- |
127 | |
128 | D1 (me; U : Real; P : out Pnt2d from gp ; V : out Vec2d from gp) ; |
129 | ---C++: inline |
130 | -- |
131 | |
132 | D2 (me; U : Real; P : out Pnt2d from gp; |
133 | V1, V2 : out Vec2d from gp) ; |
134 | ---C++: inline |
135 | -- |
136 | |
137 | D3 (me; U : Real; P : out Pnt2d from gp; |
138 | V1, V2, V3 : out Vec2d from gp) ; |
139 | ---C++: inline |
140 | -- |
141 | |
142 | DN (me; U : Real; N : Integer) returns Vec2d from gp ; |
143 | ---C++: inline |
144 | -- |
145 | |
146 | Resolution(me; R3d : Real) returns Real ; |
147 | ---C++: inline |
148 | -- |
149 | |
150 | GetType(me) returns CurveType from GeomAbs ; |
151 | ---C++: inline |
152 | -- |
153 | |
154 | -- |
155 | -- The following methods must be called when GetType returned |
156 | -- the corresponding type. |
157 | -- |
158 | |
159 | Line(me) returns Lin2d from gp ; |
160 | ---C++: inline |
161 | -- |
162 | |
163 | Circle(me) returns Circ2d from gp ; |
164 | ---C++: inline |
165 | -- |
166 | |
167 | Ellipse(me) returns Elips2d from gp ; |
168 | ---C++: inline |
169 | -- |
170 | |
171 | Hyperbola(me) returns Hypr2d from gp ; |
172 | ---C++: inline |
173 | -- |
174 | |
175 | Parabola(me) returns Parab2d from gp ; |
176 | ---C++: inline |
177 | -- |
178 | |
179 | Degree(me) returns Integer |
180 | ---C++: inline |
181 | raises |
182 | NoSuchObject from Standard ; |
183 | |
184 | IsRational(me) returns Boolean |
185 | ---C++: inline |
186 | raises |
187 | NoSuchObject from Standard ; |
188 | |
189 | |
190 | NbPoles(me) returns Integer |
191 | ---C++: inline |
192 | raises |
193 | NoSuchObject from Standard ; |
194 | |
195 | |
196 | NbKnots(me) returns Integer |
197 | ---C++: inline |
198 | raises |
199 | NoSuchObject from Standard ; |
200 | |
201 | |
202 | Bezier(me) returns BezierCurve from Geom2d |
203 | ---C++: inline |
204 | raises |
205 | NoSuchObject from Standard; |
206 | |
207 | BSpline(me) returns BSplineCurve from Geom2d |
208 | ---C++: inline |
209 | raises |
210 | NoSuchObject from Standard, |
211 | OutOfRange from Standard -- if TK has not length NbKnots |
212 | is virtual; |
213 | |
214 | |
215 | end HCurve2d; |