2 -- Created: Mon Jun 22 18:23:44 1992
3 -- Author: Gilles DEBARBOUILLE
5 -- Modified Wed Apr 2 14:10:05 1997 by Gerard GRAS
6 -- Add FirstQuantity access methods
7 -- Modified Mon Apr 7 16:52:40 1997 by Patrick BOSINCO
8 -- Add Dimensions access methods
9 ---Copyright: Matra Datavision 1992
14 ---Purpose: This package provides all the facilities to create
15 -- and question a dictionary of units, and also to
16 -- manipulate measurements which are real values with
30 class UtsSequence instantiates
31 Sequence from TCollection (Unit from Units);
32 class UnitsSequence instantiates
33 HSequence from TCollection(Unit from Units, UtsSequence);
35 private class ShiftedUnit;
41 class TksSequence instantiates
42 Sequence from TCollection (Token from Units);
43 class TokensSequence instantiates
44 HSequence from TCollection(Token from Units, TksSequence);
48 class QtsSequence instantiates
49 Sequence from TCollection (Quantity from Units);
50 class QuantitiesSequence instantiates
51 HSequence from TCollection(Quantity from Units, QtsSequence);
53 class UnitsDictionary;
59 private class Sentence;
61 private class MathSentence;
63 private class UnitSentence;
67 private class UnitsLexicon;
71 exception NoSuchUnit inherits NoSuchObject from Standard;
72 exception NoSuchType inherits NoSuchObject from Standard;
74 UnitsFile(afile : CString);
78 ---Purpose: Defines the location of the file containing all the
79 -- information useful in creating the dictionary of all
80 -- the units known to the system.
82 LexiconFile(afile : CString);
86 ---Purpose: Defines the location of the file containing the lexicon
87 -- useful in manipulating composite units.
89 DictionaryOfUnits(amode : Boolean = Standard_False) returns UnitsDictionary from Units;
93 ---Purpose: Returns a unique instance of the dictionary of units.
94 -- If <amode> is True, then it forces the recomputation of
95 -- the dictionary of units.
97 Quantity(aquantity : CString from Standard) returns Quantity from Units;
101 ---Purpose: Returns a unique quantity instance corresponding to <aquantity>.
103 FirstQuantity(aunit : CString from Standard) returns CString from Standard;
107 ---Purpose: Returns the first quantity string founded from the unit <aUnit>.
109 LexiconUnits(amode : Boolean = Standard_True) returns Lexicon from Units;
113 ---Purpose: Returns a unique instance of the Units_Lexicon.
114 -- If <amode> is True, it forces the recomputation of
115 -- the dictionary of units, and by consequence the
116 -- completion of the Units_Lexicon.
118 LexiconFormula returns Lexicon from Units;
122 ---Purpose: Return a unique instance of LexiconFormula.
124 NullDimensions returns Dimensions from Units;
128 ---Purpose: Returns always the same instance of Dimensions.
130 Convert(avalue : Real ; afirstunit , asecondunit : CString) returns Real;
134 ---Purpose: Converts <avalue> expressed in <afirstunit> into the <asecondunit>.
136 ToSI(aData: Real from Standard; aUnit: CString from Standard) returns Real from Standard;
138 ToSI(aData: Real from Standard; aUnit: CString from Standard;
139 aDim : out Dimensions from Units) returns Real from Standard;
141 FromSI(aData: Real from Standard; aUnit: CString from Standard) returns Real from Standard;
143 FromSI(aData: Real from Standard; aUnit: CString from Standard;
144 aDim : out Dimensions from Units ) returns Real from Standard;
146 Dimensions(aType : CString from Standard)
147 returns Dimensions from Units
148 raises NoSuchObject from Standard;
150 ---Purpose: return the dimension associated to the Type