0024841: Remove duplicated and/or unused instances of collections
[occt.git] / src / Graphic3d / Graphic3d.cdl
1 -- Created on: 1993-03-31
2 -- Created by: NW,JPB,CAL
3 -- Copyright (c) 1993-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 -- Package  :   Graphic3d
18 -- Updated  :   Vendredi 2 Octobre 1992
19 --          Mercredi 31 Mars 1993
20 --          Mercredi 19 Janvier 1994
21 --      1/08/97 ; PCT : Ajout texture mapping
22 --      11/97 ; CAL : retrait de la dependance avec math
23 --      11/97 ; CAL : retrait des DataStructure
24 --              04/98 ; FGU : ajout champs 'TOR_EMISSION'
25 --      16-09-98; BGN: (S3819) Ajout TypeOfTriedronEcho,
26 --                             TypeOfTriedronPosition.
27 --              22-09-98; BGN: S3989 (anciennement S3819): report
28 --                             dans Aspect des TypeOfTriedron*
29 --              26-03-99 : FMN ; Compatibilite ascendante:
30 --              Ajout des anciens noms de materiaux.
31 --              09-04-99 : GG ; Compatibilite ascendante:
32 --                         NameOfPhysicalMaterial disparait
33 --              23-11-99 : GG ; Add material name DEFAULT
34 --          16-06-2000 : ATS : Study G005: class ArrayOfPrimitives
35 --              and derivated used for model presentation.
36 --                       Required: enumeration TypeOfPrimitive;
37 --                  imported PrimitiveArray; class PrimitiveList.
38 --      17-12-01 : GG ; IMP171201 : Add material name UserDefined
39 --              Thanks to Stephane ROUTELOUS
40 --              20-01-2009 : ABD Integration support of system fonts (using FTGL and FreeType)
41 -- Objective    :   Specifications definitives
42
43 package Graphic3d
44
45     ---Version:
46
47     ---Purpose: This package permits the creation of 3d graphic objects
48     --      in a visualiser.
49     --      These objects, called structures, are composed of groups of
50     --      primitives and attributes.
51     --      The group is the smallest editable element of a structure.
52     --      A structure can be displayed, erased, high-lighted.
53     --      A transformation can be applied to it.
54     --      Structures can be connected to form a tree of structures,
55     --      composed by transformations.
56     --      The visualiser permits global manipulation of structures.
57
58     ---Keywords: Structure, Group, Primitives, Line, Marker, Text,
59     --  FillAreas, Vertex, Vector, Material, Font, Shading
60     ---Warning:
61     ---References:
62
63 uses
64
65     TCollection,
66     TColStd,
67     TColgp,
68     OSD,
69     Quantity,
70     Aspect,
71     MMgt,
72     WNT,
73     Image,
74     gp,
75     Font
76 is
77
78     -----------------------
79     -- Category: Exceptions
80     -----------------------
81
82     exception AspectTextDefinitionError inherits OutOfRange;
83     ---Category: Exceptions
84
85     exception CycleError inherits DomainError;
86     ---Category: Exceptions
87
88     exception GroupDefinitionError inherits OutOfRange;
89     ---Category: Exceptions
90
91     exception InitialisationError inherits OutOfRange;
92     ---Category: Exceptions
93
94     exception MaterialDefinitionError inherits OutOfRange;
95     ---Category: Exceptions
96
97     exception PlotterDefinitionError inherits OutOfRange;
98     ---Category: The exceptions
99
100     exception PriorityDefinitionError inherits OutOfRange;
101     ---Category: Exceptions
102
103     exception StructureDefinitionError inherits OutOfRange;
104     ---Category: Exceptions
105
106     exception TransformError inherits OutOfRange;
107     ---Category: Exceptions
108
109     exception VectorError inherits OutOfRange;
110     ---Category: Exceptions
111
112     -------------------------
113     -- Category: Enumerations
114     -------------------------
115
116         enumeration NameOfMaterial is
117                     NOM_BRASS,      -- laiton       (PHYSIC)
118                                         NOM_BRONZE,     -- bronze       (PHYSIC)
119                                         NOM_COPPER,     -- cuivre       (PHYSIC)
120                                         NOM_GOLD,       -- or           (PHYSIC)
121
122                                         NOM_PEWTER,     -- etain        (PHYSIC)
123
124                                         NOM_PLASTER,    -- platre       (GENERIC)
125                                         NOM_PLASTIC,    -- plastic      (GENERIC)
126
127                                         NOM_SILVER,     -- argent       (PHYSIC)
128
129                                         NOM_STEEL,      -- acier        (PHYSIC)
130
131                                         NOM_STONE,      -- pierre       (PHYSIC)
132
133                                         NOM_SHINY_PLASTIC,      -- plastique brillant   (GENERIC)
134                                         NOM_SATIN,      --  satin       (GENERIC)
135                                         NOM_METALIZED,  -- metallise New (GENERIC)
136                                         NOM_NEON_GNC,   -- neon      New (GENERIC)
137                                         NOM_CHROME,     -- chrome    New (PHYSIC)
138                                         NOM_ALUMINIUM,  -- aluminium New (PHYSIC)
139                                         NOM_OBSIDIAN,   -- obsidian  New (PHYSIC)
140                                         NOM_NEON_PHC,   -- neon      New (PHYSIC)
141                                         NOM_JADE,       -- jade      New (PHYSIC)
142                         NOM_DEFAULT,
143                         NOM_UserDefined -- owner material
144     end NameOfMaterial;
145     ---Purpose: Types of aspect materials.
146     ---Category: Enumerations
147
148     enumeration TypeOfMaterial is MATERIAL_ASPECT,          -- Materiel generique
149                                   MATERIAL_PHYSIC           -- Materiel physique
150     end TypeOfMaterial;
151         ---Purpose: Types of materials specifies if a material can change color.
152     ---Category: Enumerations
153
154         enumeration  NameOfTexture1D  is  NOT_1D_ELEVATION,
155                       NOT_1D_UNKNOWN
156     end  NameOfTexture1D;
157     ---Purpose: Types of standard textures.
158     ---Category: Enumerations
159
160
161     enumeration  NameOfTexture2D  is  NOT_2D_MATRA,
162                                       NOT_2D_ALIENSKIN,
163                                       NOT_2D_BLUE_ROCK,
164                                       NOT_2D_BLUEWHITE_PAPER,
165                                       NOT_2D_BRUSHED,
166                                       NOT_2D_BUBBLES,
167                                       NOT_2D_BUMP,
168                                       NOT_2D_CAST,
169                                       NOT_2D_CHIPBD,
170                                       NOT_2D_CLOUDS,
171                                       NOT_2D_FLESH,
172                                       NOT_2D_FLOOR,
173                                       NOT_2D_GALVNISD,
174                                       NOT_2D_GRASS,
175                                       NOT_2D_ALUMINUM,
176                                       NOT_2D_ROCK,
177                                       NOT_2D_KNURL,
178                                       NOT_2D_MAPLE,
179                                       NOT_2D_MARBLE,
180                                       NOT_2D_MOTTLED,
181                                       NOT_2D_RAIN,
182                                       NOT_2D_UNKNOWN
183     end  NameOfTexture2D;
184     ---Purpose: Types of standard textures.
185     ---Category: Enumerations
186
187
188         enumeration  NameOfTextureEnv is  NOT_ENV_CLOUDS,
189                                           NOT_ENV_CV,
190                                           NOT_ENV_MEDIT,
191                                           NOT_ENV_PEARL,
192                                           NOT_ENV_SKY1,
193                                           NOT_ENV_SKY2,
194                                           NOT_ENV_LINES,
195                                           NOT_ENV_ROAD,
196                                           NOT_ENV_UNKNOWN
197     end  NameOfTextureEnv;
198     ---Purpose: Types of standard textures.
199     ---Category: Enumerations
200
201         enumeration  TypeOfTexture  is  TOT_1D,
202                                         TOT_2D,
203                                         TOT_2D_MIPMAP;
204     ---Purpose: Type of the texture file format.
205     ---Category: Enumerations
206
207     enumeration  TypeOfTextureMode  is  TOTM_OBJECT,
208                                         TOTM_SPHERE,
209                                         TOTM_EYE,
210                                         TOTM_MANUAL,
211                                         TOTM_SPRITE;
212     ---Purpose: Type of the texture projection.
213     ---Category: Enumerations
214
215     enumeration  TypeOfTextureFilter is TOTF_NEAREST,
216                                         TOTF_BILINEAR,
217                                         TOTF_TRILINEAR;
218     ---Purpose: Type of the texture filter.
219     -- Notice that for textures without mipmaps linear interpolation will be used instead of TOTF_BILINEAR and TOTF_TRILINEAR.
220     ---Category: Enumerations
221
222     enumeration  LevelOfTextureAnisotropy is LOTA_OFF,
223                                              LOTA_FAST,
224                                              LOTA_MIDDLE,
225                                              LOTA_QUALITY;
226     ---Purpose: Level of anisotropy filter.
227     -- Notice that actual quality depends on hardware capabilities!
228     ---Category: Enumerations
229
230     enumeration  NameOfTexturePlane  is  NOTP_XY,
231                                          NOTP_YZ,
232                                          NOTP_ZX,
233                                          NOTP_UNKNOWN;
234     ---Purpose: Type of the texture projection plane for both S and T texture coordinate.
235     ---Category: Enumerations
236
237     enumeration TypeOfComposition is    TOC_REPLACE,
238                         TOC_POSTCONCATENATE
239     end TypeOfComposition;
240     ---Purpose: To manage the transformation matrices of structures.
241     ---Category: Enumerations
242
243     enumeration TypeOfConnection is TOC_ANCESTOR,
244                     TOC_DESCENDANT
245     end TypeOfConnection;
246     ---Purpose: To manage the connections between the structures.
247     ---Category: Enumerations
248
249     enumeration TypeOfPolygon is    TOP_UNKNOWN,
250                                     TOP_COMPLEX,
251                                     TOP_CONCAVE,
252                                     TOP_CONVEX
253     end TypeOfPolygon;
254     ---Purpose: The type of polygon in a group in a structure.
255     ---Category: Enumerations
256
257     enumeration TypeOfPrimitive is  TOP_UNDEFINED,
258                                     TOP_POLYLINE,
259                                     TOP_POLYGON,
260                                     TOP_TRIANGLEMESH,
261                                     TOP_QUADRANGLEMESH,
262                                     TOP_TEXT,
263                                     TOP_MARKER,
264                                     TOP_PARRAY
265     end TypeOfPrimitive;
266     ---Purpose: The type of primitive in a group in a structure.
267     ---Category: Enumerations
268
269         enumeration TypeOfPrimitiveArray is TOPA_UNDEFINED,
270                                             TOPA_POINTS,
271                                             TOPA_POLYLINES,
272                                             TOPA_SEGMENTS,
273                                             TOPA_POLYGONS,
274                                             TOPA_TRIANGLES,
275                                             TOPA_QUADRANGLES,
276                                             TOPA_TRIANGLESTRIPS,
277                                             TOPA_QUADRANGLESTRIPS,
278                                             TOPA_TRIANGLEFANS
279         end TypeOfPrimitiveArray;
280         ---Purpose: The type of primitive array in a group in a structure.
281         ---Category: Enumerations
282
283     enumeration TypeOfReflection is TOR_AMBIENT,
284                                     TOR_DIFFUSE,
285                                     TOR_SPECULAR,
286                                     TOR_EMISSION
287     end TypeOfReflection;
288     ---Purpose: Nature of the reflection of a material.
289     ---Category: Enumerations
290
291     enumeration TypeOfStructure is  TOS_WIREFRAME,
292                                     TOS_SHADING,
293                                     TOS_COMPUTED,
294                                     TOS_ALL
295     end TypeOfStructure;
296     ---Purpose: Structural attribute indicating if it can be displayed
297     --      in wireframe, shadow mode, or both.
298     ---Category: Enumerations
299
300     enumeration TextPath is TP_UP,
301                             TP_DOWN,
302                             TP_LEFT,
303                             TP_RIGHT
304     end TextPath;
305     ---Purpose: Direction in which text is displayed.
306     ---Category: Enumerations
307
308     enumeration HorizontalTextAlignment is  HTA_LEFT,
309                                             HTA_CENTER,
310                                             HTA_RIGHT
311     end HorizontalTextAlignment;
312     ---Purpose: Defines the horizontal position of the text
313     --      relative to its anchor.
314     ---Category: Enumerations
315
316     enumeration VerticalTextAlignment is    VTA_BOTTOM,
317                                             VTA_CENTER,
318                                             VTA_TOP
319     end VerticalTextAlignment;
320     ---Purpose: Defines the vertical position of the text
321     --      relative to its anchor.
322     ---Category: Enumerations
323
324     enumeration GroupAspect is ASPECT_LINE,
325         ASPECT_TEXT,
326         ASPECT_MARKER,
327         ASPECT_FILL_AREA
328     end GroupAspect;
329     ---Purpose: Identifies primitives aspects defined per group.
330     -- - ASPECT_LINE: aspect for line primitives;
331     -- - ASPECT_TEXT: aspect for text primitives;
332     -- - ASPECT_MARKER: aspect for marker primitives;
333     -- - ASPECT_FILL_AREA: aspect for face primitives.
334
335     ---------------------------
336     -- Category: Imported types
337     ---------------------------
338
339     imported Buffer;
340     imported Buffer_Handle;
341     imported BoundBuffer;
342     imported BoundBuffer_Handle;
343     imported IndexBuffer;
344     imported IndexBuffer_Handle;
345
346     imported BufferType;
347
348     imported CBitFields20;
349     ---Purpose: Defines the C structure
350     ---Category: Imported types
351
352     imported CBitFields16;
353     ---Purpose: Defines the C structure
354     ---Category: Imported types
355
356     imported CBitFields8;
357     ---Purpose: Defines the C structure
358     ---Category: Imported types
359
360     imported CBitFields4;
361     ---Purpose: Defines the C structure
362     ---Category: Imported types
363
364     imported CAspectFillArea;
365     imported CAspectMarker;
366     imported CAspectLine;
367     imported CAspectText;
368
369     imported CStructure;
370     ---Purpose: Defines the C structure <astructure>
371     ---Category: Imported types
372
373     pointer CStructurePtr to CStructure from Graphic3d;
374
375     imported CStructure_Handle;
376
377     imported CLight;
378     ---Purpose: Defines the C structure <alight>
379     ---Category: Imported types
380
381     imported CPick;
382     ---Purpose: Defines the C structure <apick>
383     ---Category: Imported types
384
385     imported CPlane;
386     ---Purpose: Defines the C structure <aplane>
387     ---Category: Imported types
388
389     imported CBounds;
390     ---Purpose: Defines the C structure <abounds>
391     ---Category: Imported types
392
393     imported CUserDraw;
394     ---Purpose: Defines the C structure <auserdraw>
395     ---Category: Imported types
396
397     imported CView;
398     ---Purpose: Defines the C structure <aview>
399     ---Category: Imported types
400
401     imported CGraduatedTrihedron;
402     ---Purpose: Defines the C structure of a graduated trihedron.
403     ---Category: Imported types
404
405     imported ClipPlane;
406     ---Purpose: Describes geometrical and auxiliary properties of clipping
407     -- planes applied on rendering by graphical driver.
408     ---Category: Imported types
409
410     imported ClipPlane_Handle;
411     ---Purpose: CDL-compatibility handle type definition for
412     -- clip plane objects.
413
414     imported CTexture;
415
416     imported CTransPersStruct;
417     imported TransModeFlags;
418     
419     imported MarkerImage;
420     imported MarkerImage_Handle;
421     imported Camera_Handle;
422
423     primitive PtrFrameBuffer;
424     primitive Vec2;
425     primitive Vec3;
426     primitive Vec4;
427     imported  Mat4;
428     imported  Mat4d;
429
430     imported ZLayerSettings;
431
432     --------------------
433     -- Category: Classes
434     --------------------
435
436     deferred class ArrayOfPrimitives;
437     ---Purpose: Contains basic methods for array allocation and filling
438
439     class ArrayOfPoints;
440     ---Purpose: Contains points array definition
441
442     class ArrayOfPolylines;
443     ---Purpose: Contains polylines array definition
444
445     class ArrayOfSegments;
446     ---Purpose: Contains segments array definition
447
448     class ArrayOfPolygons;
449     ---Purpose: Contains polygons array definition
450
451     class ArrayOfTriangles;
452     ---Purpose: Contains triangles array definition
453
454     class ArrayOfTriangleStrips;
455     ---Purpose: Contains triangles strip array definition
456
457     class ArrayOfTriangleFans;
458     ---Purpose: Contains triangles fan array definition
459
460     class ArrayOfQuadrangles;
461     ---Purpose: Contains quatrangles array definition
462
463     class ArrayOfQuadrangleStrips;
464     ---Purpose: Contains quadrangles strip array definition
465
466     class AspectLine3d;
467     ---Purpose: Grouping line attributes
468     ---Category: Classes
469
470     class AspectFillArea3d;
471     ---Purpose: Grouping face attributes
472     ---Category: Classes
473
474     class AspectMarker3d;
475     ---Purpose: Grouping marker attributes
476     ---Category: Classes
477
478     class AspectText3d;
479     ---Purpose: Grouping text attributes.
480     ---Category: Classes
481
482     deferred class Group;
483     ---Purpose: For grouping together primitives in a structure
484     ---Category: Classes
485
486     class MaterialAspect;
487     ---Purpose: Aspect attributes of a 3d face.
488     ---Category: Classes
489
490     class Structure;
491     ---Purpose: Graphic object.
492     ---Category: Classes
493
494     pointer StructurePtr to Structure from Graphic3d;
495
496     deferred class GraphicDriver;
497     ---Purpose: Defines a graphic driver for 3d interface
498
499     deferred class StructureManager;
500     ---Purpose: Visualiser with which the graphic objects are associated.
501     ---Category: Classes
502
503     pointer StructureManagerPtr to StructureManager from Graphic3d;
504
505     deferred class DataStructureManager;
506     ---Purpose: Visualiser with which the graphic objects are associated.
507     ---Category: Classes
508
509     deferred class Plotter;
510     ---Purpose: Defines the minimal plotter.
511     ---Category: The classes
512
513     class Vector;
514     ---Purpose: 3d vector
515     ---Category: Classes
516
517     imported Vertex;
518     ---Purpose: 3d vertex
519     ---Category: Classes
520
521     ---------------------------------
522     -- Category: Instantiated classes
523     ---------------------------------
524
525     imported SequenceOfGroup;
526
527     ---Category: Instantiated classes
528
529     class MapOfStructure instantiates
530             Map from TCollection (Structure from Graphic3d,MapTransientHasher from TColStd);
531
532
533     ---Category: Instantiated classes
534
535     class SequenceOfStructure instantiates
536             Sequence from TCollection
537             (Structure from Graphic3d);
538     ---Category: Instantiated classes
539
540     class HSequenceOfStructure instantiates
541             HSequence from TCollection
542         (Structure from Graphic3d, SequenceOfStructure from Graphic3d);
543     ---Category: Instantiated classes
544
545     class Array1OfVector instantiates
546             Array1 from TCollection (Vector from Graphic3d);
547     ---Category: Instantiated classes
548
549     class Array1OfVertex instantiates
550             Array1 from TCollection (Vertex from Graphic3d);
551     ---Category: Instantiated classes
552
553     class Array2OfVertex instantiates
554             Array2 from TCollection (Vertex from Graphic3d);
555     ---Category: Instantiated classes
556
557     class ListOfShortReal instantiates
558             List from TCollection (ShortReal from Standard);
559     ---Category: Instantiated classes
560
561     --ABD Integration support of system fonts (using FTGL and FreeType)
562     imported NListOfHAsciiString;
563     ---Category: Instantiated classes
564
565     imported ShaderProgram_Handle;
566     ---Category: Instantiated classes
567
568     imported SequenceOfHClipPlane;
569     ---Category: Instantiated classes
570     -- Sequence of handles on clip planes
571
572     deferred  class  TextureRoot  from  Graphic3d;
573     deferred  class  TextureMap   from  Graphic3d;
574     deferred  class  Texture1D    from  Graphic3d;
575     deferred  class  Texture2D    from  Graphic3d;
576
577     class  TextureParams    from  Graphic3d;
578     class  TextureEnv       from  Graphic3d;
579     class  Texture1Dmanual  from  Graphic3d;
580     class  Texture1Dsegment from  Graphic3d;
581     class  Texture2Dmanual  from  Graphic3d;
582     class  Texture2Dplane   from  Graphic3d;
583
584
585     enumeration ExportFormat is
586
587         EF_PostScript,
588         EF_EnhPostScript,
589         EF_TEX,
590         EF_PDF,
591         EF_SVG,
592         EF_PGF,
593         EF_EMF
594
595     end ExportFormat;
596
597
598     enumeration SortType is
599
600         ST_Simple,    -- sorting by depth of center point of primitive(fast)
601         ST_BSP_Tree   -- sorting by BSPTree (slow, but fine result )
602
603         end SortType;
604
605     ----------------------------
606     -- Category: Package methods
607     ----------------------------
608
609     InitGraphicDriver (theDisplayConnection: DisplayConnection_Handle from Aspect)
610        returns GraphicDriver from Graphic3d
611        raises  DriverDefinitionError from Aspect;
612     ---Purpose: Initialize graphic driver and returns Handle to it.
613
614     
615
616 end Graphic3d;