0024704: Visualization - inherit OpenGl_Structure from Graphic3d_CStructure
[occt.git] / src / Graphic3d / Graphic3d.cdl
CommitLineData
b311480e 1-- Created on: 1993-03-31
2-- Created by: NW,JPB,CAL
3-- Copyright (c) 1993-1999 Matra Datavision
973c2be1 4-- Copyright (c) 1999-2014 OPEN CASCADE SAS
7fd59977 5--
973c2be1 6-- This file is part of Open CASCADE Technology software library.
b311480e 7--
d5f74e42 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
973c2be1 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.
b311480e 13--
973c2be1 14-- Alternatively, this file may be used under the terms of Open CASCADE
15-- commercial license or contractual agreement.
b311480e 16
7fd59977 17-- Package : Graphic3d
7fd59977 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
7fd59977 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.
7fd59977 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)
7fd59977 41-- Objective : Specifications definitives
7fd59977 42
43package 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
63uses
64
65 TCollection,
66 TColStd,
b8ddfc2f 67 TColgp,
7fd59977 68 OSD,
69 Quantity,
70 Aspect,
71 MMgt,
7fd59977 72 WNT,
73 Image,
eeaaaefb 74 gp,
75 Font
7fd59977 76is
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 PickIdDefinitionError inherits OutOfRange;
98 ---Category: Exceptions
99
100 exception PlotterDefinitionError inherits OutOfRange;
101 ---Category: The exceptions
102
103 exception PriorityDefinitionError inherits OutOfRange;
104 ---Category: Exceptions
105
106 exception StructureDefinitionError inherits OutOfRange;
107 ---Category: Exceptions
108
109 exception TransformError inherits OutOfRange;
110 ---Category: Exceptions
111
112 exception VectorError inherits OutOfRange;
113 ---Category: Exceptions
114
115 -------------------------
116 -- Category: Enumerations
117 -------------------------
118
119 enumeration NameOfMaterial is
120 NOM_BRASS, -- laiton (PHYSIC)
121 NOM_BRONZE, -- bronze (PHYSIC)
122 NOM_COPPER, -- cuivre (PHYSIC)
123 NOM_GOLD, -- or (PHYSIC)
124
125 NOM_PEWTER, -- etain (PHYSIC)
126
127 NOM_PLASTER, -- platre (GENERIC)
128 NOM_PLASTIC, -- plastic (GENERIC)
129
130 NOM_SILVER, -- argent (PHYSIC)
131
132 NOM_STEEL, -- acier (PHYSIC)
133
134 NOM_STONE, -- pierre (PHYSIC)
135
136 NOM_SHINY_PLASTIC, -- plastique brillant (GENERIC)
137 NOM_SATIN, -- satin (GENERIC)
138 NOM_METALIZED, -- metallise New (GENERIC)
139 NOM_NEON_GNC, -- neon New (GENERIC)
140 NOM_CHROME, -- chrome New (PHYSIC)
141 NOM_ALUMINIUM, -- aluminium New (PHYSIC)
142 NOM_OBSIDIAN, -- obsidian New (PHYSIC)
143 NOM_NEON_PHC, -- neon New (PHYSIC)
144 NOM_JADE, -- jade New (PHYSIC)
145 NOM_DEFAULT,
146 NOM_UserDefined -- owner material
147 end NameOfMaterial;
148 ---Purpose: Types of aspect materials.
149 ---Category: Enumerations
150
151 enumeration TypeOfMaterial is MATERIAL_ASPECT, -- Materiel generique
152 MATERIAL_PHYSIC -- Materiel physique
153 end TypeOfMaterial;
154 ---Purpose: Types of materials specifies if a material can change color.
155 ---Category: Enumerations
156
157 enumeration NameOfTexture1D is NOT_1D_ELEVATION,
158 NOT_1D_UNKNOWN
159 end NameOfTexture1D;
160 ---Purpose: Types of standard textures.
161 ---Category: Enumerations
162
163
164 enumeration NameOfTexture2D is NOT_2D_MATRA,
165 NOT_2D_ALIENSKIN,
166 NOT_2D_BLUE_ROCK,
167 NOT_2D_BLUEWHITE_PAPER,
168 NOT_2D_BRUSHED,
169 NOT_2D_BUBBLES,
170 NOT_2D_BUMP,
171 NOT_2D_CAST,
172 NOT_2D_CHIPBD,
173 NOT_2D_CLOUDS,
174 NOT_2D_FLESH,
175 NOT_2D_FLOOR,
176 NOT_2D_GALVNISD,
177 NOT_2D_GRASS,
178 NOT_2D_ALUMINUM,
179 NOT_2D_ROCK,
180 NOT_2D_KNURL,
181 NOT_2D_MAPLE,
182 NOT_2D_MARBLE,
183 NOT_2D_MOTTLED,
184 NOT_2D_RAIN,
185 NOT_2D_UNKNOWN
186 end NameOfTexture2D;
187 ---Purpose: Types of standard textures.
188 ---Category: Enumerations
189
190
191 enumeration NameOfTextureEnv is NOT_ENV_CLOUDS,
192 NOT_ENV_CV,
193 NOT_ENV_MEDIT,
194 NOT_ENV_PEARL,
195 NOT_ENV_SKY1,
196 NOT_ENV_SKY2,
197 NOT_ENV_LINES,
198 NOT_ENV_ROAD,
199 NOT_ENV_UNKNOWN
200 end NameOfTextureEnv;
201 ---Purpose: Types of standard textures.
202 ---Category: Enumerations
203
204 enumeration TypeOfTexture is TOT_1D,
205 TOT_2D,
206 TOT_2D_MIPMAP;
207 ---Purpose: Type of the texture file format.
208 ---Category: Enumerations
209
210 enumeration TypeOfTextureMode is TOTM_OBJECT,
211 TOTM_SPHERE,
212 TOTM_EYE,
a577aaab 213 TOTM_MANUAL,
214 TOTM_SPRITE;
7fd59977 215 ---Purpose: Type of the texture projection.
216 ---Category: Enumerations
217
bf75be98 218 enumeration TypeOfTextureFilter is TOTF_NEAREST,
219 TOTF_BILINEAR,
220 TOTF_TRILINEAR;
221 ---Purpose: Type of the texture filter.
222 -- Notice that for textures without mipmaps linear interpolation will be used instead of TOTF_BILINEAR and TOTF_TRILINEAR.
223 ---Category: Enumerations
224
225 enumeration LevelOfTextureAnisotropy is LOTA_OFF,
226 LOTA_FAST,
227 LOTA_MIDDLE,
228 LOTA_QUALITY;
229 ---Purpose: Level of anisotropy filter.
230 -- Notice that actual quality depends on hardware capabilities!
231 ---Category: Enumerations
232
7fd59977 233 enumeration NameOfTexturePlane is NOTP_XY,
234 NOTP_YZ,
235 NOTP_ZX,
236 NOTP_UNKNOWN;
237 ---Purpose: Type of the texture projection plane for both S and T texture coordinate.
238 ---Category: Enumerations
239
240 enumeration TypeOfComposition is TOC_REPLACE,
241 TOC_POSTCONCATENATE
242 end TypeOfComposition;
243 ---Purpose: To manage the transformation matrices of structures.
244 ---Category: Enumerations
245
246 enumeration TypeOfConnection is TOC_ANCESTOR,
247 TOC_DESCENDANT
248 end TypeOfConnection;
249 ---Purpose: To manage the connections between the structures.
250 ---Category: Enumerations
251
252 enumeration TypeOfPolygon is TOP_UNKNOWN,
253 TOP_COMPLEX,
254 TOP_CONCAVE,
255 TOP_CONVEX
256 end TypeOfPolygon;
257 ---Purpose: The type of polygon in a group in a structure.
258 ---Category: Enumerations
259
260 enumeration TypeOfPrimitive is TOP_UNDEFINED,
261 TOP_POLYLINE,
262 TOP_POLYGON,
263 TOP_TRIANGLEMESH,
264 TOP_QUADRANGLEMESH,
265 TOP_TEXT,
266 TOP_MARKER,
267 TOP_PARRAY
268 end TypeOfPrimitive;
269 ---Purpose: The type of primitive in a group in a structure.
270 ---Category: Enumerations
271
272 enumeration TypeOfPrimitiveArray is TOPA_UNDEFINED,
273 TOPA_POINTS,
274 TOPA_POLYLINES,
275 TOPA_SEGMENTS,
276 TOPA_POLYGONS,
277 TOPA_TRIANGLES,
278 TOPA_QUADRANGLES,
279 TOPA_TRIANGLESTRIPS,
280 TOPA_QUADRANGLESTRIPS,
281 TOPA_TRIANGLEFANS
282 end TypeOfPrimitiveArray;
283 ---Purpose: The type of primitive array in a group in a structure.
284 ---Category: Enumerations
285
286 enumeration TypeOfReflection is TOR_AMBIENT,
287 TOR_DIFFUSE,
288 TOR_SPECULAR,
289 TOR_EMISSION
290 end TypeOfReflection;
291 ---Purpose: Nature of the reflection of a material.
292 ---Category: Enumerations
293
294 enumeration TypeOfStructure is TOS_WIREFRAME,
295 TOS_SHADING,
296 TOS_COMPUTED,
297 TOS_ALL
298 end TypeOfStructure;
299 ---Purpose: Structural attribute indicating if it can be displayed
300 -- in wireframe, shadow mode, or both.
301 ---Category: Enumerations
302
303 enumeration TextPath is TP_UP,
304 TP_DOWN,
305 TP_LEFT,
306 TP_RIGHT
307 end TextPath;
308 ---Purpose: Direction in which text is displayed.
309 ---Category: Enumerations
310
311 enumeration HorizontalTextAlignment is HTA_LEFT,
312 HTA_CENTER,
313 HTA_RIGHT
314 end HorizontalTextAlignment;
315 ---Purpose: Defines the horizontal position of the text
316 -- relative to its anchor.
317 ---Category: Enumerations
318
319 enumeration VerticalTextAlignment is VTA_BOTTOM,
320 VTA_CENTER,
321 VTA_TOP
322 end VerticalTextAlignment;
323 ---Purpose: Defines the vertical position of the text
324 -- relative to its anchor.
325 ---Category: Enumerations
326
327 enumeration GroupAspect is ASPECT_LINE,
328 ASPECT_TEXT,
329 ASPECT_MARKER,
330 ASPECT_FILL_AREA
331 end GroupAspect;
332 ---Purpose: Identifies primitives aspects defined per group.
333 -- - ASPECT_LINE: aspect for line primitives;
334 -- - ASPECT_TEXT: aspect for text primitives;
335 -- - ASPECT_MARKER: aspect for marker primitives;
336 -- - ASPECT_FILL_AREA: aspect for face primitives.
337
338 ---------------------------
339 -- Category: Imported types
340 ---------------------------
341
342 imported PrimitiveArray;
692613e5 343 imported BufferType;
7fd59977 344
345 imported CBitFields20;
346 ---Purpose: Defines the C structure
347 ---Category: Imported types
348
349 imported CBitFields16;
350 ---Purpose: Defines the C structure
351 ---Category: Imported types
352
353 imported CBitFields8;
354 ---Purpose: Defines the C structure
355 ---Category: Imported types
356
357 imported CBitFields4;
358 ---Purpose: Defines the C structure
359 ---Category: Imported types
360
361 imported CGroup;
362 ---Purpose: Defines the C structure <agroup>
363 ---Category: Imported types
364
365 imported CStructure;
366 ---Purpose: Defines the C structure <astructure>
367 ---Category: Imported types
368
63bcc448 369 imported CStructure_Handle;
370
7fd59977 371 imported CLight;
372 ---Purpose: Defines the C structure <alight>
373 ---Category: Imported types
374
375 imported CPick;
376 ---Purpose: Defines the C structure <apick>
377 ---Category: Imported types
378
379 imported CPlane;
380 ---Purpose: Defines the C structure <aplane>
381 ---Category: Imported types
382
383 imported CBounds;
384 ---Purpose: Defines the C structure <abounds>
385 ---Category: Imported types
386
387 imported CUserDraw;
388 ---Purpose: Defines the C structure <auserdraw>
389 ---Category: Imported types
390
391 imported CView;
392 ---Purpose: Defines the C structure <aview>
393 ---Category: Imported types
394
395 imported CGraduatedTrihedron;
396 ---Purpose: Defines the C structure of a graduated trihedron.
397 ---Category: Imported types
398
4269bd1b 399 imported ClipPlane;
400 ---Purpose: Describes geometrical and auxiliary properties of clipping
401 -- planes applied on rendering by graphical driver.
402 ---Category: Imported types
403
404 imported ClipPlane_Handle;
405 ---Purpose: CDL-compatibility handle type definition for
406 -- clip plane objects.
407
7fd59977 408 imported CTexture;
409
bf75be98 410 imported CTransPersStruct;
411 imported TransModeFlags;
a577aaab 412
413 imported MarkerImage;
414 imported MarkerImage_Handle;
b5ac8292 415 imported Camera_Handle;
7fd59977 416
417 primitive PtrFrameBuffer;
bf75be98 418 primitive Vec2;
419 primitive Vec3;
420 primitive Vec4;
197ac94e 421 imported Mat4;
422 imported Mat4d;
7fd59977 423
424 --------------------
425 -- Category: Classes
426 --------------------
427
428 class Strips;
429 ---Purpose: Contains some static functions to strips treatment
430
431 deferred class ArrayOfPrimitives;
432 ---Purpose: Contains basic methods for array allocation and filling
433
434 class ArrayOfPoints;
435 ---Purpose: Contains points array definition
436
437 class ArrayOfPolylines;
438 ---Purpose: Contains polylines array definition
439
440 class ArrayOfSegments;
441 ---Purpose: Contains segments array definition
442
443 class ArrayOfPolygons;
444 ---Purpose: Contains polygons array definition
445
446 class ArrayOfTriangles;
447 ---Purpose: Contains triangles array definition
448
449 class ArrayOfTriangleStrips;
450 ---Purpose: Contains triangles strip array definition
451
452 class ArrayOfTriangleFans;
453 ---Purpose: Contains triangles fan array definition
454
455 class ArrayOfQuadrangles;
456 ---Purpose: Contains quatrangles array definition
457
458 class ArrayOfQuadrangleStrips;
459 ---Purpose: Contains quadrangles strip array definition
460
461 class AspectLine3d;
462 ---Purpose: Grouping line attributes
463 ---Category: Classes
464
465 class AspectFillArea3d;
466 ---Purpose: Grouping face attributes
467 ---Category: Classes
468
469 class AspectMarker3d;
470 ---Purpose: Grouping marker attributes
471 ---Category: Classes
472
473 class AspectText3d;
474 ---Purpose: Grouping text attributes.
475 ---Category: Classes
476
477 class Group;
478 ---Purpose: For grouping together primitives in a structure
479 ---Category: Classes
480
7fd59977 481 class MaterialAspect;
482 ---Purpose: Aspect attributes of a 3d face.
483 ---Category: Classes
484
485 class Structure;
486 ---Purpose: Graphic object.
487 ---Category: Classes
488
489 deferred class GraphicDriver;
490 ---Purpose: Defines a graphic driver for 3d interface
491
492 deferred class StructureManager;
493 ---Purpose: Visualiser with which the graphic objects are associated.
494 ---Category: Classes
495
63bcc448 496 pointer StructureManagerPtr to StructureManager from Graphic3d;
497
7fd59977 498 deferred class DataStructureManager;
499 ---Purpose: Visualiser with which the graphic objects are associated.
500 ---Category: Classes
501
502 deferred class Plotter;
503 ---Purpose: Defines the minimal plotter.
504 ---Category: The classes
505
506 class Vector;
507 ---Purpose: 3d vector
508 ---Category: Classes
509
b8ddfc2f 510 imported Vertex;
7fd59977 511 ---Purpose: 3d vertex
512 ---Category: Classes
513
7fd59977 514 ---------------------------------
515 -- Category: Instantiated classes
516 ---------------------------------
517
518 class ListOfPArray instantiates
519 List from TCollection (ArrayOfPrimitives from Graphic3d);
520 ---Category: Instantiated classes
521
522 class SequenceOfAddress instantiates
523 Sequence from TCollection
524 (Address from Standard);
525 ---Category: Instantiated classes
526
527 class SetOfGroup instantiates
528 Set from TCollection (Group from Graphic3d);
529 ---Category: Instantiated classes
530
531 class HSetOfGroup instantiates
532 HSet from TCollection
533 (Group from Graphic3d, SetOfGroup);
534 ---Category: Instantiated classes
535
536 class SequenceOfGroup instantiates
537 Sequence from TCollection (Group from Graphic3d);
538
539 ---Category: Instantiated classes
540
541 class HSequenceOfGroup instantiates
542 HSequence from TCollection
543 (Group from Graphic3d, SequenceOfGroup from Graphic3d);
544 ---Category: Instantiated classes
545
546 class MapOfStructure instantiates
547 Map from TCollection (Structure from Graphic3d,MapTransientHasher from TColStd);
548
549
550 ---Category: Instantiated classes
551
552 class SequenceOfStructure instantiates
553 Sequence from TCollection
554 (Structure from Graphic3d);
555 ---Category: Instantiated classes
556
557 class HSequenceOfStructure instantiates
558 HSequence from TCollection
559 (Structure from Graphic3d, SequenceOfStructure from Graphic3d);
560 ---Category: Instantiated classes
561
562 class Array1OfVector instantiates
563 Array1 from TCollection (Vector from Graphic3d);
564 ---Category: Instantiated classes
565
566 class Array1OfVertex instantiates
567 Array1 from TCollection (Vertex from Graphic3d);
568 ---Category: Instantiated classes
569
570 class Array2OfVertex instantiates
571 Array2 from TCollection (Vertex from Graphic3d);
572 ---Category: Instantiated classes
573
7fd59977 574 class ListOfShortReal instantiates
575 List from TCollection (ShortReal from Standard);
576 ---Category: Instantiated classes
577
578 --ABD Integration support of system fonts (using FTGL and FreeType)
579 imported NListOfHAsciiString;
580 ---Category: Instantiated classes
581
30f0ad28 582 imported ShaderProgram_Handle;
583 ---Category: Instantiated classes
584
51b10cd4 585 imported SequenceOfHClipPlane;
4269bd1b 586 ---Category: Instantiated classes
51b10cd4 587 -- Sequence of handles on clip planes
4269bd1b 588
bf75be98 589 deferred class TextureRoot from Graphic3d;
7fd59977 590 deferred class TextureMap from Graphic3d;
591 deferred class Texture1D from Graphic3d;
592 deferred class Texture2D from Graphic3d;
593
bf75be98 594 class TextureParams from Graphic3d;
7fd59977 595 class TextureEnv from Graphic3d;
596 class Texture1Dmanual from Graphic3d;
597 class Texture1Dsegment from Graphic3d;
598 class Texture2Dmanual from Graphic3d;
599 class Texture2Dplane from Graphic3d;
600
601
602 enumeration ExportFormat is
603
604 EF_PostScript,
605 EF_EnhPostScript,
606 EF_TEX,
607 EF_PDF,
608 EF_SVG,
5cedc27f
K
609 EF_PGF,
610 EF_EMF
7fd59977 611
612 end ExportFormat;
613
614
615 enumeration SortType is
616
617 ST_Simple, -- sorting by depth of center point of primitive(fast)
618 ST_BSP_Tree -- sorting by BSPTree (slow, but fine result )
619
620 end SortType;
621
dc3fe572 622 ----------------------------
623 -- Category: Package methods
624 ----------------------------
625
626 InitGraphicDriver (theDisplayConnection: DisplayConnection_Handle from Aspect)
627 returns GraphicDriver from Graphic3d
628 raises DriverDefinitionError from Aspect;
629 ---Purpose: Initialize graphic driver and returns Handle to it.
630
631
632
7fd59977 633end Graphic3d;