b311480e |
1 | -- Created on: 1993-10-25 |
2 | -- Created by: Jean Marc LACHAUME |
3 | -- Copyright (c) 1993-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 | generic class Hatcher from HatchGen |
23 | (TheCurveE as any ; -- as Curve from Geom2dAdaptor |
24 | TheCurveH as any ; -- as Curve from Geom2dAdaptor |
25 | TheIntersector as any ) -- as Intersector from HatchGen |
26 | |
27 | uses |
28 | MapIntegerHasher from TColStd , |
29 | PointOnHatching from HatchGen , |
30 | Orientation from TopAbs , |
31 | State from TopAbs , |
32 | Domain from HatchGen , |
33 | ErrorStatus from HatchGen |
34 | |
35 | raises |
36 | NoSuchObject from Standard , |
37 | OutOfRange from Standard , |
38 | NotDone from StdFail |
39 | |
40 | ---------------------------------------------------------------------- |
41 | -- Nested classes descriptions. |
42 | ---------------------------------------------------------------------- |
43 | |
44 | class Element from HatchGen instantiates ElementGen from HatchGen |
45 | (TheCurveE) ; |
46 | |
47 | class Elements from HatchGen instantiates ElementsGen from HatchGen |
48 | (Integer from Standard, |
49 | Element from HatchGen, |
50 | MapIntegerHasher from TColStd , |
51 | TheCurveE ) ; |
52 | |
53 | class Hatching from HatchGen instantiates HatchingGen from HatchGen |
54 | (TheCurveH) ; |
55 | |
56 | class Hatchings from HatchGen instantiates DataMap from TCollection |
57 | (Integer from Standard, |
58 | Hatching from HatchGen, |
59 | MapIntegerHasher from TColStd) ; |
60 | |
61 | class Classifier from HatchGen instantiates FaceClassifier from TopClass |
62 | (Elements, |
63 | TheCurveE, |
64 | TheIntersector); |
65 | |
66 | ---------------------------------------------------------------------- |
67 | -- class Hatcher description. |
68 | ---------------------------------------------------------------------- |
69 | |
70 | is |
71 | |
72 | ---Category: General use |
73 | |
74 | |
75 | Create (Intersector : TheIntersector ; |
76 | Confusion2d : Real from Standard ; |
77 | Confusion3d : Real from Standard ; |
78 | KeepPnt : Boolean from Standard = Standard_False ; |
79 | KeepSeg : Boolean from Standard = Standard_False) |
80 | |
81 | ---Purpose: Returns an empty hatcher. |
82 | |
83 | returns Hatcher from HatchGen ; |
84 | |
85 | |
86 | Intersector (me : in out ; Intersector : TheIntersector) |
87 | |
88 | ---Purpose: Sets the associated intersector. |
89 | is static ; |
90 | |
91 | |
92 | Intersector (me : in out) |
93 | |
94 | ---Purpose: Returns the associated intersector. |
95 | |
96 | ---C++: inline |
97 | ---C++: return const & |
98 | |
99 | returns TheIntersector |
100 | is static ; |
101 | |
102 | |
103 | ChangeIntersector (me : in out) |
104 | |
105 | ---Purpose: Returns the associated intersector. |
106 | |
107 | ---C++: inline |
108 | ---C++: return & |
109 | |
110 | returns TheIntersector |
111 | is static ; |
112 | |
113 | |
114 | Confusion2d (me : in out ; Confusion : Real from Standard) |
115 | |
116 | ---Purpose: Sets the confusion tolerance. |
117 | |
118 | is static ; |
119 | |
120 | |
121 | Confusion2d (me) |
122 | |
123 | ---Purpose: Returns the 2d confusion tolerance, i.e. the value under |
124 | -- which two points are considered identical in the |
125 | -- parametric space of the hatching. |
126 | |
127 | ---C++: inline |
128 | returns Real from Standard |
129 | is static ; |
130 | |
131 | |
132 | Confusion3d (me : in out ; Confusion : Real from Standard) |
133 | |
134 | ---Purpose: Sets the confusion tolerance. |
135 | |
136 | is static ; |
137 | |
138 | |
139 | Confusion3d (me) |
140 | |
141 | ---Purpose: Returns the 3d confusion tolerance, i.e. the value under |
142 | -- which two points are considered identical in the |
143 | -- 3d space of the hatching. |
144 | |
145 | ---C++: inline |
146 | returns Real from Standard |
147 | is static ; |
148 | |
149 | |
150 | KeepPoints (me : in out; Keep : Boolean from Standard) |
151 | |
152 | ---Purpose: Sets the above flag. |
153 | |
154 | is static ; |
155 | |
156 | |
157 | KeepPoints (me) |
158 | |
159 | ---Purpose: Returns the flag about the points consideration. |
160 | |
161 | ---C++: inline |
162 | returns Boolean from Standard |
163 | is static ; |
164 | |
165 | |
166 | KeepSegments (me : in out; Keep : Boolean from Standard) |
167 | |
168 | ---Purpose: Sets the above flag. |
169 | |
170 | is static ; |
171 | |
172 | |
173 | KeepSegments (me) |
174 | |
175 | ---Purpose: Returns the flag about the segments consideration. |
176 | |
177 | ---C++: inline |
178 | returns Boolean from Standard |
179 | is static ; |
180 | |
181 | |
182 | Clear (me : in out) |
183 | |
184 | ---Purpose: Removes all the hatchings and all the elements. |
185 | |
186 | ---C++: inline |
187 | is static ; |
188 | |
189 | |
190 | ---Category: Element |
191 | |
192 | |
193 | Element (me : in out ; IndE : Integer from Standard) |
194 | |
195 | ---Purpose: Returns the IndE-th element. |
196 | |
197 | ---Category: Element |
198 | |
199 | ---C++: inline |
200 | ---C++: return & |
201 | |
202 | returns Element from HatchGen |
203 | raises NoSuchObject from Standard |
204 | is static protected ; |
205 | |
206 | |
207 | ElementCurve (me; IndE : Integer from Standard) |
208 | |
209 | ---Purpose: Returns the curve associated to the IndE-th element. |
210 | |
211 | ---Category: Element |
212 | |
213 | ---C++: inline |
214 | ---C++: return const & |
215 | |
216 | returns TheCurveE |
217 | raises NoSuchObject from Standard |
218 | is static ; |
219 | |
220 | |
221 | AddElement (me : in out ; Curve : TheCurveE ; |
222 | Orientation : Orientation from TopAbs = TopAbs_FORWARD) |
223 | |
224 | ---Purpose: Adds an element to the hatcher and returns its index. |
225 | |
226 | ---Category: Element |
227 | |
228 | returns Integer from Standard |
229 | is static ; |
230 | |
231 | |
232 | RemElement (me : in out ; IndE : Integer from Standard) |
233 | |
234 | ---Purpose: Removes the IndE-th element from the hatcher. |
235 | |
236 | ---Category: Element |
237 | |
238 | raises NoSuchObject from Standard |
239 | is static ; |
240 | |
241 | |
242 | ClrElements (me : in out) |
243 | |
244 | ---Purpose: Removes all the elements from the hatcher. |
245 | |
246 | ---Category: Element |
247 | |
248 | is static ; |
249 | |
250 | |
251 | ---Category: Hatching |
252 | |
253 | |
254 | Hatching (me : in out ; IndH : Integer from Standard) |
255 | |
256 | ---Purpose: Returns the IndH-th hatching. |
257 | |
258 | ---Category: Hatching |
259 | |
260 | ---C++: inline |
261 | ---C++: return & |
262 | |
263 | returns Hatching from HatchGen |
264 | raises NoSuchObject from Standard |
265 | is static protected ; |
266 | |
267 | |
268 | HatchingCurve (me; IndH : Integer from Standard) |
269 | |
270 | ---Purpose: Returns the curve associated to the IndH-th hatching. |
271 | |
272 | ---Category: Hatching |
273 | |
274 | ---C++: inline |
275 | ---C++: return const & |
276 | |
277 | returns TheCurveH |
278 | raises NoSuchObject from Standard |
279 | is static ; |
280 | |
281 | |
282 | AddHatching (me : in out ; Curve : TheCurveH) |
283 | |
284 | ---Purpose: Adds a hatching to the hatcher and returns its index. |
285 | |
286 | ---Category: Hatching |
287 | |
288 | returns Integer from Standard |
289 | is static ; |
290 | |
291 | |
292 | RemHatching (me : in out ; IndH : Integer from Standard) |
293 | |
294 | ---Purpose: Removes the IndH-th hatching from the hatcher. |
295 | |
296 | ---Category: Hatching |
297 | |
298 | raises NoSuchObject from Standard |
299 | is static ; |
300 | |
301 | |
302 | ClrHatchings (me : in out) |
303 | |
304 | ---Purpose: Removes all the hatchings from the hatcher. |
305 | |
306 | ---Category: Hatching |
307 | |
308 | is static ; |
309 | |
310 | |
311 | NbPoints (me; IndH : Integer from Standard) |
312 | |
313 | ---Purpose: Returns the number of intersection points of |
314 | -- the IndH-th hatching. |
315 | |
316 | ---Category: Hatching - Test |
317 | |
318 | ---C++: inline |
319 | returns Integer from Standard |
320 | raises NoSuchObject from Standard |
321 | is static ; |
322 | |
323 | |
324 | Point (me; IndH, IndP : Integer from Standard) |
325 | |
326 | ---Purpose: Returns the IndP-th intersection point of the |
327 | -- IndH-th hatching. |
328 | |
329 | ---Category: Hatching - Test |
330 | |
331 | ---C++: inline |
332 | ---C++: return const & |
333 | |
334 | returns PointOnHatching from HatchGen |
335 | raises NoSuchObject from Standard, |
336 | OutOfRange from Standard |
337 | is static ; |
338 | |
339 | |
340 | ---Category: Computation - Trimming |
341 | |
342 | Trim (me : in out) |
343 | |
344 | ---Purpose: Trims all the hatchings of the hatcher by all the |
345 | -- elements of the hatcher. |
346 | |
347 | is static ; |
348 | |
349 | |
350 | Trim (me : in out ; Curve : TheCurveH) |
351 | |
352 | ---Purpose: Adds a hatching to the hatcher and trims it by |
353 | -- the elements already given and returns its index. |
354 | |
355 | ---Category: Computation |
356 | |
357 | returns Integer from Standard |
358 | is static ; |
359 | |
360 | |
361 | Trim (me : in out ; IndH : Integer from Standard) |
362 | |
363 | ---Purpose: Trims the IndH-th hatching by the elements |
364 | -- already given. |
365 | |
366 | ---Category: Computation |
367 | |
368 | raises NoSuchObject from Standard |
369 | is static ; |
370 | |
371 | |
372 | Trim (me : in out ; IndH, IndE : Integer from Standard) |
373 | |
374 | ---Purpose: Trims the IndH-th hatching of the hatcher by the |
375 | -- IndE-th element. |
376 | |
377 | ---Category: Computation |
378 | |
379 | returns Boolean from Standard |
380 | is static private ; |
381 | |
382 | |
383 | ---Category: Computation - Domains |
384 | |
385 | GlobalTransition (me : in out; Point : in out PointOnHatching from HatchGen) |
386 | |
387 | ---Purpose: Sets the global transition (the before and after |
388 | -- states and segment extremities flags) of the point. |
389 | |
390 | ---Category: Computation - Domains |
391 | |
392 | returns Boolean from Standard |
393 | is static private ; |
394 | |
395 | |
396 | ComputeDomains (me : in out) |
397 | |
398 | ---Purpose: Computes the domains of all the hatchings. |
399 | |
400 | ---Category: Computation - Domains |
401 | |
402 | is static ; |
403 | |
404 | |
405 | ComputeDomains (me : in out ; IndH : Integer from Standard) |
406 | |
407 | ---Purpose: Computes the domains of the IndH-th hatching. |
408 | |
409 | ---Category: Computation - Domains |
410 | |
411 | raises NoSuchObject from Standard |
412 | is static ; |
413 | |
414 | |
415 | ---Category: Results |
416 | |
417 | TrimDone (me; IndH : Integer from Standard) |
418 | |
419 | ---Purpose: Returns the fact that the intersections were computed |
420 | -- for the IndH-th hatching. |
421 | |
422 | ---C++: inline |
423 | returns Boolean from Standard |
424 | raises NoSuchObject from Standard |
425 | is static ; |
426 | |
427 | |
428 | TrimFailed (me; IndH : Integer from Standard) |
429 | |
430 | ---Purpose: Returns the fact that the intersections failed |
431 | -- for the IndH-th hatching. |
432 | |
433 | ---C++: inline |
434 | returns Boolean from Standard |
435 | raises NoSuchObject from Standard |
436 | is static ; |
437 | |
438 | |
439 | IsDone (me) |
440 | |
441 | ---Purpose: Returns the fact that the domains were computed |
442 | -- for all the hatchings. |
443 | |
444 | ---C++: inline |
445 | returns Boolean from Standard |
446 | raises NoSuchObject from Standard |
447 | is static ; |
448 | |
449 | |
450 | IsDone (me; IndH : Integer from Standard) |
451 | |
452 | ---Purpose: Returns the fact that the domains were computed |
453 | -- for the IndH-th hatching. |
454 | |
455 | returns Boolean from Standard |
456 | raises NoSuchObject from Standard |
457 | is static ; |
458 | |
459 | |
460 | Status (me; IndH : Integer from Standard) |
461 | |
462 | ---Purpose: Returns the status about the IndH-th hatching. |
463 | |
464 | ---C++: inline |
465 | returns ErrorStatus from HatchGen |
466 | raises NoSuchObject from Standard |
467 | is static ; |
468 | |
469 | |
470 | NbDomains (me; IndH : Integer from Standard) |
471 | |
472 | ---Purpose: Returns the number of domains of the IndH-th hatching. |
473 | -- Only ONE "INFINITE" domain means that the hatching is |
474 | -- fully included in the contour defined by the elements. |
475 | |
476 | ---C++: inline |
477 | returns Integer from Standard |
478 | raises NoSuchObject from Standard , |
479 | NotDone from StdFail |
480 | is static ; |
481 | |
482 | |
483 | Domain (me; IndH : Integer from Standard ; |
484 | IDom : Integer from Standard ) |
485 | |
486 | ---Purpose: Returns the IDom-th domain of the IndH-th hatching. |
487 | |
488 | ---C++: return const & |
489 | |
490 | returns Domain from HatchGen |
491 | raises NoSuchObject from Standard , |
492 | NotDone from StdFail , |
493 | OutOfRange from Standard |
494 | is static ; |
495 | |
496 | |
497 | ---Category: Dump |
498 | |
499 | Dump (me) |
500 | |
501 | ---Purpose: Dump the hatcher. |
502 | |
503 | is static ; |
504 | |
505 | |
506 | fields |
507 | |
508 | myIntersector : TheIntersector ; |
509 | myConfusion2d : Real from Standard ; |
510 | myConfusion3d : Real from Standard ; |
511 | myKeepPoints : Boolean from Standard ; |
512 | myKeepSegments : Boolean from Standard ; |
513 | myNbElements : Integer from Standard ; |
514 | myElements : Elements from HatchGen ; |
515 | myNbHatchings : Integer from Standard ; |
516 | myHatchings : Hatchings from HatchGen ; |
517 | |
518 | end Hatcher from HatchGen ; |