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