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