summaryrefslogtreecommitdiff
path: root/src/PS/PS_Driver.cdl
blob: 25ae96e4de60b5342401434ca9c3bcdb6601af39 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
-- File:        PS_Driver.cdl
-- Created:     Tue Feb 22 08:46:41 1994
-- Author:      Jean Louis FRENKEL
--              <jlf@minox>
---Copyright:    Matra Datavision 1994

class Driver from PS inherits PlotterDriver from PlotMgt
  ---Purpose: This class defines a PS (Adobe PostScript) plotter Driver.
  ---         All necessary information about methods (purpose, level, category, etc.)
  ---         can be found in CDL files from the inheritance tree (PlotMgt_PlotterDriver,
  ---         Aspect_Driver).


uses
  Plotter            from PlotMgt,
  TypeOfColorSpace   from Aspect,
  FormatOfSheetPaper from Aspect,
  ExtendedString     from TCollection,
  AsciiString        from TCollection,
  ColorMap           from Aspect,
  TypeMap            from Aspect,
  WidthMap           from Aspect,
  FontMap            from Aspect,
  MarkMap            from Aspect,
  TypeOfText         from Aspect,
  TypeOfPrimitive    from Aspect,
  PlaneAngle         from Quantity,
  Length             from Quantity,
  Factor             from Quantity,
  Ratio              from Quantity


raises
  DriverError from Aspect


is
  Create(aName: CString from Standard;                   
      aDX,aDY: Length from Quantity;
      aTypeOfColorSpace: TypeOfColorSpace from Aspect = Aspect_TOCS_RGB;                 
      aSheetFormat: FormatOfSheetPaper from Aspect = Aspect_FOSP_A4)
  returns mutable Driver from PS;

  
  Create(aPlotter : Plotter from PlotMgt;
      aName: CString from Standard;       
      aPaperX,aPaperY: Length from Quantity;
      aTypeOfColorSpace: TypeOfColorSpace from Aspect = Aspect_TOCS_RGB)
  returns mutable Driver from PS;
---Purpose: Constructs a file called aName as the graphic
-- plotter file. The parameters of the plotter aPlotter
-- are taken into account for defining this plotter file.
-- aPaperX,aPaperY defines the size of the
-- sheet-paper and the value of aTypeOfColorSpace
-- defines the mode for processing colors.
  
  BeginFile(me: mutable;
          aPlotter : Plotter from PlotMgt;
          aName: CString from Standard;
          aDX,aDY: Length from Quantity;
          aTypeOfColorSpace: TypeOfColorSpace from Aspect;               
          aPaperX,aPaperY: Length from Quantity)
  is private;

  BeginDraw (me: mutable) is static;

---Purpose:
-- Begins a new page of graphics in the plotter file called "aName".
  EndDraw (me: mutable; dontFlush: Boolean = Standard_False) is static;


  ---------------------------------------------
  -- Category: Methods to define the attributes
  ---------------------------------------------
  InitializeColorMap(me: mutable; aColorMap: ColorMap from Aspect) 
  is virtual protected;


  InitializeTypeMap(me: mutable; aTypeMap: TypeMap from Aspect)
  is virtual protected;


  InitializeWidthMap(me: mutable; aWidthMap: WidthMap from Aspect)
  is virtual protected;


  InitializeFontMap(me: mutable; aFontMap: FontMap from Aspect)
  is virtual protected;


  InitializeMarkMap(me: mutable; aFontMap: MarkMap from Aspect)
  is virtual protected;


  ---------------------------------------------
  -- Category: Methods to set the attributes
  ---------------------------------------------
  SetTextAttrib (me: mutable;
     ColorIndex: Integer from Standard;
     FontIndex: Integer from Standard)
  is redefined;


  SetTextAttrib (me: mutable;
     ColorIndex: Integer from Standard;
     FontIndex: Integer from Standard;
     aSlant: PlaneAngle from Quantity;
     aHScale: Factor from Quantity;
     aWScale: Factor from Quantity;
     isUnderlined: Boolean from Standard = Standard_False)
  is redefined;


  --------------------------------
  -- Actual set graphic attributes
  --------------------------------
  PlotLineAttrib (me: mutable;
      ColorIndex: Integer from Standard;
      TypeIndex: Integer from Standard;
      WidthIndex: Integer from Standard)
  is redefined protected;


  -----------------------------------------
  -- Category: Methods to manage the images
  -----------------------------------------
  SizeOfImageFile (me; anImageFile: CString from Standard;
                       aWidth,aHeight: out Integer from Standard)
  returns Boolean from Standard is redefined;


  -----------------------------------------------
  -- Category: Private methods to draw primitives
  -----------------------------------------------
  PlotPoint (me : mutable; X, Y: ShortReal from Standard)
  returns Boolean from Standard
  is redefined protected;


  PlotSegment (me : mutable;
      X1, Y1: ShortReal from Standard;
      X2, Y2: ShortReal from Standard)
  returns Boolean from Standard
  is redefined protected;


  PlotPolyline (me : mutable;
      xArray : Address from Standard;
      yArray : Address from Standard;
      nPts   : Address from Standard;
      nParts : Integer from Standard)
  returns Boolean from Standard
  is redefined protected;


  PlotPolygon (me : mutable;
      xArray : Address from Standard;
      yArray : Address from Standard;
      nPts   : Address from Standard;
      nParts : Integer from Standard)
  returns Boolean from Standard
  is redefined protected;


  PlotArc (me : mutable; X,Y : ShortReal from Standard;
      anXradius,anYradius : ShortReal from Standard;
      sAngle: ShortReal from Standard;
      oAngle: ShortReal from Standard)
  returns Boolean from Standard
  is redefined protected;


  PlotPolyArc (me : mutable; X,Y : ShortReal from Standard;
      anXradius,anYradius : ShortReal from Standard;
      sAngle: ShortReal from Standard;
      oAngle: ShortReal from Standard)
  returns Boolean from Standard
  is redefined protected;


  PlotMarker (me : mutable;
      aMarker: Integer from Standard;
      Xpos:  ShortReal from Standard;
      Ypos:  ShortReal from Standard;
      Width: ShortReal from Standard;
      Height: ShortReal from Standard;
      Angle: ShortReal from Standard)
  returns Boolean from Standard
  is redefined protected;


  PlotText (me : mutable;
      aText: ExtendedString from TCollection;
      Xpos:  ShortReal from Standard;
      Ypos:  ShortReal from Standard;
      anAngle: ShortReal from Standard;
      aType: TypeOfText from Aspect)
  returns Boolean from Standard
  is redefined protected;
      

  PlotText (me : mutable;
      aText: CString from Standard;
      Xpos:  ShortReal from Standard;
      Ypos:  ShortReal from Standard;
      anAngle: ShortReal from Standard;
      aType: TypeOfText from Aspect)
  returns Boolean from Standard
  is redefined protected;


  PlotPolyText (me : mutable;
      aText: ExtendedString from TCollection;
      Xpos:  ShortReal from Standard;
      Ypos:  ShortReal from Standard;
      aMargin: Ratio from Quantity;
      anAngle: ShortReal from Standard;
      aType: TypeOfText from Aspect)
  returns Boolean from Standard
  is redefined protected;


  PlotPolyText (me : mutable;
      aText: CString from Standard;
      Xpos:  ShortReal from Standard;
      Ypos:  ShortReal from Standard;
      aMargin: Ratio from Quantity;
      anAngle: ShortReal from Standard;
      aType: TypeOfText from Aspect)
  returns Boolean from Standard
  is redefined protected;


  PlotImage (me: mutable; 
      aX, aY, aWidth:  ShortReal from Standard;
      aHeight, aScale: ShortReal from Standard;
      anImageFile:     CString   from Standard;
      anArrayOfPixels: Address   from Standard;
      aLineIndex:      Integer   from Standard = -1)
  returns Boolean from Standard
  is redefined protected;


  ----------------------------
  -- Category: Inquire methods
  ----------------------------
  Convert(me; aShortReal: ShortReal from Standard) 
  returns ShortReal from Standard is static private;
---Purpose: For this driver
-- - returns the DPU (device plotter unit) value
--   corresponding to the number of pixels PV, or
-- - returns the number of pixels corresponding to the DPU value DV, or
-- - returns the DPU coordinates (DX,DY)
--   corresponding to the pixel position (PX,PY), or
-- - returns the pixel position (PX,PY) corresponding to
--   the DPU coordinates (DX,DY).
--   The DPU value is specified in millimeters by default.
-- Warning
-- The pixel size is 325mm/1152 by default and can be
-- changed with the SetPixelSize function.

  DrawCurveCapable (me)
  returns Boolean from Standard is redefined protected;

  MapX(me; aShortReal: ShortReal from Standard) 
  returns ShortReal from Standard is redefined private;

  
  MapY(me; aShortReal: ShortReal from Standard) 
  returns ShortReal from Standard is redefined private; 

   
fields
  myCurrentPage: Integer from Standard;

end Driver from PS;