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