Commit | Line | Data |
---|---|---|
b311480e | 1 | -- Created on: 1991-06-12 |
2 | -- Created by: NW,JPB,CAL | |
3 | -- Copyright (c) 1991-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 | -- 11/97 ; CAL : gestion du GraphicClear |
22 | -- 11/97 ; CAL : ajout pointer StructPtr | |
23 | -- 11/97 ; CAL : amelioration de l'effacement SetManager | |
24 | -- 01/98 ; CAL : gestion du HLRValidation | |
25 | -- 05/98 ; CAL : gestion du GraphicConnect et Disconnect | |
26 | -- 02/00 ; GG : Made Transform() methode not mutable. | |
27 | -- 31/05/01 ; GG : Add ResetDisplayPriority() method | |
7fd59977 | 28 | |
29 | class Structure from Graphic3d inherits TShared | |
30 | ||
31 | ---Version: | |
32 | ||
33 | ---Purpose: This class allows the definition a graphic object. | |
34 | -- This graphic structure can be displayed, | |
35 | -- erased, or highlighted. | |
36 | -- This graphic structure can be connected with | |
37 | -- another graphic structure. | |
38 | -- Keywords: Structure, StructureManager, Display, Erase, Highlight, | |
39 | -- UnHighlight, Visible, Priority, Selectable, Visible, | |
40 | -- Visual, Connection, Ancestors, Descendants, Transformation | |
41 | ||
42 | ---Warning: | |
43 | ---References: | |
44 | ||
45 | uses | |
46 | ||
47 | Array2OfReal from TColStd, | |
48 | SequenceOfAddress from TColStd, | |
49 | ||
50 | Color from Quantity, | |
51 | ||
52 | GenId from Aspect, | |
53 | TypeOfHighlightMethod from Aspect, | |
54 | ||
55 | DataStructureManager from Graphic3d, | |
56 | AspectFillArea3d from Graphic3d, | |
57 | AspectLine3d from Graphic3d, | |
58 | AspectMarker3d from Graphic3d, | |
59 | AspectText3d from Graphic3d, | |
60 | CStructure from Graphic3d, | |
61 | GraphicDriver from Graphic3d, | |
62 | Group from Graphic3d, | |
63 | SequenceOfGroup from Graphic3d, | |
64 | HSequenceOfGroup from Graphic3d, | |
65 | SequenceOfStructure from Graphic3d, | |
66 | HSequenceOfStructure from Graphic3d, | |
7fd59977 | 67 | MapOfStructure from Graphic3d, |
68 | Plotter from Graphic3d, | |
69 | StructureManager from Graphic3d, | |
70 | TypeOfComposition from Graphic3d, | |
71 | TypeOfConnection from Graphic3d, | |
72 | TypeOfPrimitive from Graphic3d, | |
73 | TypeOfStructure from Graphic3d, | |
74 | Vector from Graphic3d, | |
75 | VertexNC from Graphic3d, | |
76 | Vertex from Graphic3d, | |
bbf32d01 | 77 | TransModeFlags from Graphic3d, |
7fd59977 | 78 | Pnt from gp |
79 | ||
80 | raises | |
81 | ||
82 | PriorityDefinitionError from Graphic3d, | |
83 | StructureDefinitionError from Graphic3d, | |
84 | TransformError from Graphic3d | |
85 | ||
86 | is | |
87 | ||
88 | ------------------------ | |
89 | -- Category: Constructor | |
90 | ------------------------ | |
91 | ||
92 | Create ( AManager : StructureManager from Graphic3d ) | |
93 | returns mutable Structure from Graphic3d; | |
94 | ---Level: Public | |
95 | ---Purpose: Creates a graphic object in the manager <AManager>. | |
96 | -- It will appear in all the views of the visualiser. | |
97 | -- Warning: The default values AspectLine, AspectFillArea, | |
98 | -- AspectText and AspectMarker are NOT applied to the | |
99 | -- structure. | |
100 | -- The structure is not displayed when it is created. | |
101 | ||
102 | --------------------------------------------------- | |
103 | -- Category: Methods to modify the class definition | |
104 | --------------------------------------------------- | |
105 | ||
106 | -------------------------------------------------------- | |
107 | -- Summary of Display Priorities -- | |
108 | -- -- | |
109 | -- Structure display priorities control the order in -- | |
110 | -- which structures are redrawn. -- | |
111 | -- -- | |
112 | -- When you display a structure, you specify its -- | |
113 | -- priority. The lower the value, the lower the -- | |
114 | -- display priority. When the display is regenerated, -- | |
115 | -- the structures with the lowest priority are drawn -- | |
116 | -- first. -- | |
117 | -- For structures with the same display priority, -- | |
118 | -- the order in which they were displayed determines -- | |
119 | -- determines the drawing order. -- | |
120 | -- -- | |
121 | -- CAS.CADE supports 11 structure display priorities, -- | |
122 | -- 0 to 10. -- | |
123 | -------------------------------------------------------- | |
124 | ||
125 | Clear ( me : mutable; | |
126 | WithDestruction : Boolean from Standard = Standard_True ) | |
127 | is virtual; | |
128 | ---Level: Public | |
129 | ---Purpose: if WithDestruction == Standard_True then | |
130 | -- suppress all the groups of primitives in the structure. | |
131 | -- and it is mandatory to create a new group in <me>. | |
132 | -- if WithDestruction == Standard_False then | |
133 | -- clears all the groups of primitives in the structure. | |
134 | -- and all the groups are conserved and empty. | |
135 | -- They will be erased at the next screen update. | |
136 | -- The structure itself is conserved. | |
137 | -- The transformation and the attributes of <me> are conserved. | |
138 | -- The childs of <me> are conserved. | |
139 | ---Category: Methods to modify the class definition | |
140 | ||
141 | Destroy ( me : mutable ) | |
142 | is virtual; | |
143 | ---Level: Public | |
144 | ---Purpose: Suppresses the structure <me>. | |
145 | -- It will be erased at the next screen update. | |
146 | ---Category: Methods to modify the class definition | |
147 | ---C++: alias ~ | |
148 | ||
149 | Display ( me : mutable ) | |
150 | is virtual; | |
151 | ---Level: Public | |
152 | ---Purpose: Displays the structure <me> in all the views of | |
153 | -- the visualiser. | |
154 | ---Category: Methods to modify the class definition | |
155 | ||
156 | Display ( me : mutable; | |
157 | Priority : Integer from Standard ) | |
158 | ---Level: Public | |
159 | ---Purpose: Displays the structure <me> in all the views of | |
160 | -- the visualiser, while modifying its current priority. | |
161 | -- Note: Display Priorities | |
162 | -- Structure display priorities control the order in which | |
163 | -- structures are redrawn. When you display a | |
164 | -- structure, you specify its priority. The lower the value, | |
165 | -- the lower the display priority. When the display is | |
166 | -- regenerated, the structures with the lowest priority | |
167 | -- are drawn first. For structures with the same display | |
168 | -- priority, the order in which they were displayed | |
169 | -- determines the drawing order. Open CASCADE | |
170 | -- supports 11 structure display priorities, 0 to 10. | |
171 | -- Warning: Raises PriorityDefinitionError if <Priority> is | |
172 | -- greater than 10 or a negative value. | |
173 | raises PriorityDefinitionError from Graphic3d is static; | |
174 | ||
175 | DisplayPriority ( me ) | |
176 | returns Integer from Standard | |
177 | is static; | |
178 | ---Level: Public | |
179 | ---Purpose: Returns the current display priority for the | |
180 | -- structure <me>. | |
181 | ---Category: Methods to modify the class definition | |
182 | ||
183 | Erase ( me : mutable ) | |
184 | is virtual; | |
185 | ---Level: Public | |
186 | ---Purpose: Erases the structure <me> in all the views | |
187 | -- of the visualiser. | |
188 | ---Category: Methods to modify the class definition | |
189 | ||
190 | Highlight ( me : mutable; | |
191 | Method : TypeOfHighlightMethod from Aspect ) | |
192 | is static; | |
193 | ---Level: Public | |
194 | ---Purpose: Highlights the structure <me> in all the | |
195 | -- views of the visualiser, using the following methods: | |
196 | -- | |
197 | -- TOHM_COLOR = drawn in the highlight color | |
198 | -- (default white) | |
199 | -- TOHM_BLINK = blinking | |
200 | -- TOHM_BOUNDBOX = enclosed by the boundary box | |
201 | -- (default white) | |
202 | -- | |
203 | ---Category: Methods to modify the class definition | |
204 | ||
205 | Remove ( me : mutable ) | |
206 | is static; | |
207 | ---Level: Public | |
208 | ---Purpose: Suppress the structure <me>. | |
209 | -- It will be erased at the next screen update. | |
210 | -- Warning: No more graphic operations in <me> after this call. | |
211 | -- Category: Methods to modify the class definition | |
212 | ||
213 | SetHighlightColor ( me : mutable; | |
214 | AColor : Color from Quantity ) | |
215 | is static; | |
216 | ---Level: Public | |
217 | ---Purpose: Modifies the highlight color for the Highlight method | |
218 | -- with the highlight method TOHM_COLOR or TOHM_BOUNDBOX. | |
219 | ---Category: Methods to modify the class definition | |
220 | ||
221 | SetInfiniteState ( me : mutable; | |
222 | AFlag : Boolean from Standard ) | |
223 | is static; | |
224 | ---Level: Internal | |
225 | ---Purpose: Modifies the coordinates of the boundary box | |
226 | -- of the structure <me>. | |
227 | -- if <AFlag> is Standard_True then <me> is infinite and | |
228 | -- the MinMaxValues method or the MinMaxCoord method return : | |
229 | -- XMin = YMin = ZMin = RealFirst (). | |
230 | -- XMax = YMax = ZMax = RealLast (). | |
231 | -- By default, <me> is not infinite but empty. | |
232 | ---Category: Methods to modify the class definition | |
233 | ||
234 | SetDisplayPriority ( me : mutable; | |
235 | Priority : Integer from Standard ) | |
236 | ---Level: Public | |
237 | ---Purpose: Modifies the order of displaying the structure. | |
9edc5e12 | 238 | -- Values are between 0 and 10. |
239 | -- Structures are drawn according to their display priorities | |
240 | -- in ascending order. | |
241 | -- A structure of priority 10 is displayed the last and appears over the others. | |
242 | -- The default value is 5. | |
7fd59977 | 243 | -- Category: Methods to modify the class definition |
244 | -- Warning: If <me> is displayed then the SetDisplayPriority | |
245 | -- method erase <me> and display <me> with the | |
246 | -- new priority. | |
247 | -- Raises PriorityDefinitionError if <Priority> is | |
248 | -- greater than 10 or a negative value. | |
249 | raises PriorityDefinitionError from Graphic3d is static; | |
250 | ||
251 | ResetDisplayPriority ( me : mutable) | |
252 | is static; | |
253 | ---Level: Public | |
bbf32d01 | 254 | ---Purpose: Reset the current priority of the structure to the |
7fd59977 | 255 | -- previous priority. |
256 | -- Category: Methods to modify the class definition | |
257 | -- Warning: If <me> is displayed then the SetDisplayPriority | |
258 | -- method erase <me> and display <me> with the | |
259 | -- previous priority. | |
59f45b7c | 260 | |
261 | SetZLayer ( me : mutable; | |
262 | theLayerId : Integer from Standard ) | |
263 | is static; | |
264 | ---Purpose: Set Z layer ID for the structure. The Z layer mechanism | |
265 | -- allows to display structures presented in higher layers in overlay | |
266 | -- of structures in lower layers by switching off z buffer depth | |
267 | -- test between layers | |
268 | ||
269 | GetZLayer ( me ) | |
270 | returns Integer from Standard is static; | |
271 | ---Purpose: Get Z layer ID of displayed structure. The method | |
272 | -- returns -1 if the structure has no ID (deleted from graphic driver). | |
7fd59977 | 273 | |
274 | SetPick ( me : mutable; | |
275 | AValue : Boolean from Standard ) | |
276 | is static; | |
277 | ---Level: Public | |
278 | ---Purpose: Modifies the detectability indicator to Standard_True | |
279 | -- or Standard_False for the structure <me>. | |
280 | -- The default value at the definition of <me> is | |
281 | -- Standard_True. | |
282 | ---Category: Methods to modify the class definition | |
283 | ||
284 | SetPrimitivesAspect ( me : mutable; | |
285 | CTX : AspectLine3d from Graphic3d ) | |
286 | is static; | |
287 | ---Level: Public | |
288 | ---Purpose: Modifies the default attributes for lines | |
289 | -- in the structure <me>. | |
290 | ---Category: Methods to modify the class definition | |
291 | ||
292 | SetPrimitivesAspect ( me : mutable; | |
293 | CTX : AspectFillArea3d from Graphic3d ) | |
294 | is static; | |
295 | ---Level: Public | |
296 | ---Purpose: Modifies the default attributes for faces | |
297 | -- in the structure <me>. | |
298 | ---Category: Methods to modify the class definition | |
299 | ||
300 | SetPrimitivesAspect ( me : mutable; | |
301 | CTX : AspectText3d from Graphic3d ) | |
302 | is static; | |
303 | ---Level: Public | |
304 | ---Purpose: Modifies the default attributes for text | |
305 | -- in the structure <me>. | |
306 | ---Category: Methods to modify the class definition | |
307 | ||
308 | SetPrimitivesAspect ( me : mutable; | |
309 | CTX : AspectMarker3d from Graphic3d ) | |
310 | is static; | |
311 | ---Level: Public | |
312 | ---Purpose: Modifies the default attributes for markers | |
313 | -- in the structure <me>. | |
314 | ---Category: Methods to modify the class definition | |
315 | ||
316 | SetVisible ( me : mutable; | |
317 | AValue : Boolean from Standard ) | |
318 | is static; | |
319 | ---Level: Public | |
320 | ---Purpose: Modifies the visibility indicator to Standard_True or | |
321 | -- Standard_False for the structure <me>. | |
322 | -- The default value at the definition of <me> is | |
323 | -- Standard_True. | |
324 | ---Category: Methods to modify the class definition | |
325 | ||
326 | SetManager ( me : mutable; | |
327 | AManager : StructureManager from Graphic3d; | |
328 | WithPropagation : Boolean from Standard = Standard_False) | |
329 | is static; | |
330 | ---Level: Public | |
331 | ---Purpose: Moves the graphic object <me> in the manager <AManager>. | |
332 | -- If <WithPropagation> is Standard_True then all the connected | |
333 | -- graphic objects to <me> are moved. | |
334 | ||
335 | SetVisual ( me : mutable; | |
336 | AVisual : TypeOfStructure from Graphic3d ) | |
337 | is virtual; | |
338 | ---Level: Public | |
339 | ---Purpose: Modifies the visualisation mode for the structure <me>. | |
340 | ---Warning: It is not possible to display a structure with | |
341 | -- an incompatible display mode. | |
342 | -- If the display mode is different from the current one, | |
343 | -- the structure is erased. | |
344 | -- | |
345 | -- TOS_WIREFRAME for a wireframe visualisation | |
346 | -- TOS_SHADING for a shaded visualisation | |
347 | -- TOS_ALL for all visualisations | |
348 | -- TOS_COMPUTED for a computed visualisation | |
349 | -- The default value is TOS_ALL | |
350 | -- | |
351 | ---Category: Methods to modify the class definition | |
352 | ||
353 | SetZoomLimit ( me : mutable; | |
354 | LimitInf, LimitSup : Real from Standard ) | |
355 | ---Level: Internal | |
356 | ---Purpose: Modifies the minimum and maximum zoom coefficients | |
357 | -- for the structure <me>. | |
358 | -- The default value at the definition of <me> is unlimited. | |
359 | -- Category: Methods to modify the class definition | |
360 | -- Warning: Raises StructureDefinitionError if <LimitInf> is | |
361 | -- greater than <LimitSup> or if <LimitInf> or | |
362 | -- <LimitSup> is a negative value. | |
363 | raises StructureDefinitionError from Graphic3d is static; | |
364 | ||
365 | UnHighlight ( me : mutable ) | |
366 | is static; | |
367 | ---Level: Public | |
368 | ---Purpose: Suppresses the highlight for the structure <me> | |
369 | -- in all the views of the visualiser. | |
370 | ---Category: Methods to modify the class definition | |
371 | ||
372 | ---------------------------- | |
373 | -- Category: Compute methods | |
374 | ---------------------------- | |
375 | ||
376 | Compute ( me : mutable; | |
377 | aProjector : DataStructureManager from Graphic3d ) | |
378 | returns Structure from Graphic3d is virtual; | |
379 | ---Level: Advanced | |
380 | ---Purpose: Returns the new Structure defined for the new visualization | |
381 | ---Category: Methods to modify the class definition | |
382 | ||
383 | Compute ( me : mutable; | |
384 | aProjector : DataStructureManager from Graphic3d; | |
385 | AMatrix : Array2OfReal from TColStd ) | |
386 | returns Structure from Graphic3d is virtual; | |
387 | ---Level: Advanced | |
388 | ---Purpose: Returns the new Structure defined for the new visualization | |
389 | ---Category: Methods to modify the class definition | |
390 | ||
391 | Compute ( me : mutable; | |
392 | aProjector : DataStructureManager from Graphic3d; | |
393 | aStructure : in out Structure from Graphic3d ) | |
394 | is virtual; | |
395 | ---Level: Advanced | |
396 | ---Purpose: Returns the new Structure defined for the new visualization | |
397 | ---Category: Methods to modify the class definition | |
398 | ||
399 | Compute ( me : mutable; | |
400 | aProjector : DataStructureManager from Graphic3d; | |
401 | AMatrix : Array2OfReal from TColStd; | |
402 | aStructure : in out Structure from Graphic3d ) | |
403 | is virtual; | |
404 | ---Level: Advanced | |
405 | ---Purpose: Returns the new Structure defined for the new visualization | |
406 | ---Category: Methods to modify the class definition | |
407 | ||
408 | ReCompute ( me : mutable ); | |
409 | ---Level: Advanced | |
410 | ---Purpose: Forces a new construction of the structure <me> | |
411 | -- if <me> is displayed and TOS_COMPUTED. | |
412 | ---Category: Methods to modify the class definition | |
413 | ||
414 | ReCompute ( me : mutable; | |
415 | aProjector : DataStructureManager from Graphic3d ); | |
416 | ---Level: Advanced | |
417 | ---Purpose: Forces a new construction of the structure <me> | |
418 | -- if <me> is displayed in <aProjetor> and TOS_COMPUTED. | |
419 | ---Category: Methods to modify the class definition | |
420 | ||
421 | ---------------------------- | |
422 | -- Category: Inquire methods | |
423 | ---------------------------- | |
424 | ||
425 | ContainsFacet ( me ) | |
426 | returns Boolean from Standard | |
427 | is static; | |
428 | ---Level: Public | |
429 | ---Purpose: Returns Standard_True if the structure <me> contains | |
430 | -- Polygons, Triangles or Quadrangles. | |
431 | ---Category: Inquire methods | |
432 | ||
8ca7beb8 | 433 | |
7fd59977 | 434 | FillArea3dAspect ( me ) |
435 | returns AspectFillArea3d from Graphic3d | |
436 | is static; | |
437 | ---Level: Public | |
438 | ---Purpose: Returns the values of the current default attributes. | |
439 | ---Category: Inquire methods | |
440 | ||
441 | Groups ( me ) | |
bbf32d01 | 442 | returns SequenceOfGroup from Graphic3d |
7fd59977 | 443 | is static; |
bbf32d01 | 444 | ---C++: return const & |
7fd59977 | 445 | ---Level: Internal |
bbf32d01 | 446 | ---Purpose: Returns the groups sequence included in the structure <me> (internal storage). |
7fd59977 | 447 | ---Category: Inquire methods |
448 | ||
449 | NumberOfGroups ( me ) | |
450 | returns Integer from Standard | |
451 | is static; | |
452 | ---Level: Public | |
453 | ---Purpose: Returns the current number of groups in the | |
454 | -- structure <me>. | |
455 | ---Category: Inquire methods | |
456 | ||
457 | HighlightColor ( me ) | |
458 | returns Color from Quantity | |
459 | is static; | |
460 | ---Level: Public | |
461 | ---Purpose: Returns the highlight color for the Highlight method | |
462 | -- with the highlight method TOHM_COLOR or TOHM_BOUNDBOX. | |
463 | ---Category: Inquire methods | |
464 | ||
465 | IsDeleted ( me ) | |
466 | returns Boolean from Standard | |
467 | is static; | |
468 | ---Level: Public | |
469 | ---Purpose: Returns Standard_True if the structure <me> is deleted. | |
470 | -- <me> is deleted after the call Remove (me). | |
471 | ---Category: Inquire methods | |
472 | ||
473 | IsDisplayed ( me ) | |
474 | returns Boolean from Standard | |
475 | is virtual; | |
476 | ---Level: Public | |
477 | ---Purpose: Returns the display indicator for the structure <me>. | |
478 | ---Category: Inquire methods | |
479 | ||
480 | IsEmpty ( me ) | |
481 | returns Boolean from Standard | |
482 | is static; | |
483 | ---Level: Public | |
484 | ---Purpose: Returns Standard_True if the structure <me> is empty. | |
485 | -- Warning: A structure is empty if : | |
486 | -- it do not have group or all the groups are empties | |
487 | -- and it do not have descendant or all the descendants | |
488 | -- are empties. | |
489 | ---Category: Inquire methods | |
490 | ||
491 | IsInfinite ( me ) | |
492 | returns Boolean from Standard | |
493 | is static; | |
494 | ---Level: Internal | |
495 | ---Purpose: Returns Standard_True if the structure <me> is infinite. | |
496 | ---Category: Inquire methods | |
497 | ||
498 | IsHighlighted ( me ) | |
499 | returns Boolean from Standard | |
500 | is virtual; | |
501 | ---Level: Public | |
502 | ---Purpose: Returns the highlight indicator for the structure <me>. | |
503 | ---Category: Inquire methods | |
504 | ||
505 | IsSelectable ( me ) | |
506 | returns Boolean from Standard | |
507 | is static; | |
508 | ---Level: Public | |
509 | ---Purpose: Returns the detectability indicator for the structure <me>. | |
510 | ---Category: Inquire methods | |
511 | ||
512 | IsRotated ( me ) | |
513 | returns Boolean from Standard | |
514 | is static; | |
515 | ---Level: Public | |
516 | ---Purpose: Returns Standard_True if the structure <me> is rotated. | |
517 | -- <=> The transformation != Identity, != Scale, != Translation. | |
518 | ---Category: Inquire methods | |
519 | ||
520 | IsTransformed ( me ) | |
521 | returns Boolean from Standard | |
522 | is static; | |
523 | ---Level: Public | |
524 | ---Purpose: Returns Standard_True if the structure <me> is transformed. | |
525 | -- <=> The transformation != Identity. | |
526 | ---Category: Inquire methods | |
527 | ||
528 | IsVisible ( me ) | |
529 | returns Boolean from Standard | |
530 | is static; | |
531 | ---Level: Public | |
532 | ---Purpose: Returns the visibility indicator for the structure <me>. | |
533 | ---Category: Inquire methods | |
534 | ||
535 | Line3dAspect ( me ) | |
536 | returns AspectLine3d from Graphic3d | |
537 | is static; | |
538 | ---Level: Public | |
539 | ---Purpose: Returns the values of the current default attributes. | |
540 | ---Category: Inquire methods | |
541 | ||
542 | Marker3dAspect ( me ) | |
543 | returns AspectMarker3d from Graphic3d | |
544 | is static; | |
545 | ---Purpose: Returns the current group of graphic attributes used | |
546 | -- for 3d marker primitives. | |
547 | ||
548 | MinMaxValues ( me; | |
549 | XMin, YMin, ZMin : out Real from Standard; | |
550 | XMax, YMax, ZMax : out Real from Standard ) | |
551 | is static; | |
552 | ---Level: Public | |
553 | ---Purpose: Returns the coordinates of the boundary box | |
554 | -- of the structure <me>. | |
555 | -- Warning: If the structure <me> is empty or infinite then : | |
556 | -- XMin = YMin = ZMin = RealFirst (). | |
557 | -- XMax = YMax = ZMax = RealLast (). | |
558 | ---Category: Inquire methods | |
559 | ||
560 | PrimitivesAspect ( me; | |
561 | CTXL : out AspectLine3d from Graphic3d; | |
562 | CTXT : out AspectText3d from Graphic3d; | |
563 | CTXM : out AspectMarker3d from Graphic3d; | |
564 | CTXF : out AspectFillArea3d from Graphic3d ) | |
565 | is static; | |
566 | ---Level: Public | |
567 | ---Purpose: Returns the current values of the default attributes. | |
568 | ---Category: Inquire methods | |
569 | ||
570 | Text3dAspect ( me ) | |
571 | returns AspectText3d from Graphic3d | |
572 | is static; | |
573 | ---Level: Public | |
574 | ---Purpose: Returns the values of the current default attributes. | |
575 | ---Category: Inquire methods | |
576 | ||
7fd59977 | 577 | Visual ( me ) |
578 | returns TypeOfStructure from Graphic3d | |
579 | is static; | |
580 | ---Level: Public | |
581 | ---Purpose: Returns the visualisation mode for the structure <me>. | |
582 | ---Category: Inquire methods | |
583 | ||
584 | ---------------------------------------------------- | |
585 | -- Category: Methods to manage the structure network | |
586 | ---------------------------------------------------- | |
587 | ||
588 | ----------------------------------------------------- | |
589 | -- Summary of Structure Hierarchies -- | |
590 | -- -- | |
591 | -- The root is the top of a structure hierarchy -- | |
592 | -- or structure network. -- | |
593 | -- -- | |
594 | -- The attributes of a parent structure are passed -- | |
595 | -- passed to its descendants. -- | |
596 | -- -- | |
597 | -- The attributes of the descendant structures -- | |
598 | -- don't affect the parent. -- | |
599 | -- -- | |
600 | -- Recursive structure networks are not supported. -- | |
601 | ----------------------------------------------------- | |
602 | ||
603 | AcceptConnection ( myclass; | |
604 | AStructure1 : Structure from Graphic3d; | |
605 | AStructure2 : Structure from Graphic3d; | |
606 | AType : TypeOfConnection from Graphic3d ) | |
607 | returns Boolean from Standard; | |
608 | ---Level: Internal | |
609 | ---Purpose: Returns Standard_True if the connection is possible between | |
610 | -- <AStructure1> and <AStructure2> without a creation | |
611 | -- of a cycle. | |
612 | -- | |
613 | -- It's not possible to call the method | |
614 | -- AStructure1->Connect (AStructure2, TypeOfConnection) | |
615 | -- if | |
616 | -- - the set of all ancestors of <AStructure1> contains | |
617 | -- <AStructure1> and if the | |
618 | -- TypeOfConnection == TOC_DESCENDANT | |
619 | -- - the set of all descendants of <AStructure1> contains | |
620 | -- <AStructure2> and if the | |
621 | -- TypeOfConnection == TOC_ANCESTOR | |
622 | ---Category: Methods to manage the structure network | |
623 | ||
624 | Ancestors ( me; SG: in out MapOfStructure from Graphic3d ) | |
625 | is static; | |
626 | ---Level: Internal | |
627 | ---Purpose: Returns the group of structures to which <me> is connected. | |
628 | ---Category: Methods to manage the structure network | |
629 | ||
630 | Connect ( me : mutable; | |
631 | AStructure : Structure from Graphic3d; | |
632 | AType : TypeOfConnection from Graphic3d; | |
633 | WithCheck : Boolean from Standard = Standard_False ); | |
634 | ---Level: Public | |
635 | ---Purpose: If Atype is TOC_DESCENDANT then add <AStructure> | |
636 | -- as a child structure of <me>. | |
637 | -- If Atype is TOC_ANCESTOR then add <AStructure> | |
638 | -- as a parent structure of <me>. | |
639 | -- The connection propagates Display, Highlight, Erase, | |
640 | -- Remove, and stacks the transformations. | |
641 | -- No connection if the graph of the structures | |
642 | -- contains a cycle and <WithCheck> is Standard_True; | |
643 | ---Category: Methods to manage the structure network | |
644 | ||
645 | Descendants ( me; SG : in out MapOfStructure from Graphic3d ) | |
646 | is static; | |
647 | ---Level: Internal | |
648 | ---Purpose: Returns the group of structures connected to <me>. | |
649 | ---Category: Methods to manage the structure network | |
650 | ||
651 | Disconnect ( me : mutable; | |
652 | AStructure : Structure from Graphic3d ) | |
653 | is static; | |
654 | ---Level: Public | |
655 | ---Purpose: Suppress the connection between <AStructure> and <me>. | |
656 | ---Category: Methods to manage the structure network | |
657 | ||
658 | DisconnectAll ( me : mutable; | |
659 | AType : TypeOfConnection from Graphic3d ) | |
660 | is static; | |
661 | ---Level: Public | |
662 | ---Purpose: If Atype is TOC_DESCENDANT then suppress all | |
663 | -- the connections with the child structures of <me>. | |
664 | -- If Atype is TOC_ANCESTOR then suppress all | |
665 | -- the connections with the parent structures of <me>. | |
666 | ---Category: Methods to manage the structure network | |
667 | ||
668 | Network ( myclass; | |
669 | AStructure : Structure from Graphic3d; | |
670 | AType : TypeOfConnection from Graphic3d; | |
671 | ASet : in out MapOfStructure from Graphic3d ); | |
672 | ---Level: Internal | |
673 | ---Purpose: Returns <ASet> the group of structures : | |
674 | -- - directly or indirectly connected to <AStructure> if the | |
675 | -- TypeOfConnection == TOC_DESCENDANT | |
676 | -- - to which <AStructure> is directly or indirectly connected | |
677 | -- if the TypeOfConnection == TOC_ANCESTOR | |
678 | ---Category: Methods to manage the structure network | |
679 | ||
680 | SetOwner ( me : mutable; | |
681 | Owner : Address from Standard ) | |
682 | is static; | |
683 | ---Level: Advanced | |
684 | ||
685 | Owner ( me ) | |
686 | returns Address from Standard | |
687 | is static; | |
688 | ---Level: Advanced | |
689 | ||
690 | SetHLRValidation ( me : mutable; | |
691 | AFlag : Boolean from Standard ) | |
692 | is static; | |
693 | ---Level: Advanced | |
694 | ||
695 | HLRValidation ( me ) | |
696 | returns Boolean from Standard | |
697 | is static; | |
698 | ---Level: Advanced | |
699 | ||
700 | ----------------------------------------------------------- | |
701 | -- Category: Methods to manage the structure transformation | |
702 | ----------------------------------------------------------- | |
703 | ||
704 | Composition ( me ) | |
705 | returns TypeOfComposition from Graphic3d | |
706 | is static; | |
707 | ---Level: Public | |
708 | ---Purpose: Returns the type of composition applied to matrices | |
709 | -- of transformation of <me>. | |
710 | ---Category: Methods to manage the structure transformation | |
711 | ||
712 | SetTransform ( me : mutable; | |
713 | AMatrix : Array2OfReal from TColStd; | |
714 | AType : TypeOfComposition from Graphic3d ) | |
715 | ---Level: Public | |
716 | ---Purpose: Modifies the current local modelling transformation | |
717 | -- in the structure <me>. | |
718 | -- | |
719 | -- It is defined as a 4*4 real matrix. | |
720 | -- | |
721 | -- ------------------- | |
722 | -- | a11 a12 a13 t1 | | |
723 | -- | a21 a22 a23 t2 | | |
724 | -- | a31 a32 a33 t3 | | |
725 | -- | 0 0 0 1 | | |
726 | -- ------------------- | |
727 | -- | |
728 | -- TypeOfComposition : TOC_REPLACE | |
729 | -- TOC_POSTCONCATENATE | |
730 | -- | |
731 | -- Then the modified Local Modelling Transformation is composed | |
732 | -- with the current Global Modelling Transformation to create a | |
733 | -- new Composite Modelling Transformation. | |
734 | -- | |
735 | -- The compose type specifies the role of the current local | |
736 | -- modelling transformation (L) in composing the new value for | |
737 | -- the current local modelling transformation (L'), which is | |
738 | -- then combined with the current global modelling transforma- | |
739 | -- tion (G) to calculate the new composite modelling transfor- | |
740 | -- mation (C). | |
741 | -- | |
742 | -- TOC_REPLACE | |
743 | -- The transformation matrix (T) replaces the value of | |
744 | -- current local modelling transformation (L). | |
745 | -- | |
746 | -- L' <- T | |
747 | -- C <- G x L' | |
748 | -- | |
749 | -- TOC_POSTCONCATENATE | |
750 | -- The current local modelling transformation (L) is multiplied | |
751 | -- by the transformation matrix (T): | |
752 | -- | |
753 | -- L' <- T x L | |
754 | -- C <- G x L' | |
755 | -- | |
756 | -- Category: Methods to manage the structure transformation | |
757 | -- Warning: Raises TransformError if the matrix is not a 4x4 matrix. | |
758 | raises TransformError from Graphic3d is static; | |
759 | ||
760 | -- Transform ( me : mutable; | |
761 | Transform ( me; | |
762 | AMatrix : in out Array2OfReal from TColStd ) | |
763 | is static; | |
764 | ---Level: Public | |
765 | ---Purpose: Returns the transformation associated with | |
766 | -- the structure <me>. | |
bbf32d01 K |
767 | ---Category: Methods to manage the structure transformation |
768 | ||
7fd59977 | 769 | SetTransformPersistence( me : mutable; |
bbf32d01 | 770 | AFlag : TransModeFlags from Graphic3d; |
7fd59977 | 771 | APoint : Pnt from gp ) |
772 | ---Level: Public | |
773 | ---Purpose: Modifies the current modelling transform persistence (pan, zoom or rotate) | |
774 | is static; | |
775 | ||
bbf32d01 | 776 | SetTransformPersistence( me : mutable; |
7fd59977 | 777 | AFlag : TransModeFlags from Graphic3d ) |
778 | -- Calls previous method with point (0,0,0) | |
779 | is static; | |
bbf32d01 | 780 | |
7fd59977 | 781 | |
782 | TransformPersistenceMode( me ) | |
783 | returns TransModeFlags from Graphic3d | |
784 | ---Level: Public | |
785 | ---Purpose: Get the current modelling transform persistence (pan, zoom or rotate) | |
bbf32d01 K |
786 | is static; |
787 | ||
7fd59977 | 788 | TransformPersistencePoint( me ) |
789 | returns Pnt from gp | |
790 | ---Level: Public | |
791 | ---Purpose: Get the current point of relative modelling transform persistence | |
792 | is static; | |
793 | ||
794 | ---------------------------- | |
795 | -- Category: Private methods | |
796 | ---------------------------- | |
797 | ||
798 | Add ( me : mutable; | |
799 | AGroup : Group from Graphic3d ) | |
800 | is static private; | |
801 | ---Level: Internal | |
802 | ---Purpose: Inserts in the structure <me>, the group <G>. | |
803 | -- It will be erased at the next screen update. | |
804 | ---Category: Private methods | |
805 | ||
806 | ComputeVisual ( me ) | |
807 | returns TypeOfStructure from Graphic3d | |
808 | is static; | |
809 | ---Level: Internal | |
810 | ---Category: Private methods | |
811 | ||
812 | GroupsWithFacet ( me : mutable; | |
813 | ADelta : Integer from Standard ) | |
814 | is static private; | |
815 | ---Level: Internal | |
816 | ---Purpose: Manages the number of groups in the structure <me> | |
817 | -- which contains facet. | |
818 | -- Polygons, Triangles or Quadrangles. | |
819 | -- <ADelta> = +1 or -1 | |
820 | ---Category: Private methods | |
821 | ||
7fd59977 | 822 | GraphicClear ( me : mutable; |
823 | WithDestruction : Boolean from Standard ) | |
824 | is static; | |
825 | ---Level: Internal | |
826 | ---Purpose: Clears the structure <me>. | |
827 | ---Category: Private methods | |
828 | ||
829 | GraphicConnect ( me : mutable; | |
830 | ADaughter : Structure from Graphic3d ) | |
831 | is static; | |
832 | ---Level: Internal | |
833 | ---Purpose: | |
834 | ---Category: Private methods | |
835 | ||
836 | GraphicDisconnect ( me : mutable; | |
837 | ADaughter : Structure from Graphic3d ) | |
838 | is static; | |
839 | ---Level: Internal | |
840 | ---Purpose: | |
841 | ---Category: Private methods | |
842 | ||
843 | GraphicHighlight ( me : mutable; | |
844 | Method : TypeOfHighlightMethod from Aspect ) | |
845 | is static; | |
846 | ---Level: Internal | |
847 | ---Purpose: Highlights the structure <me>. | |
848 | ---Category: Private methods | |
849 | ||
850 | GraphicTransform ( me : mutable; | |
851 | AMatrix : Array2OfReal from TColStd ) | |
852 | is static; | |
853 | ---Level: Internal | |
bbf32d01 | 854 | ---Purpose: |
7fd59977 | 855 | ---Category: Private methods |
856 | ||
857 | GraphicUnHighlight ( me : mutable ) | |
858 | is static; | |
859 | ---Level: Internal | |
860 | ---Purpose: Suppress the highlight for the structure <me>. | |
861 | ---Category: Private methods | |
862 | ||
863 | GroupLabels ( me : mutable; | |
864 | LB, LE : in out Integer from Standard ) | |
865 | is static private; | |
866 | ---Level: Internal | |
867 | ---Purpose: Returns the labels for a new group in the structure <me>. | |
868 | ---Category: Private methods | |
869 | ||
870 | Identification ( me ) | |
871 | returns Integer from Standard | |
872 | is static; | |
873 | ---Level: Internal | |
874 | ---Purpose: Returns the identification number of the structure <me>. | |
875 | ---Category: Private methods | |
876 | ||
877 | MinMaxCoord ( me; | |
878 | XMin, YMin, ZMin : out Real from Standard; | |
879 | XMax, YMax, ZMax : out Real from Standard ) | |
880 | is static private; | |
881 | ---Level: Internal | |
882 | ---Purpose: Returns the extreme coordinates found in the | |
883 | -- structure <me>. | |
884 | -- Warning: If the structure <me> is empty or infinite then : | |
885 | -- XMin = YMin = ZMin = RealFirst (). | |
886 | -- XMax = YMax = ZMax = RealLast (). | |
887 | ---Category: Private methods | |
888 | ||
889 | Plot ( me : mutable; | |
890 | aPlotter : Plotter from Graphic3d ) | |
891 | is virtual; | |
892 | ---Level: Internal | |
893 | ---Category: Private methods | |
894 | ||
895 | PrintNetwork ( myclass; | |
896 | AStructure : Structure from Graphic3d; | |
897 | AType : TypeOfConnection from Graphic3d ); | |
898 | ---Level: Internal | |
899 | ---Purpose: Prints informations about the network associated | |
900 | -- with the structure <AStructure>. | |
901 | ---Category: Private methods | |
902 | ||
903 | Remove ( me : mutable; | |
904 | APtr : Address from Standard; | |
905 | AType : TypeOfConnection from Graphic3d ) | |
906 | is static; | |
907 | ---Level: Internal | |
908 | ---Purpose: Suppress the adress <APtr> in the list | |
909 | -- of descendants or in the list of ancestors. | |
910 | ---Category: Private methods | |
911 | ||
912 | Remove ( me : mutable; | |
913 | AGroup : Group from Graphic3d ) | |
914 | is static private; | |
915 | ---Level: Internal | |
916 | ---Purpose: Suppress in the structure <me>, the group <AGroup>. | |
917 | -- It will be erased at the next screen update. | |
918 | ---Category: Private methods | |
919 | ||
920 | SetComputeVisual ( me : mutable; | |
921 | AVisual : TypeOfStructure from Graphic3d ) | |
922 | is static; | |
923 | ---Level: Internal | |
924 | ---Category: Private methods | |
925 | ||
926 | StructureManager ( me ) | |
927 | returns StructureManager from Graphic3d | |
928 | is static private; | |
929 | ---Level: Internal | |
930 | ---Purpose: Returns the manager to which <me> is associated. | |
931 | ---Category: Private methods | |
932 | ||
933 | Transforms ( myclass; | |
934 | ATrsf : Array2OfReal from TColStd; | |
935 | X, Y, Z : Real from Standard; | |
936 | NewX, NewY, NewZ : out Real from Standard ); | |
937 | ---Level: Internal | |
938 | ---Purpose: Transforms <X>, <Y>, <Z> with the transformation <ATrsf>. | |
939 | ---Category: Private methods | |
940 | ||
941 | Transforms ( myclass; | |
942 | ATrsf : Array2OfReal from TColStd; | |
943 | Coord : Vector from Graphic3d ) | |
944 | returns Vector from Graphic3d; | |
945 | ---Level: Internal | |
946 | ---Purpose: Transforms <Coord> with the transformation <ATrsf>. | |
947 | ---Category: Private methods | |
948 | ||
949 | Transforms ( myclass; | |
950 | ATrsf : Array2OfReal from TColStd; | |
951 | Coord : Vertex from Graphic3d ) | |
952 | returns Vertex from Graphic3d; | |
953 | ---Level: Internal | |
954 | ---Purpose: Transforms <Coord> with the transformation <ATrsf>. | |
955 | ---Category: Private methods | |
956 | ||
957 | Update ( me ) | |
958 | is static private; | |
959 | ---Level: Internal | |
960 | ---Purpose: Calls the Update method of the StructureManager which | |
961 | -- contains the Structure <me>. | |
962 | ---Category: Private methods | |
963 | ||
964 | UpdateStructure ( me : mutable; | |
965 | CTXL : AspectLine3d from Graphic3d; | |
966 | CTXT : AspectText3d from Graphic3d; | |
967 | CTXM : AspectMarker3d from Graphic3d; | |
968 | CTXF : AspectFillArea3d from Graphic3d ) | |
969 | is static private; | |
970 | ---Level: Internal | |
971 | ---Purpose: Updates the c structure associated to <me>. | |
972 | ---Category: Private methods | |
973 | ||
974 | CStructure ( me ) | |
975 | returns Address from Standard | |
976 | is static; | |
977 | ---Level: Internal | |
978 | ---Purpose: Returns the c structure associated to <me>. | |
979 | ---Category: Private methods | |
980 | ||
981 | --\f | |
982 | ||
983 | --\f | |
984 | ||
985 | fields | |
986 | ||
987 | -- | |
988 | -- Class : Graphic3d_Structure | |
989 | -- | |
990 | -- Purpose : Declaration of variables specific to | |
991 | -- graphic structures. | |
992 | -- Reminder : A structure is defined in a manager. | |
993 | -- It is a sequence of groups of primitives. | |
994 | -- | |
995 | ||
996 | -- the associated C structure | |
997 | MyCStructure : CStructure from Graphic3d; | |
998 | ||
999 | -- the group identifier generator | |
1000 | MyGroupGenId : GenId from Aspect; | |
1001 | ||
1002 | -- the structures to which the structure is attached | |
1003 | MyAncestors : SequenceOfAddress from TColStd; | |
1004 | ||
1005 | -- the structures attached to the structure | |
1006 | MyDescendants : SequenceOfAddress from TColStd; | |
1007 | ||
1008 | -- the sequence of groups | |
1009 | MyGroups : SequenceOfGroup from Graphic3d; | |
1010 | ||
1011 | -- the graphic driver used | |
1012 | MyGraphicDriver : GraphicDriver from Graphic3d; | |
1013 | ||
1014 | -- the highlight method of the structure | |
1015 | MyHighlightColor : Color from Quantity; | |
1016 | MyHighlightMethod : TypeOfHighlightMethod from Aspect; | |
1017 | ||
1018 | -- the manager accepting the structure | |
1019 | MyPtrStructureManager : Address from Standard is protected; | |
1020 | MyFirstPtrStructureManager : Address from Standard is protected; | |
1021 | MyOwner : Address from Standard; | |
1022 | ||
1023 | -- the type of visualisation accepted by the structure | |
1024 | MyVisual : TypeOfStructure from Graphic3d; | |
1025 | MyComputeVisual : TypeOfStructure from Graphic3d is protected; | |
1026 | ||
1027 | friends | |
1028 | ||
1029 | -- a lot of methods of Group use the methods of Structure | |
1030 | class Group from Graphic3d | |
1031 | ||
1032 | end Structure; |