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