f1bf523b356084e3dce4e85135dff524dc10ac2d
[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 PriorityDefinitionError inherits OutOfRange;
98     ---Category: Exceptions
99
100     exception StructureDefinitionError inherits OutOfRange;
101     ---Category: Exceptions
102
103     exception TransformError inherits OutOfRange;
104     ---Category: Exceptions
105
106     exception VectorError inherits OutOfRange;
107     ---Category: Exceptions
108
109     -------------------------
110     -- Category: Enumerations
111     -------------------------
112
113         enumeration NameOfMaterial is
114                     NOM_BRASS,      -- laiton       (PHYSIC)
115                     NOM_BRONZE,     -- bronze       (PHYSIC)
116                     NOM_COPPER,     -- cuivre       (PHYSIC)
117                     NOM_GOLD,       -- or           (PHYSIC)
118
119                     NOM_PEWTER,     -- etain        (PHYSIC)
120
121                     NOM_PLASTER,    -- platre       (GENERIC)
122                     NOM_PLASTIC,    -- plastic      (GENERIC)
123
124                     NOM_SILVER,     -- argent       (PHYSIC)
125
126                     NOM_STEEL,      -- acier        (PHYSIC)
127
128                     NOM_STONE,      -- pierre       (PHYSIC)
129
130                     NOM_SHINY_PLASTIC,   -- plastique brillant   (GENERIC)
131                     NOM_SATIN,           --  satin        (GENERIC)
132                     NOM_METALIZED,       -- metallise New (GENERIC)
133                     NOM_NEON_GNC,        -- neon      New (GENERIC)
134                     NOM_CHROME,          -- chrome    New (PHYSIC)
135                     NOM_ALUMINIUM,       -- aluminium New (PHYSIC)
136                     NOM_OBSIDIAN,        -- obsidian  New (PHYSIC)
137                     NOM_NEON_PHC,        -- neon      New (PHYSIC)
138                     NOM_JADE,            -- jade      New (PHYSIC)
139
140                     NOM_CHARCOAL,
141
142                     NOM_WATER,
143                     NOM_GLASS,
144                     NOM_DIAMOND,
145
146                     NOM_DEFAULT,
147                     NOM_UserDefined -- owner material
148     end NameOfMaterial;
149     ---Purpose: Types of aspect materials.
150     ---Category: Enumerations
151
152     enumeration TypeOfMaterial is MATERIAL_ASPECT,          -- Materiel generique
153                                   MATERIAL_PHYSIC           -- Materiel physique
154     end TypeOfMaterial;
155         ---Purpose: Types of materials specifies if a material can change color.
156     ---Category: Enumerations
157
158         enumeration  NameOfTexture1D  is  NOT_1D_ELEVATION,
159                       NOT_1D_UNKNOWN
160     end  NameOfTexture1D;
161     ---Purpose: Types of standard textures.
162     ---Category: Enumerations
163
164
165     enumeration  NameOfTexture2D  is  NOT_2D_MATRA,
166                                       NOT_2D_ALIENSKIN,
167                                       NOT_2D_BLUE_ROCK,
168                                       NOT_2D_BLUEWHITE_PAPER,
169                                       NOT_2D_BRUSHED,
170                                       NOT_2D_BUBBLES,
171                                       NOT_2D_BUMP,
172                                       NOT_2D_CAST,
173                                       NOT_2D_CHIPBD,
174                                       NOT_2D_CLOUDS,
175                                       NOT_2D_FLESH,
176                                       NOT_2D_FLOOR,
177                                       NOT_2D_GALVNISD,
178                                       NOT_2D_GRASS,
179                                       NOT_2D_ALUMINUM,
180                                       NOT_2D_ROCK,
181                                       NOT_2D_KNURL,
182                                       NOT_2D_MAPLE,
183                                       NOT_2D_MARBLE,
184                                       NOT_2D_MOTTLED,
185                                       NOT_2D_RAIN,
186                                       NOT_2D_UNKNOWN
187     end  NameOfTexture2D;
188     ---Purpose: Types of standard textures.
189     ---Category: Enumerations
190
191
192         enumeration  NameOfTextureEnv is  NOT_ENV_CLOUDS,
193                                           NOT_ENV_CV,
194                                           NOT_ENV_MEDIT,
195                                           NOT_ENV_PEARL,
196                                           NOT_ENV_SKY1,
197                                           NOT_ENV_SKY2,
198                                           NOT_ENV_LINES,
199                                           NOT_ENV_ROAD,
200                                           NOT_ENV_UNKNOWN
201     end  NameOfTextureEnv;
202     ---Purpose: Types of standard textures.
203     ---Category: Enumerations
204
205         enumeration  TypeOfTexture  is  TOT_1D,
206                                         TOT_2D,
207                                         TOT_2D_MIPMAP;
208     ---Purpose: Type of the texture file format.
209     ---Category: Enumerations
210
211     enumeration  TypeOfTextureMode  is  TOTM_OBJECT,
212                                         TOTM_SPHERE,
213                                         TOTM_EYE,
214                                         TOTM_MANUAL,
215                                         TOTM_SPRITE;
216     ---Purpose: Type of the texture projection.
217     ---Category: Enumerations
218
219     enumeration  TypeOfTextureFilter is TOTF_NEAREST,
220                                         TOTF_BILINEAR,
221                                         TOTF_TRILINEAR;
222     ---Purpose: Type of the texture filter.
223     -- Notice that for textures without mipmaps linear interpolation will be used instead of TOTF_BILINEAR and TOTF_TRILINEAR.
224     ---Category: Enumerations
225
226     enumeration  LevelOfTextureAnisotropy is LOTA_OFF,
227                                              LOTA_FAST,
228                                              LOTA_MIDDLE,
229                                              LOTA_QUALITY;
230     ---Purpose: Level of anisotropy filter.
231     -- Notice that actual quality depends on hardware capabilities!
232     ---Category: Enumerations
233
234     enumeration  NameOfTexturePlane  is  NOTP_XY,
235                                          NOTP_YZ,
236                                          NOTP_ZX,
237                                          NOTP_UNKNOWN;
238     ---Purpose: Type of the texture projection plane for both S and T texture coordinate.
239     ---Category: Enumerations
240
241     enumeration TypeOfComposition is    TOC_REPLACE,
242                         TOC_POSTCONCATENATE
243     end TypeOfComposition;
244     ---Purpose: To manage the transformation matrices of structures.
245     ---Category: Enumerations
246
247     enumeration TypeOfConnection is TOC_ANCESTOR,
248                     TOC_DESCENDANT
249     end TypeOfConnection;
250     ---Purpose: To manage the connections between the structures.
251     ---Category: Enumerations
252
253     enumeration TypeOfPolygon is    TOP_UNKNOWN,
254                                     TOP_COMPLEX,
255                                     TOP_CONCAVE,
256                                     TOP_CONVEX
257     end TypeOfPolygon;
258     ---Purpose: The type of polygon in a group in a structure.
259     ---Category: Enumerations
260
261     enumeration TypeOfPrimitive is  TOP_UNDEFINED,
262                                     TOP_POLYLINE,
263                                     TOP_POLYGON,
264                                     TOP_TRIANGLEMESH,
265                                     TOP_QUADRANGLEMESH,
266                                     TOP_TEXT,
267                                     TOP_MARKER,
268                                     TOP_PARRAY
269     end TypeOfPrimitive;
270     ---Purpose: The type of primitive in a group in a structure.
271     ---Category: Enumerations
272
273         enumeration TypeOfPrimitiveArray is TOPA_UNDEFINED,
274                                             TOPA_POINTS,
275                                             TOPA_POLYLINES,
276                                             TOPA_SEGMENTS,
277                                             TOPA_POLYGONS,
278                                             TOPA_TRIANGLES,
279                                             TOPA_QUADRANGLES,
280                                             TOPA_TRIANGLESTRIPS,
281                                             TOPA_QUADRANGLESTRIPS,
282                                             TOPA_TRIANGLEFANS
283         end TypeOfPrimitiveArray;
284         ---Purpose: The type of primitive array in a group in a structure.
285         ---Category: Enumerations
286
287     enumeration TypeOfReflection is TOR_AMBIENT,
288                                     TOR_DIFFUSE,
289                                     TOR_SPECULAR,
290                                     TOR_EMISSION
291     end TypeOfReflection;
292     ---Purpose: Nature of the reflection of a material.
293     ---Category: Enumerations
294
295     enumeration TypeOfStructure is  TOS_WIREFRAME,
296                                     TOS_SHADING,
297                                     TOS_COMPUTED,
298                                     TOS_ALL
299     end TypeOfStructure;
300     ---Purpose: Structural attribute indicating if it can be displayed
301     --      in wireframe, shadow mode, or both.
302     ---Category: Enumerations
303
304     enumeration TextPath is TP_UP,
305                             TP_DOWN,
306                             TP_LEFT,
307                             TP_RIGHT
308     end TextPath;
309     ---Purpose: Direction in which text is displayed.
310     ---Category: Enumerations
311
312     enumeration HorizontalTextAlignment is  HTA_LEFT,
313                                             HTA_CENTER,
314                                             HTA_RIGHT
315     end HorizontalTextAlignment;
316     ---Purpose: Defines the horizontal position of the text
317     --      relative to its anchor.
318     ---Category: Enumerations
319
320     enumeration VerticalTextAlignment is    VTA_BOTTOM,
321                                             VTA_CENTER,
322                                             VTA_TOP
323     end VerticalTextAlignment;
324     ---Purpose: Defines the vertical position of the text
325     --      relative to its anchor.
326     ---Category: Enumerations
327
328     enumeration GroupAspect is ASPECT_LINE,
329         ASPECT_TEXT,
330         ASPECT_MARKER,
331         ASPECT_FILL_AREA
332     end GroupAspect;
333     ---Purpose: Identifies primitives aspects defined per group.
334     -- - ASPECT_LINE: aspect for line primitives;
335     -- - ASPECT_TEXT: aspect for text primitives;
336     -- - ASPECT_MARKER: aspect for marker primitives;
337     -- - ASPECT_FILL_AREA: aspect for face primitives.
338
339     enumeration RenderingMode is
340       RM_RASTERIZATION, RM_RAYTRACING
341     end RenderingMode;
342     ---Purpose: Describes rendering modes.
343     -- - RM_RASTERIZATION: enables OpenGL rasterization mode;
344     -- - RM_RAYTRACING: enables GPU ray-tracing mode.
345
346     ---------------------------
347     -- Category: Imported types
348     ---------------------------
349
350     imported Buffer;
351     imported Buffer_Handle;
352     imported BoundBuffer;
353     imported BoundBuffer_Handle;
354     imported IndexBuffer;
355     imported IndexBuffer_Handle;
356
357     imported BufferType;
358
359     imported CBitFields20;
360     ---Category: Imported types
361
362     imported CBitFields16;
363     ---Category: Imported types
364
365     imported CBitFields8;
366     ---Category: Imported types
367
368     imported CBitFields4;
369     ---Category: Imported types
370
371     imported CAspectFillArea;
372     imported CAspectMarker;
373     imported CAspectLine;
374     imported CAspectText;
375
376     imported CStructure;
377     ---Category: Imported types
378
379     pointer CStructurePtr to CStructure from Graphic3d;
380
381     imported CStructure_Handle;
382
383     imported CLight;
384     ---Category: Imported types
385
386     imported CPick;
387     ---Category: Imported types
388
389     imported CPlane;
390     ---Category: Imported types
391
392     imported CBounds;
393     ---Category: Imported types
394
395     imported CUserDraw;
396     ---Category: Imported types
397
398     imported CView;
399     ---Category: Imported types
400     
401     imported RenderingParams;
402     ---Purpose: Describes rendering parameters and effects.
403     ---Category: Imported types
404
405     imported CGraduatedTrihedron;
406     ---Category: Imported types
407
408     imported ClipPlane;
409     ---Category: Imported types
410
411     imported ClipPlane_Handle;
412
413     imported CTexture;
414
415     imported CTransPersStruct;
416     imported TransModeFlags;
417     
418     imported MarkerImage;
419     imported MarkerImage_Handle;
420     imported Camera_Handle;
421
422     primitive PtrFrameBuffer;
423     primitive Vec2;
424     primitive Vec3;
425     primitive Vec4;
426     imported  Mat4;
427     imported  Mat4d;
428
429     imported ZLayerSettings;
430
431     --------------------
432     -- Category: Classes
433     --------------------
434
435     deferred class ArrayOfPrimitives;
436
437     class ArrayOfPoints;
438
439     class ArrayOfPolylines;
440
441     class ArrayOfSegments;
442
443     class ArrayOfPolygons;
444
445     class ArrayOfTriangles;
446
447     class ArrayOfTriangleStrips;
448
449     class ArrayOfTriangleFans;
450
451     class ArrayOfQuadrangles;
452
453     class ArrayOfQuadrangleStrips;
454
455     class AspectLine3d;
456     ---Category: Classes
457
458     class AspectFillArea3d;
459     ---Category: Classes
460
461     class AspectMarker3d;
462     ---Category: Classes
463
464     class AspectText3d;
465     ---Category: Classes
466
467     deferred class Group;
468     ---Category: Classes
469
470     class MaterialAspect;
471     ---Category: Classes
472
473     class Structure;
474     ---Category: Classes
475
476     pointer StructurePtr to Structure from Graphic3d;
477
478     deferred class GraphicDriver;
479
480     deferred class StructureManager;
481     ---Category: Classes
482
483     pointer StructureManagerPtr to StructureManager from Graphic3d;
484
485     deferred class DataStructureManager;
486     ---Category: Classes
487
488     class Vector;
489     ---Category: Classes
490
491     imported Vertex;
492     ---Category: Classes
493
494     ---------------------------------
495     -- Category: Instantiated classes
496     ---------------------------------
497
498     imported SequenceOfGroup;
499
500     ---Category: Instantiated classes
501
502     class MapOfStructure instantiates
503             Map from TCollection (Structure from Graphic3d,MapTransientHasher from TColStd);
504
505
506     ---Category: Instantiated classes
507
508     class SequenceOfStructure instantiates
509             Sequence from TCollection
510             (Structure from Graphic3d);
511     ---Category: Instantiated classes
512
513     class HSequenceOfStructure instantiates
514             HSequence from TCollection
515         (Structure from Graphic3d, SequenceOfStructure from Graphic3d);
516     ---Category: Instantiated classes
517
518     class Array1OfVector instantiates
519             Array1 from TCollection (Vector from Graphic3d);
520     ---Category: Instantiated classes
521
522     class Array1OfVertex instantiates
523             Array1 from TCollection (Vertex from Graphic3d);
524     ---Category: Instantiated classes
525
526     class Array2OfVertex instantiates
527             Array2 from TCollection (Vertex from Graphic3d);
528     ---Category: Instantiated classes
529
530     class ListOfShortReal instantiates
531             List from TCollection (ShortReal from Standard);
532     ---Category: Instantiated classes
533
534     --ABD Integration support of system fonts (using FTGL and FreeType)
535     imported NListOfHAsciiString;
536     ---Category: Instantiated classes
537
538     imported ShaderProgram_Handle;
539     ---Category: Instantiated classes
540
541     imported SequenceOfHClipPlane;
542     ---Category: Instantiated classes
543     -- Sequence of handles on clip planes
544
545     deferred  class  TextureRoot  from  Graphic3d;
546     deferred  class  TextureMap   from  Graphic3d;
547     deferred  class  Texture1D    from  Graphic3d;
548     deferred  class  Texture2D    from  Graphic3d;
549
550     class  TextureParams    from  Graphic3d;
551     class  TextureEnv       from  Graphic3d;
552     class  Texture1Dmanual  from  Graphic3d;
553     class  Texture1Dsegment from  Graphic3d;
554     class  Texture2Dmanual  from  Graphic3d;
555     class  Texture2Dplane   from  Graphic3d;
556
557
558     enumeration ExportFormat is
559
560         EF_PostScript,
561         EF_EnhPostScript,
562         EF_TEX,
563         EF_PDF,
564         EF_SVG,
565         EF_PGF,
566         EF_EMF
567
568     end ExportFormat;
569
570
571     enumeration SortType is
572
573         ST_Simple,    -- sorting by depth of center point of primitive(fast)
574         ST_BSP_Tree   -- sorting by BSPTree (slow, but fine result )
575
576         end SortType;
577
578     ----------------------------
579     -- Category: Package methods
580     ----------------------------
581
582     InitGraphicDriver (theDisplayConnection: DisplayConnection_Handle from Aspect)
583        returns GraphicDriver from Graphic3d
584        raises  DriverDefinitionError from Aspect;
585     ---Purpose: Initialize graphic driver and returns Handle to it.
586
587     
588
589 end Graphic3d;