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