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
8 -- under the terms of the GNU Lesser General Public 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: 07/07/98 ; DCB : Adding plotmode enum
24 -- Modified: 07-07-98 by DCB (S3602 study)
25 -- Adding plotmode enum
26 -- Modified: 20-07-98 by DCB (S3602 study)
27 -- Adding Plotter and PlotterConfigTool classes
29 -- Modified: 22-07-98 by DCB
30 -- Adding DriverPtr, PlotterDriverPtr, WindowDriverPtr
32 -- Modified: 24/08/98 ; CAL : S3892. Ajout grilles 3d.
33 -- Modified: 16-09-98 by BGN (S3989)
34 --- Adding TypeOfTriedronEcho, TypeOfTriedronPosition.
35 -- Modified: 30-11-98 ; FMN : S4069. Textes always visible.
36 -- Modified: 30/10/98 : DCB : S4046
37 -- Adding class PlotterParameter and changing the Plotter's class
38 -- implementation according to new PLO specifications (S3604 ???)
39 -- Also new classes : (H)Array1OfPlotterParameter
40 -- New enumeration : TypeOfPlotterParameter.
41 -- New exception : PlotterParameterError.
42 -- Modified: 25-NOV-98 : DCB
43 -- Removing all plotters specific implementation from Aspect.
44 -- These classes and enums will now be located in PlotMgt.
45 -- Modified: 17-NOV-99 : GG GER61351
46 -- Add TypeOfFacingModel enum
47 -- Modified: 20-JAN-00 : GG
48 -- Add GDM_None in enum GridDrawMode.
49 -- Modified: 25-JAN-00 : VKH
51 -- Modified: 23-FEB-00 : GG
52 -- Returns format name in ValuesOfFOSP() internal method.
53 -- Modified: 27-03-02 RIC120302 GG Add imported class
54 -- Display, Drawable, RenderingContext, GraphicCallbackProc
55 -- Modified: 22-03-04 OCC4895 SAN High-level interface for controlling polygon offsets
56 -- Modified: 21-06-04 STV Added Aspect_ColorScale class
58 ------------------------------------------------------------------------
64 ---Purpose: This package contains the group of graphic elements common
65 -- to different types of visualisers. It allows the description
66 -- of a screen background, a window, an edge, and groups of
67 -- graphic attributes that can be used in describing 2D
70 ---Keywords: Window, Aspect, FillArea, Line, Marker, Edge
71 -- Highlight, Hatch, Background, GradientBackground, Color map,
72 -- Type map, Width map, Font map
86 ---------------------------
87 -- Category: Imported types
88 ---------------------------
90 -- waiting for RBA creating this class in Standard ...
96 ---Purpose: Defines the C structure <alayer>
97 ---Category: Imported types
105 -- To manage Drawable
111 primitive RenderingContext;
113 -- To manage 2D or 3D graphic context
115 imported GraphicCallbackProc;
117 -- To manage client post display
119 -- 22-03-04 OCC4895 SAN High-level interface for controlling polygon offsets
120 imported PolygonOffsetMode;
122 -- Enumeration for polygon offset modes
124 ---------------------
125 -- Category: Pointers
126 ---------------------
128 pointer DriverPtr to Driver from Aspect;
129 pointer WindowDriverPtr to WindowDriver from Aspect;
131 ---Category: Pointers
133 -----------------------
134 -- Category: Exceptions
135 -----------------------
137 exception AspectLineDefinitionError inherits OutOfRange;
138 ---Category: Exceptions
140 exception AspectFillAreaDefinitionError inherits OutOfRange;
141 ---Category: Exceptions
143 exception AspectMarkerDefinitionError inherits OutOfRange;
144 ---Category: Exceptions
146 exception BadAccess inherits DomainError;
147 ---Category: Exceptions
149 exception ColorMapDefinitionError inherits OutOfRange;
150 ---Category: The exceptions
152 exception EdgeDefinitionError inherits OutOfRange;
153 ---Category: Exceptions
155 exception IdentDefinitionError inherits OutOfRange;
156 ---Category: Exceptions
158 exception TypeMapDefinitionError inherits OutOfRange;
159 ---Category: The exceptions
161 exception WidthMapDefinitionError inherits OutOfRange;
162 ---Category: The exceptions
164 exception FontMapDefinitionError inherits OutOfRange;
165 ---Category: The exceptions
167 exception MarkMapDefinitionError inherits OutOfRange;
168 ---Category: The exceptions
170 exception WindowDefinitionError inherits OutOfRange;
171 ---Category: The exceptions
173 exception WindowError inherits OutOfRange;
174 ---Category: The exceptions
176 exception PixmapDefinitionError inherits OutOfRange;
177 ---Category: The exceptions
179 exception PixmapError inherits OutOfRange;
180 ---Category: The exceptions
182 exception DriverDefinitionError inherits OutOfRange;
183 ---Category: The exceptions
185 exception DriverError inherits OutOfRange;
186 ---Category: The exceptions
188 exception GraphicDeviceDefinitionError inherits OutOfRange;
189 ---Category: The exceptions
191 exception DisplayConnectionDefinitionError inherits OutOfRange;
192 ---Category: The exceptions
194 exception LineStyleDefinitionError inherits OutOfRange;
195 ---Category: Exceptions
197 exception LineWidthDefinitionError inherits OutOfRange;
198 ---Category: Exceptions
200 exception PolyStyleDefinitionError inherits OutOfRange;
201 ---Category: Exceptions
203 exception FontStyleDefinitionError inherits OutOfRange;
204 ---Category: Exceptions
206 exception MarkerStyleDefinitionError inherits OutOfRange;
207 ---Category: Exceptions
209 exception UndefinedMap inherits OutOfRange;
210 ---Category: Exceptions
212 ------------------------------
213 -- Category: Classes Color map
214 ------------------------------
216 deferred class ColorMap;
217 ---Purpose: Defines a color map.
218 ---Category: Classes Color map
220 class ColorCubeColorMap;
221 ---Purpose: Associates a index and a color in the "ColorCube" space.
222 ---Category: Classes Color map
224 class ColorRampColorMap;
225 ---Purpose: Associates a index and a color in the linear "ColorRamp"
227 ---Category: Classes Color map
229 class GenericColorMap;
230 ---Purpose: Associates an index and a color.
231 ---Category: Classes Color map
234 ---Purpose: Defines an entry in the color map :
235 -- an index and a color.
236 ---Category: Classes Color map
238 ------------------------------
239 -- Category: Classes Pixel
240 ------------------------------
242 deferred class Pixel;
243 ---Purpose: Defines a picture element.
244 ---Category: Classes Pixel
248 ---Category: Classes Pixel
252 ---Category: Classes Pixel
254 ---------------------------
255 -- Category: Classes Aspect
256 ---------------------------
258 deferred class AspectLine;
259 ---Purpose: Creates and updates a group of graphic attributes
260 -- for primitives 'Line'
261 ---Category: Classes Aspect
263 deferred class AspectMarker;
264 ---Purpose: Creates and updates a group of graphic attributes
265 -- for primitives 'Marker'.
266 ---Category: Classes Aspect
268 deferred class AspectFillArea;
269 ---Purpose: Creates and updates a group of graphic attributes
270 -- for primitives 'Face'.
271 ---Category: Classes Aspect
278 ---Purpose: Defines a window background
281 class GradientBackground;
282 ---Purpose: Defines a window gradient background
286 ---Purpose: Defines an edge.
290 ---Purpose: Creates and controles all identifiers.
294 ---Purpose: Defines a Font Style
295 ---Category: The classes
298 ---Purpose: Defines an entry in the Font map :
299 -- an index and a text Font.
300 ---Category: Classes Font map
303 ---Purpose: Associates an index and a text Font entry.
304 ---Category: The classes
307 ---Purpose: Defines an entry in the Width map :
308 -- an index and a line Width.
309 ---Category: Classes Width map
312 ---Purpose: Associates an index and a line width entry.
313 ---Category: The classes
316 ---Purpose: Defines a Line Style
317 ---Category: The classes
320 ---Purpose: Associates an index and a line type entry.
321 ---Category: The classes
324 ---Purpose: Defines an entry in the Type map :
325 -- an index and a line style.
326 ---Category: Classes Type map
329 ---Purpose: Defines a Marker Style
330 ---Category: The classes
333 ---Purpose: Associates an index and a Marker entry.
334 ---Category: The classes
337 ---Purpose: Defines an entry in the Marker map :
338 -- an index and a marker style.
339 ---Category: Classes Mark map
341 deferred class Window;
342 ---Purpose: Defines a window.
345 deferred class Driver;
346 ---Purpose: Defines a virtual driver.
349 deferred class WindowDriver;
350 ---Purpose: Defines a virtual driver associated to a window.
354 class RectangularGrid;
357 deferred class ColorScale;
358 ---Purpose: Defines a color scale for viewer.
360 imported DisplayConnection;
361 ---Purpose: Creates and provides connection with X server.
363 imported DisplayConnection_Handle;
364 ---Purpose: Handle for DisplayConnection;
366 -------------------------
367 -- Category: Enumerations
368 -------------------------
370 enumeration HatchStyle is HS_HORIZONTAL,
377 HS_DIAGONAL_135_WIDE,
381 HS_GRID_DIAGONAL_WIDE
383 ---Purpose: Definition of all available hatch styles.
386 -- HS_HORIZONTAL_WIDE
390 -- HS_DIAGONAL_45_WIDE
392 -- HS_DIAGONAL_135_WIDE
396 -- HS_GRID_DIAGONAL_WIDE
398 ---Category: Enumerations
400 enumeration InteriorStyle is IS_EMPTY,
407 ---Purpose: Definition of interior types for primitive
410 -- IS_EMPTY no interior.
411 -- IS_HOLLOW display the boundaries of the surface.
412 -- IS_HATCH display hatched with a hatch style.
413 -- IS_SOLID display the interior entirely filled.
414 -- IS_HIDDENLINE display in hidden lines removed.
415 -- IS_POINT display only vertices.
417 ---Category: Enumerations
419 enumeration TypeOfColorMap is TOC_Generic,
423 ---Purpose: Definition of the color map types
425 ---Category: Enumerations
427 enumeration TypeOfConstraint is TOC_BOTTOM_LEFT,
431 end TypeOfConstraint;
432 ---Purpose: Definition of the attachment for the layers
434 ---Category: Enumerations
436 enumeration TypeOfDrawMode is TODM_REPLACE,
441 ---Purpose: Definition of the draw modes
443 ---Category: Enumerations
445 enumeration TypeOfEdge is TOE_VISIBLE,
448 ---Purpose: Definition of edge visibility
450 -- TOE_VISIBLE Edge is displayed
451 -- TOE_INVISIBLE Edge is not displayed
453 ---Category: Enumerations
455 enumeration TypeOfHighlightMethod is TOHM_COLOR,
458 end TypeOfHighlightMethod;
459 ---Purpose: Definition of a highlight method
461 -- TOHM_COLOR drawn in the highlight color
463 -- TOHM_BLINK blinking
464 -- TOHM_BOUNDBOX enclosed by the boundary box
467 ---Category: Enumerations
469 enumeration TypeOfLine is TOL_SOLID,
475 ---Purpose: Definition of line types
477 -- TOL_SOLID continuous
478 -- TOL_DASH dashed 2.0,1.0 (MM)
479 -- TOL_DOT dotted 0.2,0.5 (MM)
480 -- TOL_DOTDASH mixed 10.0,1.0,2.0,1.0 (MM)
481 -- TOL_USERDEFINED defined by Users
482 ---Category: Enumerations
484 enumeration WidthOfLine is WOL_THIN,
490 ---Purpose: Definition of line types
492 -- WOL_THIN thin line (1 pixel width)
493 -- WOL_MEDIUM medium width of 0.5 MM
494 -- WOL_THICK thick width of 0.7 MM
495 -- WOL_VERYTHICK very thick width of 1.5 MM
496 -- WOL_USERDEFINED defined by Users
497 ---Category: Enumerations
499 enumeration TypeOfFont is TOF_DEFAULT,
505 ---Purpose: Definition of line types
507 -- TOF_DEFAULT Default system font
510 -- TOF_USERDEFINED defined by Users
511 ---Category: Enumerations
513 enumeration TypeOfText is TOT_SOLID,
516 ---Purpose: Definition of Text types
518 -- TOF_SOLID Default text
520 ---Category: Enumerations
522 enumeration TypeOfStyleText is TOST_NORMAL,
525 ---Purpose: Define the style of the text.
527 -- TOST_NORMAL Default text. The text is displayed like any other graphic object.
528 -- This text can be hidden by another object that is nearest from the
530 -- TOST_ANNOTATION The text is always visible. The texte is displayed
531 -- over the other object according to the priority.
532 ---Category: Enumerations
534 enumeration TypeOfDisplayText is TODT_NORMAL,
539 end TypeOfDisplayText;
540 ---Purpose: Define the display type of the text.
542 -- TODT_NORMAL Default display. Text only.
543 -- TODT_SUBTITLE There is a subtitle under the text.
544 -- TODT_DEKALE The text is displayed with a 3D style.
545 -- TODT_BLEND The text is displayed in XOR.
546 -- TODT_DIMENSION Dimension line under text will be invisible.
547 ---Category: Enumerations
549 enumeration TypeOfMarker is TOM_POINT,
564 ---Purpose: Definition of types of markers
571 -- TOM_O_POINT a point in a circle
572 -- TOM_O_PLUS a plus in a circle
573 -- TOM_O_STAR a star in a circle
574 -- TOM_O_X a cross in a circle
575 -- TOM_RING1 a large ring
576 -- TOM_RING2 a medium ring
577 -- TOM_RING3 a small ring
578 -- TOM_BALL a ball with 1 color and different saturations
579 -- TOM_USERDEFINED defined by Users
581 ---Category: Enumerations
583 enumeration TypeOfUpdate is TOU_ASAP,
586 ---Purpose: Definition of screen refresh mode
588 -- TOU_ASAP as soon as possible
589 -- TOU_WAIT on demand (Update)
591 ---Category: Enumerations
593 enumeration TypeOfDeflection is TOD_RELATIVE,
595 end TypeOfDeflection;
596 ---Purpose: Defines if the maximal chordial deflection used when
597 -- drawing an object is absolute or relative to the size
600 enumeration TypeOfResize is TOR_UNKNOWN,
606 TOR_TOP_AND_RIGHT_BORDER,
607 TOR_RIGHT_AND_BOTTOM_BORDER,
608 TOR_BOTTOM_AND_LEFT_BORDER,
609 TOR_LEFT_AND_TOP_BORDER
611 ---Purpose: Defines the type of Resize Window method applied
614 enumeration CardinalPoints is CP_North,
625 enumeration TypeOfRenderingMode is TORM_IMMEDIAT,
627 TORM_CLEAR_AND_RETAIN
628 end TypeOfRenderingMode;
629 ---Purpose: Definition of the rendering modes
631 enumeration TypeOfColorSpace is TOCS_BlackAndWhite,
634 end TypeOfColorSpace;
637 enumeration FormatOfSheetPaper is
638 FOSP_A0, -- 0.841 x 1.189 (M)
639 FOSP_A1, -- 0.594 x 0.841 (M)
640 FOSP_A2, -- 0.420 x 0.594 (M)
641 FOSP_A3, -- 0.297 x 0.420 (M)
642 FOSP_A4, -- 0.210 x 0.297 (M)
643 FOSP_A5, -- 0.1485 x 0.210 (M)
644 FOSP_K_LONG, -- 1.016 x 3.6322 (M)
645 FOSP_K_SHORT, -- 1.016 x 1.397 (M)
646 FOSP_J_LONG, -- 0.8636 x 4.4704 (M)
647 FOSP_J_SHORT, -- 0.8636 x 1.397 (M)
648 FOSP_H_LONG, -- 0.7112 x 3.6322 (M)
649 FOSP_H_SHORT, -- 0.7112 x 1.1176 (M)
650 FOSP_G_LONG, -- 0.2794 x 2.286 (M)
651 FOSP_G_SHORT, -- 0.2794 x 0.5715 (M)
652 FOSP_F, -- 0.7112 x 1.016 (M)
653 FOSP_E, -- 0.8636 x 1.1176 (M)
654 FOSP_D, -- 0.5588 x 0.8636 (M)
655 FOSP_C, -- 0.4318 x 0.5588 (M)
656 FOSP_B, -- 0.2794 x 0.4318 (M)
657 FOSP_A, -- 0.2159 x 0.2794 (M)
658 FOSP_UNKNOWN -- User defined
659 end FormatOfSheetPaper;
662 enumeration TypeOfPrimitive is
674 enumeration GridDrawMode is GDM_Lines,
678 ---Purpose: Defines the grid draw mode. The grid may be drawn
679 -- by using lines or points.
681 enumeration GridType is GT_Rectangular,
684 ---Purpose: Defines the grid type : Rectangular or Circular.
686 --------- Start DCB modification ----------------------------------------
687 enumeration PlotMode is
692 ---Purpose: Defines plot mode for plotter drivers derived from
693 -- Aspect_PlotterDriver:
694 -- 1) PM_DPLOTTER - send file to plotter and delete file
695 -- 2) PM_FILEONLY - do not send file to the plotter
696 -- 3) PM_NPLOTTER - send file to the plotter but not delete a file
699 enumeration ListingType is
704 ---Purpose: Defines where to search plotter files (PLO)
706 enumeration PlotterOrigin is
714 --------- Stop DCB modification ----------------------------------------
717 enumeration TypeOfTriedronEcho is TOTE_NONE,
735 end TypeOfTriedronEcho;
736 ---Purpose: Definition of the Triedron echo zone to highlight
738 -- TOTE_NONE no echo zone
739 -- TOTE_ORIGIN a box on origin of the Triedron
740 -- TOTE_AXIS_X highlights the X axis
741 -- TOTE_AXIS_Y highlights the Y axis
742 -- TOTE_AXIS_Z highlights the Z axis
743 -- TOTE_TEXT_X highlights the X character
744 -- TOTE_TEXT_Y highlights the Y character
745 -- TOTE_TEXT_Z highlights the Z character
746 -- TOTE_01 to TOTE_10 not yet implemented.
747 ---Category: The enumerations
750 enumeration TypeOfTriedronPosition is TOTP_CENTER,
765 end TypeOfTriedronPosition;
766 ---Purpose: Definition of the Triedron position in the views
768 -- TOTP_CENTER at the center of the view
769 -- TOTP_LEFT_LOWER at the left lower corner
770 -- TOTP_LEFT_UPPER at the left upper corner
771 -- TOTP_RIGHT_LOWER at the right lower corner
772 -- TOTP_RIGHT_UPPER at the right upper corner
773 -- TOTP_01 to TOTP_10 not yet implemented.
774 ---Category: The enumerations
776 enumeration TypeOfLayer is TOL_OVERLAY,
779 ---Purpose: Modes of drawing for the objects in a layer
781 -- TOL_OVERLAY, the graphic of the layer is draw
782 -- after the 3d graphic.
783 -- TOL_UNDERLAY, the graphic of the layer is draw
784 -- before the 3d graphic.
785 ---Category: The enumerations
787 enumeration TypeOfFacingModel is TOFM_BOTH_SIDE,
790 end TypeOfFacingModel;
792 enumeration FillMethod is
798 ---Purpose: Defines the fill methods to
799 -- write bitmaps in a window.
801 enumeration GradientFillMethod is
811 end GradientFillMethod;
812 ---Purpose: Defines the fill methods to
813 -- write gradient background in a window.
815 enumeration TypeOfColorScaleData is
818 end TypeOfColorScaleData;
819 ---Purpose: Defines the using type of colors and labels
821 enumeration TypeOfColorScalePosition is
826 end TypeOfColorScalePosition;
827 ---Purpose: Defines the type of position for color scale labels
829 enumeration TypeOfColorScaleOrientation is
834 end TypeOfColorScaleOrientation;
835 ---Purpose: Defines the type of color scale orientation
837 enumeration PrintAlgo is
841 ---Purpose: Defines print algorithm
843 -- 1) PA_STRETCH - Stretch offscreen printing frame
844 -- if its dimensions are smaller than
845 -- the printer's printing area dimensions;
846 -- This algorithm is more reliable as it
847 -- works on any hardware and is recommended
848 -- to be used with average printing resolutions,
849 -- as it more RAM memory dependent than PA_TILE;
850 -- Stretching is performend using bicubic interpolation
851 -- algorithm from FreeImage library if OCCT is built
852 -- with FreeImage support, otherwise Windows API
853 -- StretchBlt() function in STRETCH_HALFTONE mode
855 -- 2) PA_TILE - If the offscreen printing frame dimensions
856 -- are smaller than the printer's printing
857 -- area dimensions - use multiple printing
858 -- frames to cover the whole printing area
862 ---Purpose: Defines custom identifiers(atoms) for X window custom named properties
863 ---------------------------------
864 -- Category: Instantiated classes
865 ---------------------------------
867 class Array1OfEdge instantiates
868 Array1 from TCollection (Edge from Aspect);
869 ---Category: Instantiated classes
871 class SequenceOfColorMapEntry instantiates
872 Sequence from TCollection (ColorMapEntry from Aspect);
873 ---Category: Instantiated classes
875 class SequenceOfTypeMapEntry instantiates
876 Sequence from TCollection (TypeMapEntry from Aspect);
877 ---Category: Instantiated classes
879 class SequenceOfWidthMapEntry instantiates
880 Sequence from TCollection (WidthMapEntry from Aspect);
881 ---Category: Instantiated classes
883 class SequenceOfFontMapEntry instantiates
884 Sequence from TCollection (FontMapEntry from Aspect);
885 ---Category: Instantiated classes
887 class SequenceOfMarkMapEntry instantiates
888 Sequence from TCollection (MarkMapEntry from Aspect);
889 ---Category: Instantiated classes
891 class SequenceOfColor instantiates
892 Sequence from TCollection(Color from Quantity);
894 ----------------------------
895 -- Category: Package methods
896 ----------------------------
898 ValuesOfFOSP (aFOSP : FormatOfSheetPaper from Aspect;
899 aWidth, aHeight : out Length from Quantity)
900 returns CString from Standard;
902 ---Purpose: Returns the format size according to the default
903 -- LENGTH unit of the required format <aFOSP>.
904 -- Returns more the normalized format name.
905 ---Category: Package methods
907 ToCString (aString: ExtendedString from TCollection)
908 returns CString from Standard;
910 ---Purpose: Translates an ExtendedString to a CString
911 -- depending of the local format.
912 ---Category: Package methods
914 Inverse ( aMat : Array2OfReal from TColStd;
915 Inv : out Array2OfReal from TColStd )
916 returns Boolean from Standard;
918 ---Purpose: Inverses <aMat> a 4x4 matrix.