1 -- Created by: NW,JPB,CAL
2 -- Copyright (c) 1991-1999 Matra Datavision
3 -- Copyright (c) 1999-2014 OPEN CASCADE SAS
5 -- This file is part of Open CASCADE Technology software library.
7 -- This library is free software; you can redistribute it and/or modify it under
8 -- the terms of the GNU Lesser General Public License version 2.1 as published
9 -- by the Free Software Foundation, with special exception defined in the file
10 -- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11 -- distribution for complete text of the license and disclaimer of any warranty.
13 -- Alternatively, this file may be used under the terms of Open CASCADE
14 -- commercial license or contractual agreement.
17 -- Updated: Vendredi 2 Octobre 1992
18 -- Mercredi 31 mars 1993
19 -- Lundi 16 janvier 1995
20 -- Reason : Traitement des Markers (G400)
21 -- Purpose: Specifications definitives
22 -- Modified: 15/01/98 ; FMN : Ajout Hidden Line
23 -- Modified: 24/08/98 ; CAL : S3892. Ajout grilles 3d.
24 -- Modified: 16-09-98 by BGN (S3989)
25 --- Adding TypeOfTriedronEcho, TypeOfTriedronPosition.
26 -- Modified: 30-11-98 ; FMN : S4069. Textes always visible.
27 -- Modified: 17-NOV-99 : GG GER61351
28 -- Add TypeOfFacingModel enum
29 -- Modified: 20-JAN-00 : GG
30 -- Add GDM_None in enum GridDrawMode.
31 -- Modified: 25-JAN-00 : VKH
33 -- Modified: 23-FEB-00 : GG
34 -- Returns format name in ValuesOfFOSP() internal method.
35 -- Modified: 27-03-02 RIC120302 GG Add imported class
36 -- Display, Drawable, RenderingContext, GraphicCallbackProc
37 -- Modified: 22-03-04 OCC4895 SAN High-level interface for controlling polygon offsets
38 -- Modified: 21-06-04 STV Added Aspect_ColorScale class
40 ------------------------------------------------------------------------
46 ---Purpose: This package contains the group of graphic elements common
47 -- to different types of visualisers. It allows the description
48 -- of a screen background, a window, an edge, and groups of
49 -- graphic attributes that can be used in describing 2D
52 ---Keywords: Window, Aspect, FillArea, Line, Marker, Edge
53 -- Highlight, Hatch, Background, GradientBackground, Color map,
54 -- Type map, Width map, Font map
68 ---------------------------
69 -- Category: Imported types
70 ---------------------------
72 -- waiting for RBA creating this class in Standard ...
79 ---Category: Imported types
89 primitive RenderingContext;
91 imported GraphicCallbackProc;
93 -- 22-03-04 OCC4895 SAN High-level interface for controlling polygon offsets
94 imported PolygonOffsetMode;
100 pointer DriverPtr to Driver from Aspect;
101 pointer WindowDriverPtr to WindowDriver from Aspect;
103 ---Category: Pointers
105 -----------------------
106 -- Category: Exceptions
107 -----------------------
109 exception AspectLineDefinitionError inherits OutOfRange;
110 ---Category: Exceptions
112 exception AspectFillAreaDefinitionError inherits OutOfRange;
113 ---Category: Exceptions
115 exception AspectMarkerDefinitionError inherits OutOfRange;
116 ---Category: Exceptions
118 exception BadAccess inherits DomainError;
119 ---Category: Exceptions
121 exception ColorMapDefinitionError inherits OutOfRange;
122 ---Category: The exceptions
124 exception EdgeDefinitionError inherits OutOfRange;
125 ---Category: Exceptions
127 exception IdentDefinitionError inherits OutOfRange;
128 ---Category: Exceptions
130 exception TypeMapDefinitionError inherits OutOfRange;
131 ---Category: The exceptions
133 exception WidthMapDefinitionError inherits OutOfRange;
134 ---Category: The exceptions
136 exception FontMapDefinitionError inherits OutOfRange;
137 ---Category: The exceptions
139 exception MarkMapDefinitionError inherits OutOfRange;
140 ---Category: The exceptions
142 exception WindowDefinitionError inherits OutOfRange;
143 ---Category: The exceptions
145 exception WindowError inherits OutOfRange;
146 ---Category: The exceptions
148 exception PixmapDefinitionError inherits OutOfRange;
149 ---Category: The exceptions
151 exception PixmapError inherits OutOfRange;
152 ---Category: The exceptions
154 exception DriverDefinitionError inherits OutOfRange;
155 ---Category: The exceptions
157 exception DriverError inherits OutOfRange;
158 ---Category: The exceptions
160 exception GraphicDeviceDefinitionError inherits OutOfRange;
161 ---Category: The exceptions
163 exception DisplayConnectionDefinitionError inherits OutOfRange;
164 ---Category: The exceptions
166 exception LineStyleDefinitionError inherits OutOfRange;
167 ---Category: Exceptions
169 exception LineWidthDefinitionError inherits OutOfRange;
170 ---Category: Exceptions
172 exception PolyStyleDefinitionError inherits OutOfRange;
173 ---Category: Exceptions
175 exception FontStyleDefinitionError inherits OutOfRange;
176 ---Category: Exceptions
178 exception MarkerStyleDefinitionError inherits OutOfRange;
179 ---Category: Exceptions
181 exception UndefinedMap inherits OutOfRange;
182 ---Category: Exceptions
184 ------------------------------
185 -- Category: Classes Color map
186 ------------------------------
188 deferred class ColorMap;
189 ---Category: Classes Color map
191 class ColorCubeColorMap;
192 ---Category: Classes Color map
194 class ColorRampColorMap;
195 ---Category: Classes Color map
197 class GenericColorMap;
198 ---Category: Classes Color map
201 ---Category: Classes Color map
203 ------------------------------
204 -- Category: Classes Pixel
205 ------------------------------
207 deferred class Pixel;
208 ---Category: Classes Pixel
211 ---Category: Classes Pixel
214 ---Category: Classes Pixel
216 ---------------------------
217 -- Category: Classes Aspect
218 ---------------------------
220 deferred class AspectLine;
221 ---Category: Classes Aspect
223 deferred class AspectMarker;
224 ---Category: Classes Aspect
226 deferred class AspectFillArea;
227 ---Category: Classes Aspect
236 class GradientBackground;
246 ---Category: The classes
249 ---Category: Classes Font map
252 ---Category: The classes
255 ---Category: Classes Width map
258 ---Category: The classes
261 ---Category: The classes
264 ---Category: The classes
267 ---Category: Classes Type map
270 ---Category: The classes
273 ---Category: The classes
276 ---Category: Classes Mark map
278 deferred class Window;
281 deferred class Driver;
284 deferred class WindowDriver;
288 class RectangularGrid;
291 deferred class ColorScale;
293 imported DisplayConnection;
295 imported DisplayConnection_Handle;
297 -------------------------
298 -- Category: Enumerations
299 -------------------------
301 enumeration HatchStyle is HS_HORIZONTAL,
308 HS_DIAGONAL_135_WIDE,
312 HS_GRID_DIAGONAL_WIDE
314 ---Purpose: Definition of all available hatch styles.
317 -- HS_HORIZONTAL_WIDE
321 -- HS_DIAGONAL_45_WIDE
323 -- HS_DIAGONAL_135_WIDE
327 -- HS_GRID_DIAGONAL_WIDE
329 ---Category: Enumerations
331 enumeration InteriorStyle is IS_EMPTY,
338 ---Purpose: Definition of interior types for primitive
341 -- IS_EMPTY no interior.
342 -- IS_HOLLOW display the boundaries of the surface.
343 -- IS_HATCH display hatched with a hatch style.
344 -- IS_SOLID display the interior entirely filled.
345 -- IS_HIDDENLINE display in hidden lines removed.
346 -- IS_POINT display only vertices.
348 ---Category: Enumerations
350 enumeration TypeOfColorMap is TOC_Generic,
354 ---Purpose: Definition of the color map types
356 ---Category: Enumerations
358 enumeration TypeOfConstraint is TOC_BOTTOM_LEFT,
362 end TypeOfConstraint;
363 ---Purpose: Definition of the attachment for the layers
365 ---Category: Enumerations
367 enumeration TypeOfDrawMode is TODM_REPLACE,
372 ---Purpose: Definition of the draw modes
374 ---Category: Enumerations
376 enumeration TypeOfEdge is TOE_VISIBLE,
379 ---Purpose: Definition of edge visibility
381 -- TOE_VISIBLE Edge is displayed
382 -- TOE_INVISIBLE Edge is not displayed
384 ---Category: Enumerations
386 enumeration TypeOfHighlightMethod is TOHM_COLOR,
388 end TypeOfHighlightMethod;
389 ---Purpose: Definition of a highlight method
391 -- TOHM_COLOR drawn in the highlight color
393 -- TOHM_BOUNDBOX enclosed by the boundary box
396 ---Category: Enumerations
398 enumeration TypeOfLine is TOL_SOLID,
404 ---Purpose: Definition of line types
406 -- TOL_SOLID continuous
407 -- TOL_DASH dashed 2.0,1.0 (MM)
408 -- TOL_DOT dotted 0.2,0.5 (MM)
409 -- TOL_DOTDASH mixed 10.0,1.0,2.0,1.0 (MM)
410 -- TOL_USERDEFINED defined by Users
411 ---Category: Enumerations
413 enumeration WidthOfLine is WOL_THIN,
419 ---Purpose: Definition of line types
421 -- WOL_THIN thin line (1 pixel width)
422 -- WOL_MEDIUM medium width of 0.5 MM
423 -- WOL_THICK thick width of 0.7 MM
424 -- WOL_VERYTHICK very thick width of 1.5 MM
425 -- WOL_USERDEFINED defined by Users
426 ---Category: Enumerations
428 enumeration TypeOfFont is TOF_DEFAULT,
434 ---Purpose: Definition of line types
436 -- TOF_DEFAULT Default system font
439 -- TOF_USERDEFINED defined by Users
440 ---Category: Enumerations
442 enumeration TypeOfText is TOT_SOLID,
445 ---Purpose: Definition of Text types
447 -- TOF_SOLID Default text
449 ---Category: Enumerations
451 enumeration TypeOfStyleText is TOST_NORMAL,
454 ---Purpose: Define the style of the text.
456 -- TOST_NORMAL Default text. The text is displayed like any other graphic object.
457 -- This text can be hidden by another object that is nearest from the
459 -- TOST_ANNOTATION The text is always visible. The texte is displayed
460 -- over the other object according to the priority.
461 ---Category: Enumerations
463 enumeration TypeOfDisplayText is TODT_NORMAL,
468 end TypeOfDisplayText;
469 ---Purpose: Define the display type of the text.
471 -- TODT_NORMAL Default display. Text only.
472 -- TODT_SUBTITLE There is a subtitle under the text.
473 -- TODT_DEKALE The text is displayed with a 3D style.
474 -- TODT_BLEND The text is displayed in XOR.
475 -- TODT_DIMENSION Dimension line under text will be invisible.
476 ---Category: Enumerations
478 enumeration TypeOfMarker is TOM_POINT,
493 ---Purpose: Definition of types of markers
500 -- TOM_O_POINT a point in a circle
501 -- TOM_O_PLUS a plus in a circle
502 -- TOM_O_STAR a star in a circle
503 -- TOM_O_X a cross in a circle
504 -- TOM_RING1 a large ring
505 -- TOM_RING2 a medium ring
506 -- TOM_RING3 a small ring
507 -- TOM_BALL a ball with 1 color and different saturations
508 -- TOM_USERDEFINED defined by Users
510 ---Category: Enumerations
512 enumeration TypeOfUpdate is TOU_ASAP,
515 ---Purpose: Definition of screen refresh mode
517 -- TOU_ASAP as soon as possible
518 -- TOU_WAIT on demand (Update)
520 ---Category: Enumerations
522 enumeration TypeOfDeflection is TOD_RELATIVE,
524 end TypeOfDeflection;
525 ---Purpose: Defines if the maximal chordial deflection used when
526 -- drawing an object is absolute or relative to the size
529 enumeration TypeOfResize is TOR_UNKNOWN,
535 TOR_TOP_AND_RIGHT_BORDER,
536 TOR_RIGHT_AND_BOTTOM_BORDER,
537 TOR_BOTTOM_AND_LEFT_BORDER,
538 TOR_LEFT_AND_TOP_BORDER
540 ---Purpose: Defines the type of Resize Window method applied
543 enumeration CardinalPoints is CP_North,
554 enumeration TypeOfRenderingMode is TORM_IMMEDIAT,
556 TORM_CLEAR_AND_RETAIN
557 end TypeOfRenderingMode;
558 ---Purpose: Definition of the rendering modes
560 enumeration TypeOfColorSpace is TOCS_BlackAndWhite,
563 end TypeOfColorSpace;
566 enumeration FormatOfSheetPaper is
567 FOSP_A0, -- 0.841 x 1.189 (M)
568 FOSP_A1, -- 0.594 x 0.841 (M)
569 FOSP_A2, -- 0.420 x 0.594 (M)
570 FOSP_A3, -- 0.297 x 0.420 (M)
571 FOSP_A4, -- 0.210 x 0.297 (M)
572 FOSP_A5, -- 0.1485 x 0.210 (M)
573 FOSP_K_LONG, -- 1.016 x 3.6322 (M)
574 FOSP_K_SHORT, -- 1.016 x 1.397 (M)
575 FOSP_J_LONG, -- 0.8636 x 4.4704 (M)
576 FOSP_J_SHORT, -- 0.8636 x 1.397 (M)
577 FOSP_H_LONG, -- 0.7112 x 3.6322 (M)
578 FOSP_H_SHORT, -- 0.7112 x 1.1176 (M)
579 FOSP_G_LONG, -- 0.2794 x 2.286 (M)
580 FOSP_G_SHORT, -- 0.2794 x 0.5715 (M)
581 FOSP_F, -- 0.7112 x 1.016 (M)
582 FOSP_E, -- 0.8636 x 1.1176 (M)
583 FOSP_D, -- 0.5588 x 0.8636 (M)
584 FOSP_C, -- 0.4318 x 0.5588 (M)
585 FOSP_B, -- 0.2794 x 0.4318 (M)
586 FOSP_A, -- 0.2159 x 0.2794 (M)
587 FOSP_UNKNOWN -- User defined
588 end FormatOfSheetPaper;
591 enumeration TypeOfPrimitive is
603 enumeration GridDrawMode is GDM_Lines,
607 ---Purpose: Defines the grid draw mode. The grid may be drawn
608 -- by using lines or points.
610 enumeration GridType is GT_Rectangular,
613 ---Purpose: Defines the grid type : Rectangular or Circular.
615 enumeration TypeOfTriedronEcho is TOTE_NONE,
633 end TypeOfTriedronEcho;
634 ---Purpose: Definition of the Triedron echo zone to highlight
636 -- TOTE_NONE no echo zone
637 -- TOTE_ORIGIN a box on origin of the Triedron
638 -- TOTE_AXIS_X highlights the X axis
639 -- TOTE_AXIS_Y highlights the Y axis
640 -- TOTE_AXIS_Z highlights the Z axis
641 -- TOTE_TEXT_X highlights the X character
642 -- TOTE_TEXT_Y highlights the Y character
643 -- TOTE_TEXT_Z highlights the Z character
644 -- TOTE_01 to TOTE_10 not yet implemented.
645 ---Category: The enumerations
648 enumeration TypeOfTriedronPosition is TOTP_CENTER,
663 end TypeOfTriedronPosition;
664 ---Purpose: Definition of the Triedron position in the views
666 -- TOTP_CENTER at the center of the view
667 -- TOTP_LEFT_LOWER at the left lower corner
668 -- TOTP_LEFT_UPPER at the left upper corner
669 -- TOTP_RIGHT_LOWER at the right lower corner
670 -- TOTP_RIGHT_UPPER at the right upper corner
671 -- TOTP_01 to TOTP_10 not yet implemented.
672 ---Category: The enumerations
674 enumeration TypeOfLayer is TOL_OVERLAY,
677 ---Purpose: Modes of drawing for the objects in a layer
679 -- TOL_OVERLAY, the graphic of the layer is draw
680 -- after the 3d graphic.
681 -- TOL_UNDERLAY, the graphic of the layer is draw
682 -- before the 3d graphic.
683 ---Category: The enumerations
685 enumeration TypeOfFacingModel is TOFM_BOTH_SIDE,
688 end TypeOfFacingModel;
690 enumeration FillMethod is
696 ---Purpose: Defines the fill methods to
697 -- write bitmaps in a window.
699 enumeration GradientFillMethod is
709 end GradientFillMethod;
710 ---Purpose: Defines the fill methods to
711 -- write gradient background in a window.
713 enumeration TypeOfColorScaleData is
716 end TypeOfColorScaleData;
717 ---Purpose: Defines the using type of colors and labels
719 enumeration TypeOfColorScalePosition is
724 end TypeOfColorScalePosition;
725 ---Purpose: Defines the type of position for color scale labels
727 enumeration TypeOfColorScaleOrientation is
732 end TypeOfColorScaleOrientation;
733 ---Purpose: Defines the type of color scale orientation
735 enumeration PrintAlgo is
739 ---Purpose: Defines print algorithm
741 -- 1) PA_STRETCH - Stretch offscreen printing frame
742 -- if its dimensions are smaller than
743 -- the printer's printing area dimensions;
744 -- This algorithm is more reliable as it
745 -- works on any hardware and is recommended
746 -- to be used with average printing resolutions,
747 -- as it more RAM memory dependent than PA_TILE;
748 -- Stretching is performend using bicubic interpolation
749 -- algorithm from FreeImage library if OCCT is built
750 -- with FreeImage support, otherwise Windows API
751 -- StretchBlt() function in STRETCH_HALFTONE mode
753 -- 2) PA_TILE - If the offscreen printing frame dimensions
754 -- are smaller than the printer's printing
755 -- area dimensions - use multiple printing
756 -- frames to cover the whole printing area
760 ---Purpose: Defines custom identifiers(atoms) for X window custom named properties
761 ---------------------------------
762 -- Category: Instantiated classes
763 ---------------------------------
765 class Array1OfEdge instantiates
766 Array1 from TCollection (Edge from Aspect);
767 ---Category: Instantiated classes
769 class SequenceOfColorMapEntry instantiates
770 Sequence from TCollection (ColorMapEntry from Aspect);
771 ---Category: Instantiated classes
773 class SequenceOfTypeMapEntry instantiates
774 Sequence from TCollection (TypeMapEntry from Aspect);
775 ---Category: Instantiated classes
777 class SequenceOfWidthMapEntry instantiates
778 Sequence from TCollection (WidthMapEntry from Aspect);
779 ---Category: Instantiated classes
781 class SequenceOfFontMapEntry instantiates
782 Sequence from TCollection (FontMapEntry from Aspect);
783 ---Category: Instantiated classes
785 class SequenceOfMarkMapEntry instantiates
786 Sequence from TCollection (MarkMapEntry from Aspect);
787 ---Category: Instantiated classes
789 class SequenceOfColor instantiates
790 Sequence from TCollection(Color from Quantity);
792 ----------------------------
793 -- Category: Package methods
794 ----------------------------
796 ValuesOfFOSP (aFOSP : FormatOfSheetPaper from Aspect;
797 aWidth, aHeight : out Length from Quantity)
798 returns CString from Standard;
800 ---Purpose: Returns the format size according to the default
801 -- LENGTH unit of the required format <aFOSP>.
802 -- Returns more the normalized format name.
803 ---Category: Package methods
805 ToCString (aString: ExtendedString from TCollection)
806 returns CString from Standard;
808 ---Purpose: Translates an ExtendedString to a CString
809 -- depending of the local format.
810 ---Category: Package methods
812 Inverse ( aMat : Array2OfReal from TColStd;
813 Inv : out Array2OfReal from TColStd )
814 returns Boolean from Standard;
816 ---Purpose: Inverses <aMat> a 4x4 matrix.