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