1 -- Created on: 2002-02-20
2 -- Created by: Andrey BETENEV
3 -- Copyright (c) 2002-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 under
8 -- the terms of the GNU Lesser General Public License 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.
16 class ProgressScale from Message
18 ---Purpose: Internal data structure for scale in ProgressIndicator
20 -- Basically it defines three things:
21 -- - name that can be used for generating user messages
22 -- - limits and characteristics of the current scale,
23 -- along with derived coefficients to map it into basic scale [0-1]
24 -- - methods for conversion of values from current scale
25 -- to basic one and back
27 -- NOTE: There is no special protection against bad input data
28 -- like min > max etc. except cases when it can cause exception
31 HAsciiString from TCollection
34 Create returns ProgressScale from Message;
35 ---Purpose: Creates scale ranged from 0 to 100 with step 1
37 ---Scope: Access to fields
39 SetName(me : out; theName : CString);
41 SetName(me : out; theName : HAsciiString from TCollection);
43 ---Purpose: Sets scale name
45 GetName(me) returns HAsciiString from TCollection;
47 ---Purpose: Gets scale name
48 -- Name may be Null handle if not set
50 SetMin(me : out; theMin : Real);
52 ---Purpose: Sets minimum value of scale
54 GetMin(me) returns Real;
56 ---Purpose: Gets minimum value of scale
58 SetMax(me : out; theMax : Real);
60 ---Purpose: Sets minimum value of scale
62 GetMax(me) returns Real;
64 ---Purpose: Gets minimum value of scale
66 SetRange (me: out; min, max: Real);
68 ---Purpose: Set both min and max
70 SetStep(me : out; theStep : Real);
72 ---Purpose: Sets default step
74 GetStep(me) returns Real;
76 ---Purpose: Gets default step
78 SetInfinite(me : out; theInfinite : Boolean = Standard_True);
80 ---Purpose: Sets flag for infinite scale
82 GetInfinite(me) returns Boolean;
84 ---Purpose: Gets flag for infinite scale
86 SetScale (me: out; min, max, step: Real; theInfinite : Boolean = Standard_True);
88 ---Purpose: Set all scale parameters
90 ---Scope: Mapping to base scale
92 SetSpan (me: out; first, last: Real);
94 ---Purpose: Defines span occupied by the scale on the basis scale
96 GetFirst (me) returns Real;
98 GetLast (me) returns Real;
100 ---Purpose: Return information on span occupied by the scale on the base scale
102 LocalToBase (me; val: Real) returns Real;
103 BaseToLocal (me; val: Real) returns Real;
104 ---Purpose: Convert value from this scale to base one and back
108 myName: HAsciiString from TCollection; -- name
110 myMin, myMax: Real; -- range of a scale
111 myStep : Real; -- default step
112 myInfinite: Boolean; -- flag for infinite scale
114 myFirst, myLast : Real; -- span on base scale