0024131: TKOpenGL redesign GPU memory management for markers presentation
[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
4-- Copyright (c) 1999-2012 OPEN CASCADE SAS
7fd59977 5--
b311480e 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
7fd59977 21-- Package : Graphic3d
7fd59977 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.
7fd59977 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)
7fd59977 46-- Objective : Specifications definitives
7fd59977 47
48package 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
68uses
69
70 TCollection,
71 TColStd,
b8ddfc2f 72 TColgp,
7fd59977 73 OSD,
74 Quantity,
75 Aspect,
76 MMgt,
7fd59977 77 WNT,
78 Image,
eeaaaefb 79 gp,
80 Font
7fd59977 81is
82
83 -----------------------
84 -- Category: Exceptions
85 -----------------------
86
87 exception AspectTextDefinitionError inherits OutOfRange;
88 ---Category: Exceptions
89
90 exception CycleError inherits DomainError;
91 ---Category: Exceptions
92
93 exception GroupDefinitionError inherits OutOfRange;
94 ---Category: Exceptions
95
96 exception InitialisationError inherits OutOfRange;
97 ---Category: Exceptions
98
99 exception MaterialDefinitionError inherits OutOfRange;
100 ---Category: Exceptions
101
102 exception PickIdDefinitionError inherits OutOfRange;
103 ---Category: Exceptions
104
105 exception PlotterDefinitionError inherits OutOfRange;
106 ---Category: The exceptions
107
108 exception PriorityDefinitionError inherits OutOfRange;
109 ---Category: Exceptions
110
111 exception StructureDefinitionError inherits OutOfRange;
112 ---Category: Exceptions
113
114 exception TransformError inherits OutOfRange;
115 ---Category: Exceptions
116
117 exception VectorError inherits OutOfRange;
118 ---Category: Exceptions
119
120 -------------------------
121 -- Category: Enumerations
122 -------------------------
123
124 enumeration NameOfMaterial is
125 NOM_BRASS, -- laiton (PHYSIC)
126 NOM_BRONZE, -- bronze (PHYSIC)
127 NOM_COPPER, -- cuivre (PHYSIC)
128 NOM_GOLD, -- or (PHYSIC)
129
130 NOM_PEWTER, -- etain (PHYSIC)
131
132 NOM_PLASTER, -- platre (GENERIC)
133 NOM_PLASTIC, -- plastic (GENERIC)
134
135 NOM_SILVER, -- argent (PHYSIC)
136
137 NOM_STEEL, -- acier (PHYSIC)
138
139 NOM_STONE, -- pierre (PHYSIC)
140
141 NOM_SHINY_PLASTIC, -- plastique brillant (GENERIC)
142 NOM_SATIN, -- satin (GENERIC)
143 NOM_METALIZED, -- metallise New (GENERIC)
144 NOM_NEON_GNC, -- neon New (GENERIC)
145 NOM_CHROME, -- chrome New (PHYSIC)
146 NOM_ALUMINIUM, -- aluminium New (PHYSIC)
147 NOM_OBSIDIAN, -- obsidian New (PHYSIC)
148 NOM_NEON_PHC, -- neon New (PHYSIC)
149 NOM_JADE, -- jade New (PHYSIC)
150 NOM_DEFAULT,
151 NOM_UserDefined -- owner material
152 end NameOfMaterial;
153 ---Purpose: Types of aspect materials.
154 ---Category: Enumerations
155
156 enumeration TypeOfMaterial is MATERIAL_ASPECT, -- Materiel generique
157 MATERIAL_PHYSIC -- Materiel physique
158 end TypeOfMaterial;
159 ---Purpose: Types of materials specifies if a material can change color.
160 ---Category: Enumerations
161
162 enumeration NameOfTexture1D is NOT_1D_ELEVATION,
163 NOT_1D_UNKNOWN
164 end NameOfTexture1D;
165 ---Purpose: Types of standard textures.
166 ---Category: Enumerations
167
168
169 enumeration NameOfTexture2D is NOT_2D_MATRA,
170 NOT_2D_ALIENSKIN,
171 NOT_2D_BLUE_ROCK,
172 NOT_2D_BLUEWHITE_PAPER,
173 NOT_2D_BRUSHED,
174 NOT_2D_BUBBLES,
175 NOT_2D_BUMP,
176 NOT_2D_CAST,
177 NOT_2D_CHIPBD,
178 NOT_2D_CLOUDS,
179 NOT_2D_FLESH,
180 NOT_2D_FLOOR,
181 NOT_2D_GALVNISD,
182 NOT_2D_GRASS,
183 NOT_2D_ALUMINUM,
184 NOT_2D_ROCK,
185 NOT_2D_KNURL,
186 NOT_2D_MAPLE,
187 NOT_2D_MARBLE,
188 NOT_2D_MOTTLED,
189 NOT_2D_RAIN,
190 NOT_2D_UNKNOWN
191 end NameOfTexture2D;
192 ---Purpose: Types of standard textures.
193 ---Category: Enumerations
194
195
196 enumeration NameOfTextureEnv is NOT_ENV_CLOUDS,
197 NOT_ENV_CV,
198 NOT_ENV_MEDIT,
199 NOT_ENV_PEARL,
200 NOT_ENV_SKY1,
201 NOT_ENV_SKY2,
202 NOT_ENV_LINES,
203 NOT_ENV_ROAD,
204 NOT_ENV_UNKNOWN
205 end NameOfTextureEnv;
206 ---Purpose: Types of standard textures.
207 ---Category: Enumerations
208
209 enumeration TypeOfTexture is TOT_1D,
210 TOT_2D,
211 TOT_2D_MIPMAP;
212 ---Purpose: Type of the texture file format.
213 ---Category: Enumerations
214
215 enumeration TypeOfTextureMode is TOTM_OBJECT,
216 TOTM_SPHERE,
217 TOTM_EYE,
a577aaab 218 TOTM_MANUAL,
219 TOTM_SPRITE;
7fd59977 220 ---Purpose: Type of the texture projection.
221 ---Category: Enumerations
222
bf75be98 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
7fd59977 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;
692613e5 348 imported BufferType;
7fd59977 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
7fd59977 402 imported CTexture;
403
bf75be98 404 imported CTransPersStruct;
405 imported TransModeFlags;
a577aaab 406
407 imported MarkerImage;
408 imported MarkerImage_Handle;
7fd59977 409
410 primitive PtrFrameBuffer;
bf75be98 411 primitive Vec2;
412 primitive Vec3;
413 primitive Vec4;
7fd59977 414
415 --------------------
416 -- Category: Classes
417 --------------------
418
419 class Strips;
420 ---Purpose: Contains some static functions to strips treatment
421
422 deferred class ArrayOfPrimitives;
423 ---Purpose: Contains basic methods for array allocation and filling
424
425 class ArrayOfPoints;
426 ---Purpose: Contains points array definition
427
428 class ArrayOfPolylines;
429 ---Purpose: Contains polylines array definition
430
431 class ArrayOfSegments;
432 ---Purpose: Contains segments array definition
433
434 class ArrayOfPolygons;
435 ---Purpose: Contains polygons array definition
436
437 class ArrayOfTriangles;
438 ---Purpose: Contains triangles array definition
439
440 class ArrayOfTriangleStrips;
441 ---Purpose: Contains triangles strip array definition
442
443 class ArrayOfTriangleFans;
444 ---Purpose: Contains triangles fan array definition
445
446 class ArrayOfQuadrangles;
447 ---Purpose: Contains quatrangles array definition
448
449 class ArrayOfQuadrangleStrips;
450 ---Purpose: Contains quadrangles strip array definition
451
452 class AspectLine3d;
453 ---Purpose: Grouping line attributes
454 ---Category: Classes
455
456 class AspectFillArea3d;
457 ---Purpose: Grouping face attributes
458 ---Category: Classes
459
460 class AspectMarker3d;
461 ---Purpose: Grouping marker attributes
462 ---Category: Classes
463
464 class AspectText3d;
465 ---Purpose: Grouping text attributes.
466 ---Category: Classes
467
468 class Group;
469 ---Purpose: For grouping together primitives in a structure
470 ---Category: Classes
471
7fd59977 472 class MaterialAspect;
473 ---Purpose: Aspect attributes of a 3d face.
474 ---Category: Classes
475
476 class Structure;
477 ---Purpose: Graphic object.
478 ---Category: Classes
479
480 deferred class GraphicDriver;
481 ---Purpose: Defines a graphic driver for 3d interface
482
483 deferred class StructureManager;
484 ---Purpose: Visualiser with which the graphic objects are associated.
485 ---Category: Classes
486
487 deferred class DataStructureManager;
488 ---Purpose: Visualiser with which the graphic objects are associated.
489 ---Category: Classes
490
491 deferred class Plotter;
492 ---Purpose: Defines the minimal plotter.
493 ---Category: The classes
494
495 class Vector;
496 ---Purpose: 3d vector
497 ---Category: Classes
498
b8ddfc2f 499 imported Vertex;
7fd59977 500 ---Purpose: 3d vertex
501 ---Category: Classes
502
7fd59977 503 ---------------------
504 -- Category: Pointers
505 ---------------------
506
507 pointer StructPtr to Structure from Graphic3d;
508 ---Category: Pointers
509
510 ---------------------------------
511 -- Category: Instantiated classes
512 ---------------------------------
513
514 class ListOfPArray instantiates
515 List from TCollection (ArrayOfPrimitives from Graphic3d);
516 ---Category: Instantiated classes
517
518 class SequenceOfAddress instantiates
519 Sequence from TCollection
520 (Address from Standard);
521 ---Category: Instantiated classes
522
523 class SetOfGroup instantiates
524 Set from TCollection (Group from Graphic3d);
525 ---Category: Instantiated classes
526
527 class HSetOfGroup instantiates
528 HSet from TCollection
529 (Group from Graphic3d, SetOfGroup);
530 ---Category: Instantiated classes
531
532 class SequenceOfGroup instantiates
533 Sequence from TCollection (Group from Graphic3d);
534
535 ---Category: Instantiated classes
536
537 class HSequenceOfGroup instantiates
538 HSequence from TCollection
539 (Group from Graphic3d, SequenceOfGroup from Graphic3d);
540 ---Category: Instantiated classes
541
542 class MapOfStructure instantiates
543 Map from TCollection (Structure from Graphic3d,MapTransientHasher from TColStd);
544
545
546 ---Category: Instantiated classes
547
548 class SequenceOfStructure instantiates
549 Sequence from TCollection
550 (Structure from Graphic3d);
551 ---Category: Instantiated classes
552
553 class HSequenceOfStructure instantiates
554 HSequence from TCollection
555 (Structure from Graphic3d, SequenceOfStructure from Graphic3d);
556 ---Category: Instantiated classes
557
558 class Array1OfVector instantiates
559 Array1 from TCollection (Vector from Graphic3d);
560 ---Category: Instantiated classes
561
562 class Array1OfVertex instantiates
563 Array1 from TCollection (Vertex from Graphic3d);
564 ---Category: Instantiated classes
565
566 class Array2OfVertex instantiates
567 Array2 from TCollection (Vertex from Graphic3d);
568 ---Category: Instantiated classes
569
7fd59977 570 class ListOfShortReal instantiates
571 List from TCollection (ShortReal from Standard);
572 ---Category: Instantiated classes
573
574 --ABD Integration support of system fonts (using FTGL and FreeType)
575 imported NListOfHAsciiString;
576 ---Category: Instantiated classes
577
bf75be98 578 deferred class TextureRoot from Graphic3d;
7fd59977 579 deferred class TextureMap from Graphic3d;
580 deferred class Texture1D from Graphic3d;
581 deferred class Texture2D from Graphic3d;
582
bf75be98 583 class TextureParams from Graphic3d;
7fd59977 584 class TextureEnv from Graphic3d;
585 class Texture1Dmanual from Graphic3d;
586 class Texture1Dsegment from Graphic3d;
587 class Texture2Dmanual from Graphic3d;
588 class Texture2Dplane from Graphic3d;
589
590
591 enumeration ExportFormat is
592
593 EF_PostScript,
594 EF_EnhPostScript,
595 EF_TEX,
596 EF_PDF,
597 EF_SVG,
5cedc27f
K
598 EF_PGF,
599 EF_EMF
7fd59977 600
601 end ExportFormat;
602
603
604 enumeration SortType is
605
606 ST_Simple, -- sorting by depth of center point of primitive(fast)
607 ST_BSP_Tree -- sorting by BSPTree (slow, but fine result )
608
609 end SortType;
610
dc3fe572 611 ----------------------------
612 -- Category: Package methods
613 ----------------------------
614
615 InitGraphicDriver (theDisplayConnection: DisplayConnection_Handle from Aspect)
616 returns GraphicDriver from Graphic3d
617 raises DriverDefinitionError from Aspect;
618 ---Purpose: Initialize graphic driver and returns Handle to it.
619
620
621
7fd59977 622end Graphic3d;