1 -- Created on: 1996-09-13
3 -- Copyright (c) 1996-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.
22 class Driver from CGM inherits PlotterDriver from PlotMgt
23 ---Purpose: This class defines a CGM (Computer Graphic Metafile) plotter Driver.
24 --- All necessary information about methods (purpose, level, category, etc.)
25 --- can be found in CDL files from the inheritance tree (PlotMgt_PlotterDriver,
30 ExtendedString from TCollection,
34 TypeOfText from Aspect,
35 TypeOfColorSpace from Aspect,
36 PlaneAngle from Quantity,
40 Array1OfShortReal from TShort
44 Create(aPlotter : Plotter from PlotMgt;
45 aName : CString from Standard;
46 aDX,aDY : Length from Quantity;
47 aTypeOfColorSpace : TypeOfColorSpace from Aspect = Aspect_TOCS_RGB)
48 returns mutable Driver from CGM;
51 Create(aName : CString from Standard;
52 aDX,aDY : Length from Quantity;
53 aTypeOfColorSpace : TypeOfColorSpace from Aspect = Aspect_TOCS_RGB)
54 returns mutable Driver from CGM;
57 BeginFile(me: mutable;
58 aPlotter : Plotter from PlotMgt;
59 aDX,aDY : Length from Quantity;
60 aTypeOfColorSpace : TypeOfColorSpace from Aspect)
64 is redefined protected;
68 BeginDraw (me: mutable)
72 EndDraw (me: mutable; dontFlush: Boolean = Standard_False)
76 ---------------------------------------------
77 -- Category: Methods to define the attributes
78 ---------------------------------------------
79 InitializeColorMap(me: mutable; aColorMap: ColorMap from Aspect)
80 is redefined protected;
83 InitializeTypeMap(me: mutable; aTypeMap: TypeMap from Aspect)
84 is redefined protected;
87 InitializeWidthMap(me: mutable; aWidthMap: WidthMap from Aspect)
91 -----------------------------------------
92 -- Category: Methods to manage the images
93 -----------------------------------------
94 SizeOfImageFile (me; anImageFile: CString from Standard;
95 aWidth,aHeight: out Integer from Standard)
96 returns Boolean from Standard is redefined;
99 --------------------------------
100 -- Actual set graphic attributes
101 --------------------------------
102 PlotLineAttrib (me: mutable;
103 ColorIndex: Integer from Standard;
104 TypeIndex: Integer from Standard;
105 WidthIndex: Integer from Standard)
106 is redefined protected;
109 PlotPolyAttrib (me: mutable;
110 ColorIndex: Integer from Standard;
111 TileIndex: Integer from Standard;
112 DrawEdge: Boolean from Standard)
113 is redefined protected;
116 -----------------------------------------------
117 -- Category: Private methods to draw primitives
118 -----------------------------------------------
119 PlotPoint (me : mutable; X, Y: ShortReal from Standard)
120 returns Boolean from Standard
121 is redefined protected;
124 PlotSegment (me : mutable;
125 X1, Y1: ShortReal from Standard;
126 X2, Y2: ShortReal from Standard)
127 returns Boolean from Standard
128 is redefined protected;
131 PlotPolyline (me : mutable;
132 xArray : Address from Standard;
133 yArray : Address from Standard;
134 nPts : Address from Standard;
135 nParts : Integer from Standard)
136 returns Boolean from Standard
137 is redefined protected;
140 PlotPolygon (me : mutable;
141 xArray : Address from Standard;
142 yArray : Address from Standard;
143 nPts : Address from Standard;
144 nParts : Integer from Standard)
145 returns Boolean from Standard
146 is redefined protected;
149 PlotArc (me : mutable; X,Y : ShortReal from Standard;
150 anXradius,anYradius : ShortReal from Standard;
151 sAngle: ShortReal from Standard;
152 oAngle: ShortReal from Standard)
153 returns Boolean from Standard
154 is redefined protected;
157 PlotPolyArc (me : mutable; X,Y : ShortReal from Standard;
158 anXradius,anYradius : ShortReal from Standard;
159 sAngle: ShortReal from Standard;
160 oAngle: ShortReal from Standard)
161 returns Boolean from Standard
162 is redefined protected;
165 PlotImage (me: mutable;
166 aX, aY, aWidth: ShortReal from Standard;
167 aHeight, aScale: ShortReal from Standard;
168 anImageFile: CString from Standard;
169 anArrayOfPixels: Address from Standard;
170 aLineIndex: Integer from Standard = -1)
171 returns Boolean from Standard
172 is redefined protected;
175 InitializeDriver (me: mutable; aName: CString from Standard)
179 WriteData (me: mutable;
180 aCode: Integer from Standard;
181 pLongData: Address from Standard;
182 pFloatData: Address from Standard;
183 pCharData: Address from Standard)
188 myBKIndex: Integer from Standard;
189 myCurrentPage: Integer from Standard;
190 myFileIsOpened: Boolean from Standard;
191 myFillIndex: Integer from Standard;
192 myEdgeColor: Integer from Standard;
193 myEdgeType: Integer from Standard;
194 myEdgeWidth: Integer from Standard;
195 myInteriorStyle: Integer from Standard;
196 myEdgeVisibility: Integer from Standard;