7fd59977 |
1 | -- File: IGESSelect_FloatFormat.cdl |
2 | -- Created: Wed Jun 1 16:04:47 1994 |
3 | -- Author: Christian CAILLET |
4 | -- <cky@bravox> |
5 | ---Copyright: Matra Datavision 1994 |
6 | |
7 | |
8 | class FloatFormat from IGESSelect inherits FileModifier from IGESSelect |
9 | |
10 | ---Purpose : This class gives control out format for floatting values : |
11 | -- ZeroSuppress or no, Main Format, Format in Range (for values |
12 | -- around 1.), as IGESWriter allows to manage it. |
13 | -- Formats are given under C-printf form |
14 | |
15 | uses CString, AsciiString from TCollection, |
16 | IGESWriter , ContextWrite |
17 | |
18 | is |
19 | |
20 | Create returns mutable FloatFormat; |
21 | ---Purpose : Creates a new FloatFormat, with standard options : |
22 | -- ZeroSuppress, Main Format = %E, |
23 | -- Format between 0.001 and 1000. = %f |
24 | |
25 | SetDefault (me : mutable; digits : Integer = 0); |
26 | ---Purpose : Sets FloatFormat to default value (see Create) but if <digits> |
27 | -- is given positive, it commands Formats (main and range) to |
28 | -- ensure <digits> significant digits to be displayed |
29 | |
30 | SetZeroSuppress (me : mutable; mode : Boolean); |
31 | ---Purpose : Sets ZeroSuppress mode to a new value |
32 | |
33 | SetFormat (me : mutable; format : CString = "%E"); |
34 | ---Purpose : Sets Main Format to a new value |
35 | -- Remark : SetFormat, SetZeroSuppress and SetFormatForRange are |
36 | -- independant |
37 | |
38 | SetFormatForRange (me : mutable; format : CString = "%f"; |
39 | Rmin : Real = 0.1; Rmax : Real = 1000.0); |
40 | ---Purpose : Sets Format for Range to a new value with its range of |
41 | -- application. |
42 | -- To cancel it, give format as "" (empty string) |
43 | -- Remark that if the condition (0. < Rmin < Rmax) is not |
44 | -- verified, this secondary format will be ignored. |
45 | -- Moreover, this secondary format is intended to be used in a |
46 | -- range around 1. |
47 | |
48 | |
49 | Format (me; zerosup : out Boolean; |
50 | mainform : out AsciiString from TCollection; |
51 | hasrange : out Boolean; |
52 | forminrange : out AsciiString from TCollection; |
53 | rangemin, rangemax : out Real); |
54 | ---Purpose : Returns all recorded parameters : |
55 | -- zerosup : ZeroSuppress status |
56 | -- mainform : Main Format (which applies out of the range, or |
57 | -- for every real if no range is set) |
58 | -- hasrange : True if a FormatInRange is set, False else |
59 | -- (following parameters do not apply if it is False) |
60 | -- forminrange : Secondary Format (it applies inside the range) |
61 | -- rangemin, rangemax : the range in which the secondary format |
62 | -- applies |
63 | |
64 | |
65 | Perform (me; ctx : in out ContextWrite; |
66 | writer : in out IGESWriter); |
67 | ---Purpose : Sets the Floatting Formats of IGESWriter to the recorded |
68 | -- parameters |
69 | |
70 | Label (me) returns AsciiString from TCollection; |
71 | ---Purpose : Returns specific Label : for instance, |
72 | -- "Float Format [ZeroSuppress] %E [, in range R1-R2 %f]" |
73 | |
74 | fields |
75 | |
76 | thezerosup : Boolean; |
77 | themainform : AsciiString from TCollection; |
78 | theformrange : AsciiString from TCollection; |
79 | therangemin : Real; |
80 | therangemax : Real; |
81 | |
82 | end FloatFormat; |
83 | |