b311480e |
1 | -- Created on: 1991-02-20 |
2 | -- Created by: Jacques GOUSSARD |
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 | |
17 | class AnaIntersection from IntAna2d |
18 | |
19 | ---Purpose: Implementation of the analytical intersection between: |
20 | -- - two Lin2d, |
21 | -- - two Circ2d, |
22 | -- - a Lin2d and a Circ2d, |
23 | -- - an element of gp (Lin2d, Circ2d, Elips2d, Parab2d, Hypr2d) |
24 | -- and another conic. |
25 | -- No tolerance is given for all the intersections: the tolerance |
26 | -- will be the "precision machine". |
27 | |
28 | |
29 | uses Vec2d from gp, |
30 | Lin2d from gp, |
31 | Circ2d from gp, |
32 | Elips2d from gp, |
33 | Parab2d from gp, |
34 | Hypr2d from gp, |
35 | Conic from IntAna2d, |
36 | IntPoint from IntAna2d |
37 | |
38 | raises NotDone from StdFail, |
39 | OutOfRange from Standard |
40 | |
41 | is |
42 | |
43 | Create |
44 | |
45 | ---Purpose: Empty constructor. IsDone returns False. |
46 | |
47 | returns AnaIntersection; |
48 | |
49 | |
50 | Create( L1,L2: Lin2d from gp) |
51 | |
52 | ---Purpose: Intersection between two lines. |
53 | |
54 | returns AnaIntersection |
55 | |
56 | raises NotDone from StdFail; |
57 | |
58 | |
59 | Create( C1,C2: Circ2d from gp) |
60 | |
61 | ---Purpose: Intersection between two circles. |
62 | |
63 | returns AnaIntersection |
64 | |
65 | raises NotDone from StdFail; |
66 | |
67 | |
68 | Create( L: Lin2d from gp; C: Circ2d from gp) |
69 | |
70 | ---Purpose: Intersection between a line and a circle. |
71 | |
72 | returns AnaIntersection |
73 | |
74 | raises NotDone from StdFail; |
75 | |
76 | |
77 | Create(L: Lin2d from gp; C: Conic from IntAna2d) |
78 | |
79 | ---Purpose: Intersection between a line and a conic. |
80 | |
81 | returns AnaIntersection |
82 | |
83 | raises NotDone from StdFail; |
84 | |
85 | |
86 | Create(C: Circ2d from gp; Co: Conic from IntAna2d) |
87 | |
88 | ---Purpose: Intersection between a circle and another conic. |
89 | |
90 | returns AnaIntersection |
91 | |
92 | raises NotDone from StdFail; |
93 | |
94 | |
95 | Create(E: Elips2d from gp; C: Conic from IntAna2d) |
96 | |
97 | ---Purpose: Intersection between an ellipse and another conic. |
98 | |
99 | returns AnaIntersection |
100 | |
101 | raises NotDone from StdFail; |
102 | |
103 | |
104 | Create(P: Parab2d from gp; C: Conic from IntAna2d) |
105 | |
106 | ---Purpose: Intersection between a parabola and another conic. |
107 | |
108 | returns AnaIntersection |
109 | |
110 | raises NotDone from StdFail; |
111 | |
112 | |
113 | Create(H: Hypr2d from gp; C: Conic from IntAna2d) |
114 | |
115 | ---Purpose: Intersection between an hyperbola and another conic. |
116 | |
117 | returns AnaIntersection |
118 | |
119 | raises NotDone from StdFail; |
120 | |
121 | |
122 | Perform(me: in out; L1,L2: Lin2d from gp) |
123 | |
124 | ---Purpose: Intersection between two lines. |
125 | |
126 | raises NotDone from StdFail |
127 | |
128 | is static; |
129 | |
130 | |
131 | Perform(me: in out; C1,C2: Circ2d from gp) |
132 | |
133 | ---Purpose: Intersection between two circles. |
134 | |
135 | raises NotDone from StdFail |
136 | |
137 | is static; |
138 | |
139 | |
140 | Perform(me: in out; L: Lin2d from gp; C: Circ2d from gp) |
141 | |
142 | ---Purpose: Intersection between a line and a circle. |
143 | |
144 | raises NotDone from StdFail |
145 | |
146 | is static; |
147 | |
148 | |
149 | Perform(me: in out; L: Lin2d from gp; C: Conic from IntAna2d) |
150 | |
151 | ---Purpose: Intersection between a line and a conic. |
152 | |
153 | raises NotDone from StdFail |
154 | |
155 | is static; |
156 | |
157 | |
158 | Perform(me: in out; C: Circ2d from gp; Co: Conic from IntAna2d) |
159 | |
160 | ---Purpose: Intersection between a circle and another conic. |
161 | |
162 | raises NotDone from StdFail |
163 | |
164 | is static; |
165 | |
166 | |
167 | Perform(me: in out; E: Elips2d from gp; C: Conic from IntAna2d) |
168 | |
169 | ---Purpose: Intersection between an ellipse and another conic. |
170 | |
171 | raises NotDone from StdFail |
172 | |
173 | is static; |
174 | |
175 | |
176 | Perform(me: in out; P: Parab2d from gp; C: Conic from IntAna2d) |
177 | |
178 | ---Purpose: Intersection between a parabola and another conic. |
179 | |
180 | raises NotDone from StdFail |
181 | |
182 | is static; |
183 | |
184 | |
185 | Perform(me: in out; H: Hypr2d from gp; C: Conic from IntAna2d) |
186 | |
187 | ---Purpose: Intersection between an hyperbola and another conic. |
188 | |
189 | raises NotDone from StdFail |
190 | |
191 | is static; |
192 | |
193 | |
194 | IsDone(me) |
195 | |
196 | ---Purpose: Returns TRUE if the computation was succesfull. |
197 | |
198 | returns Boolean |
199 | ---C++: inline |
200 | is static; |
201 | |
202 | |
203 | IsEmpty(me) |
204 | |
205 | ---Purpose: Returns TRUE when there is no intersection, i-e |
206 | -- - no intersection point |
207 | -- - the elements are not identical. |
208 | -- The element may be parallel in this case. |
209 | |
210 | returns Boolean |
211 | |
212 | raises NotDone from StdFail |
213 | ---C++:inline |
214 | is static; |
215 | |
216 | |
217 | IdenticalElements(me) |
218 | |
219 | ---Purpose: For the intersection between an element of gp and a conic |
220 | -- known by an implicit equation, the result will be TRUE |
221 | -- if the element of gp verifies the implicit equation. |
222 | -- For the intersection between two Lin2d or two Circ2d, the |
223 | -- result will be TRUE if the elements are identical. |
224 | -- The function returns FALSE in all the other cases. |
225 | |
226 | returns Boolean |
227 | |
228 | raises NotDone from StdFail |
229 | ---C++:inline |
230 | is static; |
231 | |
232 | |
233 | ParallelElements(me) |
234 | |
235 | ---Purpose: For the intersection between two Lin2d or two Circ2d, |
236 | -- the function returns TRUE if the elements are parallel. |
237 | -- The function returns FALSE in all the other cases. |
238 | |
239 | returns Boolean |
240 | |
241 | raises NotDone from StdFail |
242 | ---C++:inline |
243 | is static; |
244 | |
245 | |
246 | NbPoints(me) |
247 | |
248 | ---Purpose: returns the number of IntPoint between the 2 curves. |
249 | |
250 | returns Integer |
251 | |
252 | raises NotDone from StdFail |
253 | ---C++:inline |
254 | is static; |
255 | |
256 | |
257 | Point(me; N: Integer) |
258 | |
259 | ---Purpose: returns the intersection point of range N; |
260 | -- If (N<=0) or (N>NbPoints), an exception is raised. |
261 | |
262 | returns IntPoint from IntAna2d |
263 | |
264 | raises NotDone from StdFail, |
265 | OutOfRange from Standard |
266 | ---C++:return const & |
267 | ---C++:inline |
268 | is static; |
269 | |
270 | |
271 | fields |
272 | |
273 | done : Boolean from Standard; |
274 | para : Boolean from Standard; |
275 | iden : Boolean from Standard; |
276 | empt : Boolean from Standard; |
277 | nbp : Integer from Standard; |
278 | lpnt : IntPoint from IntAna2d [4]; |
279 | |
280 | end AnaIntersection; |