0024752: Visualization - inherit OpenGl_Group from Graphic3d_Group
[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
7fd59977 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,
a577aaab 210 TOTM_MANUAL,
211 TOTM_SPRITE;
7fd59977 212 ---Purpose: Type of the texture projection.
213 ---Category: Enumerations
214
bf75be98 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
7fd59977 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 PrimitiveArray;
692613e5 340 imported BufferType;
7fd59977 341
342 imported CBitFields20;
343 ---Purpose: Defines the C structure
344 ---Category: Imported types
345
346 imported CBitFields16;
347 ---Purpose: Defines the C structure
348 ---Category: Imported types
349
350 imported CBitFields8;
351 ---Purpose: Defines the C structure
352 ---Category: Imported types
353
354 imported CBitFields4;
355 ---Purpose: Defines the C structure
356 ---Category: Imported types
357
b64d84be 358 imported CAspectFillArea;
359 imported CAspectMarker;
360 imported CAspectLine;
361 imported CAspectText;
7fd59977 362
363 imported CStructure;
364 ---Purpose: Defines the C structure <astructure>
365 ---Category: Imported types
366
b64d84be 367 pointer CStructurePtr to CStructure from Graphic3d;
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
b64d84be 477 deferred class Group;
7fd59977 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
b64d84be 489 pointer StructurePtr to Structure from Graphic3d;
490
7fd59977 491 deferred class GraphicDriver;
492 ---Purpose: Defines a graphic driver for 3d interface
493
494 deferred class StructureManager;
495 ---Purpose: Visualiser with which the graphic objects are associated.
496 ---Category: Classes
497
63bcc448 498 pointer StructureManagerPtr to StructureManager from Graphic3d;
499
7fd59977 500 deferred class DataStructureManager;
501 ---Purpose: Visualiser with which the graphic objects are associated.
502 ---Category: Classes
503
504 deferred class Plotter;
505 ---Purpose: Defines the minimal plotter.
506 ---Category: The classes
507
508 class Vector;
509 ---Purpose: 3d vector
510 ---Category: Classes
511
b8ddfc2f 512 imported Vertex;
7fd59977 513 ---Purpose: 3d vertex
514 ---Category: Classes
515
7fd59977 516 ---------------------------------
517 -- Category: Instantiated classes
518 ---------------------------------
519
520 class ListOfPArray instantiates
521 List from TCollection (ArrayOfPrimitives from Graphic3d);
522 ---Category: Instantiated classes
523
524 class SequenceOfAddress instantiates
525 Sequence from TCollection
526 (Address from Standard);
527 ---Category: Instantiated classes
528
b64d84be 529 imported SequenceOfGroup;
7fd59977 530
531 ---Category: Instantiated classes
532
7fd59977 533 class MapOfStructure instantiates
534 Map from TCollection (Structure from Graphic3d,MapTransientHasher from TColStd);
535
536
537 ---Category: Instantiated classes
538
539 class SequenceOfStructure instantiates
540 Sequence from TCollection
541 (Structure from Graphic3d);
542 ---Category: Instantiated classes
543
544 class HSequenceOfStructure instantiates
545 HSequence from TCollection
546 (Structure from Graphic3d, SequenceOfStructure from Graphic3d);
547 ---Category: Instantiated classes
548
549 class Array1OfVector instantiates
550 Array1 from TCollection (Vector from Graphic3d);
551 ---Category: Instantiated classes
552
553 class Array1OfVertex instantiates
554 Array1 from TCollection (Vertex from Graphic3d);
555 ---Category: Instantiated classes
556
557 class Array2OfVertex instantiates
558 Array2 from TCollection (Vertex from Graphic3d);
559 ---Category: Instantiated classes
560
7fd59977 561 class ListOfShortReal instantiates
562 List from TCollection (ShortReal from Standard);
563 ---Category: Instantiated classes
564
565 --ABD Integration support of system fonts (using FTGL and FreeType)
566 imported NListOfHAsciiString;
567 ---Category: Instantiated classes
568
30f0ad28 569 imported ShaderProgram_Handle;
570 ---Category: Instantiated classes
571
51b10cd4 572 imported SequenceOfHClipPlane;
4269bd1b 573 ---Category: Instantiated classes
51b10cd4 574 -- Sequence of handles on clip planes
4269bd1b 575
bf75be98 576 deferred class TextureRoot from Graphic3d;
7fd59977 577 deferred class TextureMap from Graphic3d;
578 deferred class Texture1D from Graphic3d;
579 deferred class Texture2D from Graphic3d;
580
bf75be98 581 class TextureParams from Graphic3d;
7fd59977 582 class TextureEnv from Graphic3d;
583 class Texture1Dmanual from Graphic3d;
584 class Texture1Dsegment from Graphic3d;
585 class Texture2Dmanual from Graphic3d;
586 class Texture2Dplane from Graphic3d;
587
588
589 enumeration ExportFormat is
590
591 EF_PostScript,
592 EF_EnhPostScript,
593 EF_TEX,
594 EF_PDF,
595 EF_SVG,
5cedc27f
K
596 EF_PGF,
597 EF_EMF
7fd59977 598
599 end ExportFormat;
600
601
602 enumeration SortType is
603
604 ST_Simple, -- sorting by depth of center point of primitive(fast)
605 ST_BSP_Tree -- sorting by BSPTree (slow, but fine result )
606
607 end SortType;
608
dc3fe572 609 ----------------------------
610 -- Category: Package methods
611 ----------------------------
612
613 InitGraphicDriver (theDisplayConnection: DisplayConnection_Handle from Aspect)
614 returns GraphicDriver from Graphic3d
615 raises DriverDefinitionError from Aspect;
616 ---Purpose: Initialize graphic driver and returns Handle to it.
617
618
619
7fd59977 620end Graphic3d;