0024394: Visualization - implement more general way for rendering of immediate objects
[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,
ed063270 75 Font,
76 Bnd
7fd59977 77is
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
7fd59977 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)
44c7c33e 116 NOM_BRONZE, -- bronze (PHYSIC)
117 NOM_COPPER, -- cuivre (PHYSIC)
118 NOM_GOLD, -- or (PHYSIC)
7fd59977 119
44c7c33e 120 NOM_PEWTER, -- etain (PHYSIC)
7fd59977 121
44c7c33e 122 NOM_PLASTER, -- platre (GENERIC)
123 NOM_PLASTIC, -- plastic (GENERIC)
7fd59977 124
44c7c33e 125 NOM_SILVER, -- argent (PHYSIC)
7fd59977 126
44c7c33e 127 NOM_STEEL, -- acier (PHYSIC)
7fd59977 128
44c7c33e 129 NOM_STONE, -- pierre (PHYSIC)
7fd59977 130
44c7c33e 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
7fd59977 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,
a577aaab 215 TOTM_MANUAL,
216 TOTM_SPRITE;
7fd59977 217 ---Purpose: Type of the texture projection.
218 ---Category: Enumerations
219
bf75be98 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
7fd59977 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
bc8c79bb 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
7fd59977 347 ---------------------------
348 -- Category: Imported types
349 ---------------------------
350
b7cd4ba7 351 imported BndBox4f;
352 ---Purpose: Redefines BVH_Box<Standard_ShortReal, 4> for AABB representation
353 ---Category: Imported types
871fa103 354 imported Buffer;
355 imported Buffer_Handle;
356 imported BoundBuffer;
357 imported BoundBuffer_Handle;
358 imported IndexBuffer;
359 imported IndexBuffer_Handle;
360
b7cd4ba7 361 imported BndBox4d;
692613e5 362 imported BufferType;
7fd59977 363
364 imported CBitFields20;
7fd59977 365 ---Category: Imported types
366
367 imported CBitFields16;
7fd59977 368 ---Category: Imported types
369
370 imported CBitFields8;
7fd59977 371 ---Category: Imported types
372
373 imported CBitFields4;
7fd59977 374 ---Category: Imported types
375
b64d84be 376 imported CAspectFillArea;
377 imported CAspectMarker;
378 imported CAspectLine;
379 imported CAspectText;
7fd59977 380
381 imported CStructure;
7fd59977 382 ---Category: Imported types
383
b64d84be 384 pointer CStructurePtr to CStructure from Graphic3d;
385
63bcc448 386 imported CStructure_Handle;
387
7fd59977 388 imported CLight;
7fd59977 389 ---Category: Imported types
390
7fd59977 391 imported CPlane;
7fd59977 392 ---Category: Imported types
393
7fd59977 394 imported CUserDraw;
7fd59977 395 ---Category: Imported types
396
397 imported CView;
7fd59977 398 ---Category: Imported types
bc8c79bb 399
400 imported RenderingParams;
401 ---Purpose: Describes rendering parameters and effects.
402 ---Category: Imported types
7fd59977 403
404 imported CGraduatedTrihedron;
7fd59977 405 ---Category: Imported types
406
4269bd1b 407 imported ClipPlane;
4269bd1b 408 ---Category: Imported types
409
410 imported ClipPlane_Handle;
4269bd1b 411
7fd59977 412 imported CTexture;
413
bf75be98 414 imported CTransPersStruct;
415 imported TransModeFlags;
a577aaab 416
417 imported MarkerImage;
418 imported MarkerImage_Handle;
b5ac8292 419 imported Camera_Handle;
7fd59977 420
421 primitive PtrFrameBuffer;
bf75be98 422 primitive Vec2;
423 primitive Vec3;
424 primitive Vec4;
197ac94e 425 imported Mat4;
426 imported Mat4d;
7fd59977 427
a1954302 428 imported ZLayerSettings;
429 primitive ZLayerId;
c5751993 430
7fd59977 431 --------------------
432 -- Category: Classes
433 --------------------
434
7fd59977 435 deferred class ArrayOfPrimitives;
7fd59977 436
437 class ArrayOfPoints;
7fd59977 438
439 class ArrayOfPolylines;
7fd59977 440
441 class ArrayOfSegments;
7fd59977 442
443 class ArrayOfPolygons;
7fd59977 444
445 class ArrayOfTriangles;
7fd59977 446
447 class ArrayOfTriangleStrips;
7fd59977 448
449 class ArrayOfTriangleFans;
7fd59977 450
451 class ArrayOfQuadrangles;
7fd59977 452
453 class ArrayOfQuadrangleStrips;
7fd59977 454
455 class AspectLine3d;
7fd59977 456 ---Category: Classes
457
458 class AspectFillArea3d;
7fd59977 459 ---Category: Classes
460
461 class AspectMarker3d;
7fd59977 462 ---Category: Classes
463
464 class AspectText3d;
7fd59977 465 ---Category: Classes
466
b64d84be 467 deferred class Group;
7fd59977 468 ---Category: Classes
469
7fd59977 470 class MaterialAspect;
7fd59977 471 ---Category: Classes
472
473 class Structure;
7fd59977 474 ---Category: Classes
475
b64d84be 476 pointer StructurePtr to Structure from Graphic3d;
477
7fd59977 478 deferred class GraphicDriver;
7fd59977 479
480 deferred class StructureManager;
7fd59977 481 ---Category: Classes
482
63bcc448 483 pointer StructureManagerPtr to StructureManager from Graphic3d;
484
7fd59977 485 deferred class DataStructureManager;
7fd59977 486 ---Category: Classes
487
7fd59977 488 class Vector;
7fd59977 489 ---Category: Classes
490
b8ddfc2f 491 imported Vertex;
7fd59977 492 ---Category: Classes
493
a1954302 494 imported MapOfStructure;
495 imported SequenceOfDisplayedStructures;
496
7fd59977 497 ---------------------------------
498 -- Category: Instantiated classes
499 ---------------------------------
500
b64d84be 501 imported SequenceOfGroup;
7fd59977 502
7fd59977 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
7fd59977 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
30f0ad28 533 imported ShaderProgram_Handle;
534 ---Category: Instantiated classes
535
51b10cd4 536 imported SequenceOfHClipPlane;
4269bd1b 537 ---Category: Instantiated classes
51b10cd4 538 -- Sequence of handles on clip planes
4269bd1b 539
bf75be98 540 deferred class TextureRoot from Graphic3d;
7fd59977 541 deferred class TextureMap from Graphic3d;
542 deferred class Texture1D from Graphic3d;
543 deferred class Texture2D from Graphic3d;
544
bf75be98 545 class TextureParams from Graphic3d;
7fd59977 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,
5cedc27f
K
560 EF_PGF,
561 EF_EMF
7fd59977 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
573end Graphic3d;