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