b311480e |
1 | -- Created on: 1992-08-06 |
2 | -- Created by: Laurent BUCHARD |
3 | -- Copyright (c) 1992-1999 Matra Datavision |
4 | -- Copyright (c) 1999-2012 OPEN CASCADE SAS |
5 | -- |
6 | -- The content of this file is subject to the Open CASCADE Technology Public |
7 | -- License Version 6.5 (the "License"). You may not use the content of this file |
8 | -- except in compliance with the License. Please obtain a copy of the License |
9 | -- at http://www.opencascade.org and read it completely before using this file. |
10 | -- |
11 | -- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its |
12 | -- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France. |
13 | -- |
14 | -- The Original Code and all software distributed under the License is |
15 | -- distributed on an "AS IS" basis, without warranty of any kind, and the |
16 | -- Initial Developer hereby disclaims all such warranties, including without |
17 | -- limitation, any warranties of merchantability, fitness for a particular |
18 | -- purpose or non-infringement. Please see the License for the specific terms |
19 | -- and conditions governing the rights and limitations under the License. |
20 | |
7fd59977 |
21 | |
22 | |
23 | class IntConicQuad from IntAna |
24 | |
25 | ---Purpose: This class provides the analytic intersection between |
26 | -- a conic defined as an element of gp (Lin,Circ,Elips, |
27 | -- Parab,Hypr) and a quadric as defined in the class |
28 | -- Quadric from IntAna. |
29 | -- The intersection between a conic and a plane is treated |
30 | -- as a special case. |
31 | -- |
32 | -- The result of the intersection are points (Pnt from |
33 | -- gp), associated with the parameter on the conic. |
34 | -- |
35 | -- A call to an Intersection L:Lin from gp and |
36 | -- SPH: Sphere from gp can be written either : |
37 | -- IntAna_IntConicQuad Inter(L,IntAna_Quadric(SPH)) |
38 | -- or : |
39 | -- IntAna_IntConicQuad Inter(L,SPH) (it is necessary |
40 | -- to include IntAna_Quadric.hxx in this case) |
41 | |
42 | |
43 | |
44 | uses Pnt from gp, |
45 | Lin from gp, |
46 | Circ from gp, |
47 | Elips from gp, |
48 | Parab from gp, |
49 | Hypr from gp, |
50 | Pln from gp, |
51 | Quadric from IntAna |
52 | |
53 | |
54 | |
55 | raises NotDone from StdFail, |
56 | OutOfRange from Standard, |
57 | DomainError from Standard |
58 | |
59 | is |
60 | |
61 | |
62 | Create |
63 | |
64 | ---Purpose: Empty constructor. |
65 | -- |
66 | |
67 | returns IntConicQuad from IntAna; |
68 | |
69 | |
70 | |
71 | Create(L: Lin from gp; Q: Quadric from IntAna) |
72 | |
73 | ---Purpose: Creates the intersection between a line and a quadric. |
74 | |
75 | returns IntConicQuad from IntAna; |
76 | |
77 | |
78 | Perform(me:in out; L: Lin from gp; Q: Quadric from IntAna) |
79 | |
80 | ---Purpose: Intersects a line and a quadric. |
81 | |
82 | is static; |
83 | |
84 | |
85 | Create(C: Circ from gp; Q: Quadric from IntAna) |
86 | |
87 | ---Purpose: Creates the intersection between a circle and a quadric. |
88 | |
89 | returns IntConicQuad from IntAna; |
90 | |
91 | |
92 | Perform(me: in out; C: Circ from gp; Q: Quadric from IntAna) |
93 | |
94 | ---Purpose: Intersects a circle and a quadric. |
95 | |
96 | is static; |
97 | |
98 | |
99 | Create(E: Elips from gp; Q: Quadric from IntAna) |
100 | |
101 | ---Purpose: Creates the intersection between an ellipse and a quadric. |
102 | |
103 | returns IntConicQuad from IntAna; |
104 | |
105 | |
106 | Perform(me:in out; E: Elips from gp; Q: Quadric from IntAna) |
107 | |
108 | ---Purpose: Intersects an ellipse and a quadric. |
109 | |
110 | is static; |
111 | |
112 | |
113 | Create(P: Parab from gp; Q: Quadric from IntAna) |
114 | |
115 | ---Purpose: Creates the intersection between a parabola and a quadric. |
116 | |
117 | returns IntConicQuad from IntAna; |
118 | |
119 | |
120 | Perform(me:in out; P: Parab from gp; Q: Quadric from IntAna) |
121 | |
122 | ---Purpose: Intersects a parabola and a quadric. |
123 | |
124 | is static; |
125 | |
126 | |
127 | Create(H: Hypr from gp; Q: Quadric from IntAna) |
128 | |
129 | ---Purpose: Creates the intersection between an hyperbola and |
130 | -- a quadric. |
131 | |
132 | returns IntConicQuad from IntAna; |
133 | |
134 | |
135 | Perform(me:in out; H: Hypr from gp; Q: Quadric from IntAna) |
136 | |
137 | ---Purpose: Intersects an hyperbola and a quadric. |
138 | |
139 | is static; |
140 | |
141 | ---------------------------------------------------------------------- |
142 | -- Intersection between a Conic from gp and a Pln from IntAna |
143 | -- The intersection is computed with Tolerances. |
144 | ---------------------------------------------------------------------- |
145 | |
146 | Create(L : Lin from gp; P: Pln from gp; |
147 | Tolang: Real from Standard) |
148 | |
149 | ---Purpose: Intersection between a line and a plane. |
150 | -- Tolang is used to determine if the angle between two |
151 | -- vectors is null. |
152 | |
153 | returns IntConicQuad from IntAna; |
154 | |
155 | |
156 | Perform(me: in out; |
157 | L : Lin from gp; P: Pln from gp; Tolang: Real from Standard) |
158 | |
159 | ---Purpose: Intersects a line and a plane. |
160 | -- Tolang is used to determine if the angle between two |
161 | -- vectors is null. |
162 | |
163 | is static; |
164 | |
165 | |
166 | Create(C : Circ from gp; P: Pln from gp; |
167 | Tolang,Tol: Real from Standard) |
168 | |
169 | ---Purpose: Intersection between a circle and a plane. |
170 | -- Tolang is used to determine if the angle between two |
171 | -- vectors is null. |
172 | -- Tol is used to determine if a distance is null. |
173 | |
174 | returns IntConicQuad from IntAna; |
175 | |
176 | |
177 | Perform(me: in out; |
178 | C : Circ from gp; P: Pln from gp; Tolang,Tol: Real from Standard) |
179 | |
180 | ---Purpose: Intersects a circle and a plane. |
181 | -- Tolang is used to determine if the angle between two |
182 | -- vectors is null. |
183 | -- Tol is used to determine if a distance is null. |
184 | |
185 | is static; |
186 | |
187 | |
188 | Create(E : Elips from gp; P: Pln from gp; |
189 | Tolang,Tol: Real from Standard) |
190 | |
191 | ---Purpose: Intersection between an ellipse and a plane. |
192 | -- Tolang is used to determine if the angle between two |
193 | -- vectors is null. |
194 | -- Tol is used to determine if a distance is null. |
195 | |
196 | returns IntConicQuad from IntAna; |
197 | |
198 | |
199 | Perform(me: in out; |
200 | E : Elips from gp; P: Pln from gp; Tolang,Tol: Real from Standard) |
201 | |
202 | ---Purpose: Intersects an ellipse and a plane. |
203 | -- Tolang is used to determine if the angle between two |
204 | -- vectors is null. |
205 | -- Tol is used to determine if a distance is null. |
206 | |
207 | is static; |
208 | |
209 | |
210 | Create(Pb: Parab from gp; P: Pln from gp; |
211 | Tolang: Real from Standard) |
212 | |
213 | ---Purpose: Intersection between a parabola and a plane. |
214 | -- Tolang is used to determine if the angle between two |
215 | -- vectors is null. |
216 | |
217 | returns IntConicQuad from IntAna; |
218 | |
219 | |
220 | Perform(me: in out; |
221 | Pb: Parab from gp; P: Pln from gp; Tolang: Real from Standard) |
222 | |
223 | ---Purpose: Intersects a parabola and a plane. |
224 | -- Tolang is used to determine if the angle between two |
225 | -- vectors is null. |
226 | |
227 | is static; |
228 | |
229 | |
230 | Create(H : Hypr from gp; P: Pln from gp; |
231 | Tolang: Real from Standard) |
232 | |
233 | ---Purpose: Intersection between an hyperbola and a plane. |
234 | -- Tolang is used to determine if the angle between two |
235 | -- vectors is null. |
236 | |
237 | returns IntConicQuad from IntAna; |
238 | |
239 | |
240 | Perform(me: in out; |
241 | H : Hypr from gp; P: Pln from gp; Tolang: Real from Standard) |
242 | |
243 | ---Purpose: Intersects an hyperbola and a plane. |
244 | -- Tolang is used to determine if the angle between two |
245 | -- vectors is null. |
246 | |
247 | is static; |
248 | |
249 | |
250 | IsDone(me) |
251 | |
252 | ---Purpose: Returns TRUE if the creation completed. |
253 | -- |
254 | ---C++: inline |
255 | |
256 | returns Boolean from Standard |
257 | is static; |
258 | |
259 | |
260 | IsInQuadric(me) |
261 | |
262 | ---Purpose: Returns TRUE if the conic is in the quadric. |
263 | -- |
264 | ---C++: inline |
265 | |
266 | returns Boolean from Standard |
267 | |
268 | raises NotDone from StdFail |
269 | -- The exception NotDone is raised if IsDone returns False. |
270 | |
271 | is static; |
272 | |
273 | |
274 | IsParallel(me) |
275 | |
276 | ---Purpose: Returns TRUE if the line is in a quadric which |
277 | -- is parallel to the quadric. |
278 | ---C++: inline |
279 | |
280 | returns Boolean from Standard |
281 | |
282 | raises NotDone from StdFail |
283 | -- The exception NotDone is raised if IsDone returns False. |
284 | |
285 | is static; |
286 | |
287 | |
288 | NbPoints(me) |
289 | |
290 | ---Purpose: Returns the number of intersection point. |
291 | -- |
292 | ---C++: inline |
293 | |
294 | returns Integer from Standard |
295 | |
296 | raises NotDone from StdFail, |
297 | DomainError from Standard |
298 | -- The exception NotDone is raised if IsDone returns False. |
299 | -- The exception DomainError is raised if IsInQuadric returns |
300 | -- True or IsParallel returns True. |
301 | |
302 | |
303 | is static; |
304 | |
305 | |
306 | Point(me; N: Integer from Standard) |
307 | |
308 | ---Purpose: Returns the point of range N. |
309 | -- |
310 | ---C++: inline |
311 | ---C++: return const& |
312 | |
313 | returns Pnt from gp |
314 | |
315 | raises NotDone from StdFail, |
316 | DomainError from Standard, |
317 | OutOfRange from Standard |
318 | -- The exception NotDone is raised if IsDone returns False. |
319 | -- The exception DomainError is raised if IsInQuadric returns |
320 | -- True or IsParallel returns true. |
321 | -- The exception OutOfRange is raised if N<=0 or N>NbPoints. |
322 | |
323 | is static; |
324 | |
325 | |
326 | ParamOnConic(me; N: Integer from Standard) |
327 | |
328 | ---Purpose: Returns the parameter on the line of the intersection |
329 | -- point of range N. |
330 | -- |
331 | ---C++: inline |
332 | |
333 | returns Real from Standard |
334 | |
335 | raises NotDone from StdFail, |
336 | DomainError from Standard, |
337 | OutOfRange from Standard |
338 | -- The exception NotDone is raised if IsDone returns False. |
339 | -- The exception DomainError is raised if IsInQuadric returns |
340 | -- True or IsParallel returns true. |
341 | -- The exception OutOfRange is raised if N<=0 or N>NbPoints. |
342 | |
343 | is static; |
344 | |
345 | |
346 | |
347 | fields |
348 | |
349 | done : Boolean from Standard; |
350 | parallel : Boolean from Standard; |
351 | inquadric : Boolean from Standard; |
352 | |
353 | nbpts : Integer from Standard; |
354 | |
355 | pnts : Pnt from gp [4]; |
356 | paramonc : Real from Standard [4]; |
357 | |
358 | end IntConicQuad; |
359 | |
360 | |