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
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.
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.
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.
21 -- Package : Graphic3d
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.
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)
46 -- Objective : Specifications definitives
52 ---Purpose: This package permits the creation of 3d graphic objects
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.
63 ---Keywords: Structure, Group, Primitives, Line, Marker, Text,
64 -- FillAreas, Vertex, Vector, Material, Font, Shading
83 -----------------------
84 -- Category: Exceptions
85 -----------------------
87 exception AspectTextDefinitionError inherits OutOfRange;
88 ---Category: Exceptions
90 exception CycleError inherits DomainError;
91 ---Category: Exceptions
93 exception GroupDefinitionError inherits OutOfRange;
94 ---Category: Exceptions
96 exception InitialisationError inherits OutOfRange;
97 ---Category: Exceptions
99 exception MaterialDefinitionError inherits OutOfRange;
100 ---Category: Exceptions
102 exception PickIdDefinitionError inherits OutOfRange;
103 ---Category: Exceptions
105 exception PlotterDefinitionError inherits OutOfRange;
106 ---Category: The exceptions
108 exception PriorityDefinitionError inherits OutOfRange;
109 ---Category: Exceptions
111 exception StructureDefinitionError inherits OutOfRange;
112 ---Category: Exceptions
114 exception TransformError inherits OutOfRange;
115 ---Category: Exceptions
117 exception VectorError inherits OutOfRange;
118 ---Category: Exceptions
120 -------------------------
121 -- Category: Enumerations
122 -------------------------
124 enumeration NameOfMaterial is
125 NOM_BRASS, -- laiton (PHYSIC)
126 NOM_BRONZE, -- bronze (PHYSIC)
127 NOM_COPPER, -- cuivre (PHYSIC)
128 NOM_GOLD, -- or (PHYSIC)
130 NOM_PEWTER, -- etain (PHYSIC)
132 NOM_PLASTER, -- platre (GENERIC)
133 NOM_PLASTIC, -- plastic (GENERIC)
135 NOM_SILVER, -- argent (PHYSIC)
137 NOM_STEEL, -- acier (PHYSIC)
139 NOM_STONE, -- pierre (PHYSIC)
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)
151 NOM_UserDefined -- owner material
153 ---Purpose: Types of aspect materials.
154 ---Category: Enumerations
156 enumeration TypeOfMaterial is MATERIAL_ASPECT, -- Materiel generique
157 MATERIAL_PHYSIC -- Materiel physique
159 ---Purpose: Types of materials specifies if a material can change color.
160 ---Category: Enumerations
162 enumeration NameOfTexture1D is NOT_1D_ELEVATION,
165 ---Purpose: Types of standard textures.
166 ---Category: Enumerations
169 enumeration NameOfTexture2D is NOT_2D_MATRA,
172 NOT_2D_BLUEWHITE_PAPER,
192 ---Purpose: Types of standard textures.
193 ---Category: Enumerations
196 enumeration NameOfTextureEnv is NOT_ENV_CLOUDS,
205 end NameOfTextureEnv;
206 ---Purpose: Types of standard textures.
207 ---Category: Enumerations
209 enumeration TypeOfTexture is TOT_1D,
212 ---Purpose: Type of the texture file format.
213 ---Category: Enumerations
215 enumeration TypeOfTextureMode is TOTM_OBJECT,
220 ---Purpose: Type of the texture projection.
221 ---Category: Enumerations
223 enumeration TypeOfTextureFilter is TOTF_NEAREST,
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
230 enumeration LevelOfTextureAnisotropy is LOTA_OFF,
234 ---Purpose: Level of anisotropy filter.
235 -- Notice that actual quality depends on hardware capabilities!
236 ---Category: Enumerations
238 enumeration NameOfTexturePlane is NOTP_XY,
242 ---Purpose: Type of the texture projection plane for both S and T texture coordinate.
243 ---Category: Enumerations
245 enumeration TypeOfComposition is TOC_REPLACE,
247 end TypeOfComposition;
248 ---Purpose: To manage the transformation matrices of structures.
249 ---Category: Enumerations
251 enumeration TypeOfConnection is TOC_ANCESTOR,
253 end TypeOfConnection;
254 ---Purpose: To manage the connections between the structures.
255 ---Category: Enumerations
257 enumeration TypeOfPolygon is TOP_UNKNOWN,
262 ---Purpose: The type of polygon in a group in a structure.
263 ---Category: Enumerations
265 enumeration TypeOfPrimitive is TOP_UNDEFINED,
274 ---Purpose: The type of primitive in a group in a structure.
275 ---Category: Enumerations
277 enumeration TypeOfPrimitiveArray is TOPA_UNDEFINED,
285 TOPA_QUADRANGLESTRIPS,
287 end TypeOfPrimitiveArray;
288 ---Purpose: The type of primitive array in a group in a structure.
289 ---Category: Enumerations
291 enumeration TypeOfReflection is TOR_AMBIENT,
295 end TypeOfReflection;
296 ---Purpose: Nature of the reflection of a material.
297 ---Category: Enumerations
299 enumeration TypeOfStructure is TOS_WIREFRAME,
304 ---Purpose: Structural attribute indicating if it can be displayed
305 -- in wireframe, shadow mode, or both.
306 ---Category: Enumerations
308 enumeration TextPath is TP_UP,
313 ---Purpose: Direction in which text is displayed.
314 ---Category: Enumerations
316 enumeration HorizontalTextAlignment is HTA_LEFT,
319 end HorizontalTextAlignment;
320 ---Purpose: Defines the horizontal position of the text
321 -- relative to its anchor.
322 ---Category: Enumerations
324 enumeration VerticalTextAlignment is VTA_BOTTOM,
327 end VerticalTextAlignment;
328 ---Purpose: Defines the vertical position of the text
329 -- relative to its anchor.
330 ---Category: Enumerations
332 enumeration GroupAspect is ASPECT_LINE,
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.
343 ---------------------------
344 -- Category: Imported types
345 ---------------------------
347 imported PrimitiveArray;
350 imported CBitFields20;
351 ---Purpose: Defines the C structure
352 ---Category: Imported types
354 imported CBitFields16;
355 ---Purpose: Defines the C structure
356 ---Category: Imported types
358 imported CBitFields8;
359 ---Purpose: Defines the C structure
360 ---Category: Imported types
362 imported CBitFields4;
363 ---Purpose: Defines the C structure
364 ---Category: Imported types
367 ---Purpose: Defines the C structure <agroup>
368 ---Category: Imported types
371 ---Purpose: Defines the C structure <astructure>
372 ---Category: Imported types
375 ---Purpose: Defines the C structure <alight>
376 ---Category: Imported types
379 ---Purpose: Defines the C structure <apick>
380 ---Category: Imported types
383 ---Purpose: Defines the C structure <aplane>
384 ---Category: Imported types
387 ---Purpose: Defines the C structure <abounds>
388 ---Category: Imported types
391 ---Purpose: Defines the C structure <auserdraw>
392 ---Category: Imported types
395 ---Purpose: Defines the C structure <aview>
396 ---Category: Imported types
398 imported CGraduatedTrihedron;
399 ---Purpose: Defines the C structure of a graduated trihedron.
400 ---Category: Imported types
403 ---Purpose: Describes geometrical and auxiliary properties of clipping
404 -- planes applied on rendering by graphical driver.
405 ---Category: Imported types
407 imported ClipPlane_Handle;
408 ---Purpose: CDL-compatibility handle type definition for
409 -- clip plane objects.
413 imported CTransPersStruct;
414 imported TransModeFlags;
416 imported MarkerImage;
417 imported MarkerImage_Handle;
419 primitive PtrFrameBuffer;
429 ---Purpose: Contains some static functions to strips treatment
431 deferred class ArrayOfPrimitives;
432 ---Purpose: Contains basic methods for array allocation and filling
435 ---Purpose: Contains points array definition
437 class ArrayOfPolylines;
438 ---Purpose: Contains polylines array definition
440 class ArrayOfSegments;
441 ---Purpose: Contains segments array definition
443 class ArrayOfPolygons;
444 ---Purpose: Contains polygons array definition
446 class ArrayOfTriangles;
447 ---Purpose: Contains triangles array definition
449 class ArrayOfTriangleStrips;
450 ---Purpose: Contains triangles strip array definition
452 class ArrayOfTriangleFans;
453 ---Purpose: Contains triangles fan array definition
455 class ArrayOfQuadrangles;
456 ---Purpose: Contains quatrangles array definition
458 class ArrayOfQuadrangleStrips;
459 ---Purpose: Contains quadrangles strip array definition
462 ---Purpose: Grouping line attributes
465 class AspectFillArea3d;
466 ---Purpose: Grouping face attributes
469 class AspectMarker3d;
470 ---Purpose: Grouping marker attributes
474 ---Purpose: Grouping text attributes.
478 ---Purpose: For grouping together primitives in a structure
481 class MaterialAspect;
482 ---Purpose: Aspect attributes of a 3d face.
486 ---Purpose: Graphic object.
489 deferred class GraphicDriver;
490 ---Purpose: Defines a graphic driver for 3d interface
492 deferred class StructureManager;
493 ---Purpose: Visualiser with which the graphic objects are associated.
496 deferred class DataStructureManager;
497 ---Purpose: Visualiser with which the graphic objects are associated.
500 deferred class Plotter;
501 ---Purpose: Defines the minimal plotter.
502 ---Category: The classes
505 ---Purpose: 3d vector
509 ---Purpose: 3d vertex
512 ---------------------
513 -- Category: Pointers
514 ---------------------
516 pointer StructPtr to Structure from Graphic3d;
517 ---Category: Pointers
519 ---------------------------------
520 -- Category: Instantiated classes
521 ---------------------------------
523 class ListOfPArray instantiates
524 List from TCollection (ArrayOfPrimitives from Graphic3d);
525 ---Category: Instantiated classes
527 class SequenceOfAddress instantiates
528 Sequence from TCollection
529 (Address from Standard);
530 ---Category: Instantiated classes
532 class SetOfGroup instantiates
533 Set from TCollection (Group from Graphic3d);
534 ---Category: Instantiated classes
536 class HSetOfGroup instantiates
537 HSet from TCollection
538 (Group from Graphic3d, SetOfGroup);
539 ---Category: Instantiated classes
541 class SequenceOfGroup instantiates
542 Sequence from TCollection (Group from Graphic3d);
544 ---Category: Instantiated classes
546 class HSequenceOfGroup instantiates
547 HSequence from TCollection
548 (Group from Graphic3d, SequenceOfGroup from Graphic3d);
549 ---Category: Instantiated classes
551 class MapOfStructure instantiates
552 Map from TCollection (Structure from Graphic3d,MapTransientHasher from TColStd);
555 ---Category: Instantiated classes
557 class SequenceOfStructure instantiates
558 Sequence from TCollection
559 (Structure from Graphic3d);
560 ---Category: Instantiated classes
562 class HSequenceOfStructure instantiates
563 HSequence from TCollection
564 (Structure from Graphic3d, SequenceOfStructure from Graphic3d);
565 ---Category: Instantiated classes
567 class Array1OfVector instantiates
568 Array1 from TCollection (Vector from Graphic3d);
569 ---Category: Instantiated classes
571 class Array1OfVertex instantiates
572 Array1 from TCollection (Vertex from Graphic3d);
573 ---Category: Instantiated classes
575 class Array2OfVertex instantiates
576 Array2 from TCollection (Vertex from Graphic3d);
577 ---Category: Instantiated classes
579 class ListOfShortReal instantiates
580 List from TCollection (ShortReal from Standard);
581 ---Category: Instantiated classes
583 --ABD Integration support of system fonts (using FTGL and FreeType)
584 imported NListOfHAsciiString;
585 ---Category: Instantiated classes
587 imported ShaderProgram_Handle;
588 ---Category: Instantiated classes
590 imported SetOfHClipPlane;
591 ---Category: Instantiated classes
592 -- Set of handles on clip planes
594 deferred class TextureRoot from Graphic3d;
595 deferred class TextureMap from Graphic3d;
596 deferred class Texture1D from Graphic3d;
597 deferred class Texture2D from Graphic3d;
599 class TextureParams from Graphic3d;
600 class TextureEnv from Graphic3d;
601 class Texture1Dmanual from Graphic3d;
602 class Texture1Dsegment from Graphic3d;
603 class Texture2Dmanual from Graphic3d;
604 class Texture2Dplane from Graphic3d;
607 enumeration ExportFormat is
620 enumeration SortType is
622 ST_Simple, -- sorting by depth of center point of primitive(fast)
623 ST_BSP_Tree -- sorting by BSPTree (slow, but fine result )
627 ----------------------------
628 -- Category: Package methods
629 ----------------------------
631 InitGraphicDriver (theDisplayConnection: DisplayConnection_Handle from Aspect)
632 returns GraphicDriver from Graphic3d
633 raises DriverDefinitionError from Aspect;
634 ---Purpose: Initialize graphic driver and returns Handle to it.