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