0023024: Update headers of OCCT files
[occt.git] / src / Aspect / Aspect_Driver.cdl
1 -- Created on: 1993-07-01
2 -- Created by: Jean Louis FRENKEL,Gerard GRAS
3 -- Copyright (c) 1993-1999 Matra Datavision
4 -- Copyright (c) 1999-2012 OPEN CASCADE SAS
5 --
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.
10 --
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.
13 --
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.
20
21
22 -- Update:      Fri Jan 30 16:05:00 1998
23 --              Adds <useMFT> parameter in the SetFontMap() method 
24 --              and adds the new method UseMFT()
25 --              for using MDTV fonts instead system fonts.
26
27 deferred class Driver from Aspect inherits TShared from MMgt
28
29 ---Purpose: Defines the common behaviour of the output driver.
30 --  Warning: Permits to defines polyline,polygon,marker and text attributes in relation 
31 --          with the SINGLE primitives DrawPolyline(),DrawPolygon(),....
32 --          or the INCREMENTAL primitives BeginPolyline(),BeginPolygon(),...
33 --          or the SET of primitives BeginArcs(),BeginMarkers(),...
34 --
35 --          NOTE that :
36 --          The incremental primitives are interesting to used because
37 --          no more arrays are necessary to fill it.
38 --          The set of primitives are interesting to used because this
39 --          increase the drawing performances. 
40
41 uses
42
43         ExtendedString          from TCollection,
44         Array1OfShortReal       from TShort,
45         ColorMap                from Aspect,
46         TypeMap                 from Aspect,
47         WidthMap                from Aspect,
48         FontMap                 from Aspect,
49         MarkMap                 from Aspect,
50         TypeOfText              from Aspect,
51         PlaneAngle              from Quantity,
52         Length                  from Quantity,
53         Factor                  from Quantity,
54         Ratio                   from Quantity,
55         Color                   from Quantity
56
57 raises
58
59         DriverDefinitionError   from Aspect,
60         DriverError             from Aspect,
61         UndefinedMap            from Aspect
62 is
63
64         Initialize;
65
66         EndDraw (me: mutable; Synchronize: Boolean = Standard_False) is deferred;
67         ---Purpose: Flush all graphics and Wait after up to date
68         --display when Synchronize is TRUE.
69  
70         ---------------------------------------------
71         -- Category: Methods to define the attributes
72         ---------------------------------------------
73
74         SetColorMap(me: mutable;
75                         aColorMap: ColorMap from Aspect) 
76                 raises DriverError from Aspect is static;
77         ---Category: Methods to define the ColorIndexs
78
79         SetTypeMap(me: mutable;
80                         aTypeMap: TypeMap from Aspect)
81                 raises DriverError from Aspect is static;
82         ---Category: Methods to define the TypeIndexs
83
84         SetWidthMap(me: mutable;
85                         aWidthMap: WidthMap from Aspect)
86                 raises DriverError from Aspect is static;
87         ---Category: Methods to define the WidthIndexs
88
89         SetFontMap(me: mutable;
90                         aFontMap: FontMap from Aspect;
91                         useMFT: Boolean from Standard = Standard_True)
92                 raises DriverError from Aspect is static;
93         ---Category: Methods to define the FontIndexs
94         ---Purpose:
95         -- Sets the current font map to this driver and Enable/Disable
96         -- this driver to use MDTV fonts instead system fonts.
97
98         SetMarkMap(me: mutable;
99                         aMarkMap: MarkMap from Aspect)
100                 raises DriverError from Aspect is static;
101         ---Category: Methods to define the MarkerIndexs
102
103         SetLineAttrib (me: mutable;
104                 ColorIndex: Integer from Standard;
105                 TypeIndex: Integer from Standard;
106                 WidthIndex: Integer from Standard)
107                 raises DriverError from Aspect is deferred;
108         ---Category: Methods to define the Current Line Attibutes
109
110         SetTextAttrib (me: mutable;
111                 ColorIndex: Integer from Standard;
112                 FontIndex: Integer from Standard)
113                 raises DriverError from Aspect is deferred;
114         ---Category: Methods to define the Current Text Attributes
115
116         SetTextAttrib (me: mutable;
117                 ColorIndex: Integer from Standard;
118                 FontIndex: Integer from Standard;
119                 aSlant: PlaneAngle from Quantity;
120                 aHScale: Factor from Quantity;
121                 aWScale: Factor from Quantity;
122                 isUnderlined: Boolean from Standard = Standard_False) 
123                 raises DriverError from Aspect is deferred;
124         ---Category: Methods to define the Current Extended Text Attributes
125
126         SetPolyAttrib (me: mutable;
127                         ColorIndex: Integer from Standard;
128                         TileIndex: Integer from Standard;
129                         DrawEdge: Boolean from Standard = Standard_False)
130                 raises DriverError from Aspect is deferred;            
131         ---Category: Methods to set the poly attributes
132
133         SetMarkerAttrib (me: mutable;
134                 ColorIndex: Integer from Standard;
135                 WidthIndex: Integer from Standard;
136                 FillMarker: Boolean from Standard = Standard_False)
137                 raises DriverError from Aspect is deferred;
138         ---Category: Methods to define the Current Marker Attributes
139
140         ---Category: Images methods:
141
142         IsKnownImage(me: mutable; anImage: Transient from Standard)
143         returns Boolean from Standard
144         is deferred;
145
146         SizeOfImageFile(me; anImageFile: CString from Standard;
147                             aWidth,aHeight: out Integer from Standard)
148         returns Boolean from Standard
149         is deferred;
150
151         ClearImage (me: mutable; anImageId: Transient from Standard)
152                 raises DriverError from Aspect is deferred;
153
154         ClearImageFile (me: mutable; anImageFile: CString from Standard)
155                 raises DriverError from Aspect is deferred;
156
157         DrawImage (me: mutable; anImageId: Transient from Standard;
158                 aX, aY: ShortReal from Standard)
159                 raises DriverError from Aspect is deferred;
160         ---Category: Methods to draw primitives
161
162         DrawImageFile (me: mutable; anImageFile: CString from Standard;
163                 aX, aY: ShortReal from Standard;
164                 aScale: Factor from Quantity = 1.0)
165                 raises DriverError from Aspect is deferred;
166         ---Category: Methods to draw primitives
167
168         FillAndDrawImage (me: mutable; anImageId: Transient from Standard;
169                 aX, aY: ShortReal from Standard;
170                 aWidth, aHeight: Integer from Standard;
171                 anArrayOfPixels: Address from Standard)
172                 raises DriverError from Aspect is deferred;
173         ---Level: Public
174         ---Purpose: Fills a complete Image .
175         ---Category: Methods to draw primitives
176
177         FillAndDrawImage (me: mutable; anImageId: Transient from Standard;
178                 aX, aY: ShortReal from Standard;
179                 anIndexOfLine, aWidth, aHeight: Integer from Standard;
180                 anArrayOfPixels: Address from Standard)
181                 raises DriverError from Aspect is deferred;
182         ---Level: Public
183         ---Purpose: Fills a line of the Image .
184         --  Warning: 0 <= anIndexOfLine < aHeight
185         --          anIndexOfLine = 0 must be the first call
186         ---Category: Methods to draw primitives
187
188         DrawPolyline (me : mutable;
189                 aListX, aListY: Array1OfShortReal from TShort)
190         ---Level: Public
191         ---Purpose: Draw a polyline depending of the SetLineAttrib() attributes.
192                 raises DriverError from Aspect is deferred;
193         ---Trigger: Raises if <aListX,aListY> have not the same size.
194         ---Category: Methods to draw primitives
195
196         DrawPolygon (me : mutable;
197                 aListX, aListY: Array1OfShortReal from TShort)
198         ---Level: Public
199         ---Purpose: Draw a polygon depending of the SetPolyAttrib() attributes. 
200                 raises DriverError from Aspect is deferred;
201         ---Trigger: Raises if <aListX,aListY> have not the same size.
202         ---Category: Methods to draw primitives
203
204         DrawSegment (me : mutable;
205                 X1, Y1: ShortReal from Standard;
206                 X2, Y2: ShortReal from Standard)
207         ---Level: Public
208         ---Purpose: Draw a segment depending of the SetLineAttrib() attributes.
209                 raises DriverError from Aspect is deferred;
210         ---Category: Methods to draw primitives
211
212         DrawText (me : mutable;
213                 aText: ExtendedString from TCollection;
214                 Xpos:  ShortReal from Standard;
215                 Ypos:  ShortReal from Standard;
216                 anAngle: ShortReal from Standard = 0.0;
217                 aType: TypeOfText from Aspect = Aspect_TOT_SOLID)
218         ---Level: Public
219         ---Purpose: Draws a text depending of the SetTextAttrib() attributes.
220         ---Warning: Coordinates must be defined in DWU space.
221                 raises DriverError from Aspect is deferred;
222         ---Trigger: Raises if Text has too many chars (> 1024)
223         ---Category: Methods to draw primitives
224  
225         DrawPolyText (me : mutable;
226                 aText: ExtendedString from TCollection;
227                 Xpos:  ShortReal from Standard;
228                 Ypos:  ShortReal from Standard;
229                 aMarge: Ratio from Quantity = 0.1;
230                 anAngle: ShortReal from Standard = 0.0;
231                 aType: TypeOfText from Aspect = Aspect_TOT_SOLID)
232         ---Level: Public
233         ---Purpose: Draws an framed text depending of the 
234         -- SetTextAttrib() and SetPolyAttrib() attributes.
235         --  Warning: Coordinates must be defined in DWU space.
236         --          <aMarge> defines the ratio of the space between the 
237         --          polygon borders and the bounding box of the text and 
238         --          depending of the height of the text.
239                 raises DriverError from Aspect is deferred;
240         ---Trigger: Raises if Text has too many chars (> 1024)
241         --          or <aMarge is < 0 or > 1.
242         ---Category: Methods to draw primitives
243
244         DrawPoint (me : mutable; X, Y: ShortReal from Standard)
245         ---Level: Public
246         ---Purpose: Draws a 1 PIXEL point depending of the SetMarkerAttrib() 
247         --color attribute or add a point depending of the incremental BeginXxxxxx() 
248         --primitive used.
249                 raises DriverError from Aspect is deferred;
250         ---Category: Methods to draw primitives
251
252         DrawMarker (me : mutable;
253                 aMarker: Integer from Standard;
254                 Xpos:  ShortReal from Standard;
255                 Ypos:  ShortReal from Standard;
256                 Width: ShortReal from Standard;
257                 Height: ShortReal from Standard;
258                 Angle: ShortReal from Standard = 0.0)
259         ---Level: Public
260         ---Purpose: Draws the prevously defined marker <aMarker> 
261         --depending of the SetMarkerAttrib() attributes.
262         --  Warning: Coordinates and sizes must be defined in DWU space.
263         --          Angle must be defined in RADIAN.
264         --          A one pixel marker is drawn when aMarker index is undefined.
265                 raises DriverError from Aspect is deferred;
266         ---Category: Methods to draw primitives
267  
268         DrawArc (me : mutable; X,Y : ShortReal from Standard;
269                         anXradius,anYradius : ShortReal from Standard;
270                         aStartAngle: ShortReal from Standard = 0.0;
271                         anOpenAngle: ShortReal from Standard = 6.283185)
272                                                         returns Boolean
273         ---Level: Public
274         ---Purpose: Draws an Ellipsoid arc of center <X,Y> and Radius
275         --<anXradius,anYradius> of relative angle <anOpenAngle> from 
276         --the base angle <aStartAngle> and depending of the SetLineAttrib() attributes.
277         --  Warning: Returns FALSE if the hardware can't drawing this
278         --primitive properly,application must to simulate it.
279                 raises DriverError from Aspect is deferred;
280         ---Trigger: Raises if one of <aXradius,aYradius> is <= 0. 
281         ---Category: Methods to draw primitives
282
283         DrawPolyArc (me : mutable; X,Y : ShortReal from Standard;
284                         anXradius,anYradius : ShortReal from Standard;
285                         aStartAngle: ShortReal from Standard = 0.0;
286                         anOpenAngle: ShortReal from Standard = 6.283185)
287                                                         returns Boolean
288         ---Level: Public
289         ---Purpose: Draws an filled Ellipsoid arc of center <X,Y> and Radius
290         --<anXradius,anYradius> of relative angle <anOpenAngle> from 
291         --the base angle <aStartAngle> and depending of the SetPolyAttrib() attributes.
292         --  Warning: Returns FALSE if the hardware can't drawing this
293         --primitive properly,application must to simulate it.
294                 raises DriverError from Aspect is deferred;
295         ---Trigger: Raises if one of <aXradius,aYradius> is <= 0. 
296         ---Category: Methods to draw primitives
297
298         BeginPolyline (me : mutable; aNumber : Integer) is deferred;
299         ---Level: Public
300         ---Purpose: Begin an incremental polyline primitive of <aNumber> of points .
301         --  Warning: Points must be added by the the DrawPoint() method.
302
303         BeginPolygon (me : mutable; aNumber : Integer) is deferred;
304         ---Level: Public
305         ---Purpose: Begin an incremental polygon primitive of <aNumber> of points .
306         --  Warning: Points must be added by the the DrawPoint() method.
307
308         BeginSegments (me : mutable) is deferred;
309         ---Level: Public
310         ---Purpose: Begin a set of segments .
311         --  Warning: Segments must be added by the DrawSegment() method.
312
313         BeginArcs (me : mutable) is deferred;
314         ---Level: Public
315         ---Purpose: Begin a set of circles or ellips .
316         --  Warning: Arcs must be added by the DrawArc() methods.
317
318         BeginPolyArcs (me : mutable) is deferred;
319         ---Level: Public
320         ---Purpose: Begin a set of polygon circles or ellips .
321         --  Warning: Arcs must be added by the DrawPolyArc() methods.
322
323         BeginMarkers (me : mutable) is deferred;
324         ---Level: Public
325         ---Purpose: Begin a set of markers .
326         --  Warning: Markers must be added by the DrawMarker() method.
327
328         BeginPoints (me : mutable) is deferred;
329         ---Level: Public
330         ---Purpose: Begin a set of points .
331         --  Warning: Points must be added by the DrawPoint() method.
332
333         ClosePrimitive (me : mutable)
334         ---Level: Public
335         ---Purpose: Close the last Begining primitive
336                 raises DriverError from Aspect is deferred;
337         ---Trigger: Raises if no primitive have been opened by BeginXxxxxx().
338
339         InitializeColorMap(me: mutable;
340                         aColorMap: ColorMap from Aspect) 
341                 raises DriverError from Aspect is deferred protected;
342         ---Category: Methods to define the ColorIndexs
343
344         InitializeTypeMap(me: mutable;
345                         aTypeMap: TypeMap from Aspect)
346                 raises DriverError from Aspect is deferred protected;
347         ---Category: Methods to define the TypeIndexs
348
349         InitializeWidthMap(me: mutable;
350                         aWidthMap: WidthMap from Aspect)
351                 raises DriverError from Aspect is deferred protected;
352         ---Category: Methods to define the WidthIndexs
353
354         InitializeFontMap(me: mutable;
355                         aFontMap: FontMap from Aspect)
356                 raises DriverError from Aspect is deferred protected;
357         ---Category: Methods to define the FontIndexs
358
359         InitializeMarkMap(me: mutable;
360                         aMarkMap: MarkMap from Aspect)
361                 raises DriverError from Aspect is deferred protected;
362         ---Category: Methods to define the MarkerIndexs
363
364         ----------------------------
365         -- Category: Inquire methods
366         ----------------------------
367
368         ColorMap(me) returns mutable ColorMap from Aspect 
369         raises UndefinedMap from Aspect is static;
370
371         TypeMap(me) returns  mutable TypeMap from Aspect 
372         raises UndefinedMap from Aspect is static;
373
374         WidthMap(me) returns mutable WidthMap from Aspect 
375         raises UndefinedMap from Aspect is static;
376
377         FontMap(me) returns  mutable FontMap from Aspect
378         raises UndefinedMap from Aspect is static;
379
380         MarkMap(me) returns  mutable MarkMap from Aspect
381         raises UndefinedMap from Aspect is static;
382
383         WorkSpace ( me ; Width,Heigth : out Length from Quantity ) 
384         is deferred;
385         ---Level: Public
386         ---Purpose: Returns the Available WorkSpace in DWU coordinates
387         ---Category: Inquire methods
388
389         Convert ( me ; PV : Integer from Standard )
390                     returns Length from Quantity is deferred;
391         ---Level: Public
392         ---Purpose: Returns the DWU value depending of
393         --          the PIXEL value.
394         ---Category: Inquire methods
395
396         Convert ( me ; DV : Length from Quantity )
397             returns Integer from Standard is deferred;
398         ---Level: Public
399         ---Purpose: Returns the PIXEL value depending of
400         --          the DWU value.
401         ---Category: Inquire methods
402
403         Convert ( me ; PX, PY : Integer from Standard ;
404                    DX, DY : out Length from Quantity ) is deferred ;
405         ---Level: Public
406         ---Purpose: Returns the DWU position depending of
407         --          the PIXEL position .
408         ---Category: Inquire methods
409
410         Convert ( me ; DX, DY : Length from Quantity ;
411                    PX, PY : out Integer from Standard )  is deferred;
412         ---Level: Public
413         ---Purpose: Returns the PIXEL position depending of
414         --          the DWU position .
415         ---Category: Inquire methods
416
417         UseMFT ( me ) returns Boolean from Standard is static;
418
419         ---Level: Advanced
420         ---Purpose: Returns TRUE when the driver must use MDTV fonts
421         --      instead system fonts.
422
423 fields
424         myColorMap: ColorMap from Aspect;
425         myTypeMap:  TypeMap from Aspect;
426         myWidthMap: WidthMap from Aspect;
427         myFontMap:  FontMap from Aspect;
428         myMarkMap:  MarkMap from Aspect;
429         myColorMapIsDefined: Boolean from Standard;    
430         myWidthMapIsDefined: Boolean from Standard;    
431         myTypeMapIsDefined: Boolean from Standard;    
432         myFontMapIsDefined: Boolean from Standard;    
433         myMarkMapIsDefined: Boolean from Standard;    
434         myUseMFT: Boolean from Standard;
435     
436 end Driver from Aspect;