32 #ifndef UnitSystemsManagerH 33 #define UnitSystemsManagerH 37 #include <zeusbase/System/ZObject.h> 40 #define UnitSystemsManager NAMESPACE_Zeus::TUnitSystemsManager::getInstance() 84 void releaseDelegationInterface();
94 if (m_ptrDelegation != NULL)
96 eRetval = m_ptrDelegation->getUnitSystem();
108 m_eUnitSystem = eUnitSystem;
109 if (m_ptrDelegation != NULL)
111 m_ptrDelegation->setUnitSystem(eUnitSystem);
119 TString getUnitText(
EUnit eUnit)
const;
122 static TString getUnitTextMetric(
EUnit eUnit);
125 static TString getUnitTextInch(
EUnit eUnit);
129 Float getConversionFactorToMetric(
EUnit eUnit)
const;
133 Float getConversionFactorFromMetric(
EUnit eUnit)
const;
137 void convertToMetric(Float& fValue,
EUnit eUnit,
138 bool bRound,
bool bExcludeZero =
false)
const;
142 void convertFromMetric(Float& fValue,
EUnit eUnit,
143 bool bRound,
bool bExcludeZero =
false)
const;
147 Float getConversionToMetric(
const Float& fValue,
EUnit eUnit,
148 bool bRound,
bool bExcludeZero =
false)
const;
152 Float getConversionFromMetric(
const Float& fValue,
EUnit eUnit,
153 bool bRound,
bool bExcludeZero =
false)
const;
156 static void round(Float& fValue,
const Float& fRoundingStep,
bool bExcludeZero);
159 void round(Float& rfValue,
bool bExcludeZero =
false);
162 static Int getStandardRoundingDigits(
EUnitSystem eUnitSystem);
168 static Float getStandardRoundingStep(
EUnitSystem eUnitSystem);
174 static TString getStandardRoundingFormat(
EUnitSystem eUnitSystem);
182 #define INVERSE(Method) Float(1) / Method() 193 static inline Float
mm_per_foot() {
return mm_per_inch() * inch_per_foot(); }
195 static inline Float
m_per_foot() {
return m_per_mm() * mm_per_foot(); }
198 static inline Float
mm2_per_inch2() {
return TMath::pow(mm_per_inch(), 2); }
201 static inline Float
mm3_per_inch3() {
return TMath::pow(mm_per_inch(), 3); }
213 static inline Float
gram_per_pound() {
return gram_per_ounce() * ounce_per_pound(); }
215 static inline Float
kilo_per_pound() {
return kilo_per_gram() * gram_per_pound(); }
232 TAutoPtr<IUnitSystemsManager> m_ptrDelegation;
243 inline TUnitSystemsManager::TUnitSystemsManager()
252 inline void TUnitSystemsManager::releaseDelegationInterface()
254 m_ptrDelegation.release();
266 inline Float TUnitSystemsManager::getConversionFactorFromMetric(
EUnit eUnit)
const 268 return Float(1) / getConversionFactorToMetric(eUnit);
283 inline Float TUnitSystemsManager::getConversionToMetric(
const Float& fValue,
EUnit eUnit,
284 bool bRound,
bool bExcludeZero )
const 286 Float fRetval = fValue;
287 convertToMetric(fRetval, eUnit, bRound, bExcludeZero);
303 inline Float TUnitSystemsManager::getConversionFromMetric(
const Float& fValue,
EUnit eUnit,
304 bool bRound,
bool bExcludeZero )
const 306 Float fRetval = fValue;
307 convertFromMetric(fRetval, eUnit, bRound, bExcludeZero);
Int getStandardRoundingDigits() const
Die Anzahl Nachkommastellen für die Standard-Rundung lesen.
Definition: UnitSystemsManager.h:165
EUnitSystem
Definition: IUnitSystemsManager.hpp:41
static Float mm3_per_inch3()
Definition: UnitSystemsManager.h:201
Definition: UnitSystemsManager.h:78
TString getStandardRoundingFormat() const
Das Standard-Rundungsformat im aktuell in StuderWIN eingestellten Einheitensystem lesen...
Definition: UnitSystemsManager.h:177
static Float kilo_per_newton()
Definition: UnitSystemsManager.h:220
void MQUALIFIER setUnitSystem(EUnitSystem eUnitSystem)
Definition: UnitSystemsManager.h:106
static Float inch2_per_mm2()
Definition: UnitSystemsManager.h:199
EUnit
Definition: UnitSystemsManager.h:44
Definition: UnitSystemsManager.h:65
Definition: UnitSystemsManager.h:64
static Float foot_per_m()
Definition: UnitSystemsManager.h:196
static Float pound_per_gram()
Definition: UnitSystemsManager.h:214
Definition: UnitSystemsManager.h:51
Definition: UnitSystemsManager.h:54
static Float m_per_mm()
Definition: UnitSystemsManager.h:186
static Float s_per_min()
Definition: UnitSystemsManager.h:204
static Float m_per_foot()
Definition: UnitSystemsManager.h:195
Definition: UnitSystemsManager.h:58
static Float mm_per_inch()
Definition: UnitSystemsManager.h:189
static Float min_per_s()
Definition: UnitSystemsManager.h:205
Definition: UnitSystemsManager.h:53
Definition: UnitSystemsManager.h:68
Definition: UnitSystemsManager.h:61
Definition: UnitSystemsManager.h:46
Definition: IUnitSystemsManager.hpp:55
Definition: UnitSystemsManager.h:59
static Float foot_per_inch()
Definition: UnitSystemsManager.h:192
static Float pound_per_ounce()
Definition: UnitSystemsManager.h:212
Float getStandardRoundingStep() const
Den Standard-Rundungsschritt im aktuell in StuderWIN eingestellten Einheitensystem lesen...
Definition: UnitSystemsManager.h:171
#define INVERSE(Method)
UMRECHNUNGSFAKTOREN ///.
Definition: UnitSystemsManager.h:182
EUnitSystem MQUALIFIER getUnitSystem() const
Definition: UnitSystemsManager.h:90
static Float ounce_per_pound()
Definition: UnitSystemsManager.h:211
Definition: IUnitSystemsManager.hpp:43
static Float um_per_mm()
Definition: UnitSystemsManager.h:187
static Float foot_per_mm()
Definition: UnitSystemsManager.h:194
Definition: UnitSystemsManager.h:48
static Float newton_per_pound()
Definition: UnitSystemsManager.h:221
static Float mm_per_um()
Definition: UnitSystemsManager.h:188
static Float earthGravity_ms2()
Definition: UnitSystemsManager.h:218
static Float gram_per_kilo()
Definition: UnitSystemsManager.h:207
Definition: UnitSystemsManager.h:63
Definition: UnitSystemsManager.h:49
Definition: UnitSystemsManager.h:60
Definition: UnitSystemsManager.h:55
Definition: UnitSystemsManager.h:66
static Float inch_per_foot()
Definition: UnitSystemsManager.h:191
Definition: UnitSystemsManager.h:47
Definition: UnitSystemsManager.h:67
static Float ounce_per_gram()
Definition: UnitSystemsManager.h:210
static Float newton_per_kilo()
Definition: UnitSystemsManager.h:219
static Float kilo_per_pound()
Definition: UnitSystemsManager.h:215
static Float gram_per_ounce()
Definition: UnitSystemsManager.h:209
static Float pound_per_kilo()
Definition: UnitSystemsManager.h:216
static Float gram_per_pound()
Definition: UnitSystemsManager.h:213
static Float inch_per_mm()
Definition: UnitSystemsManager.h:190
static Float inch3_per_mm3()
Definition: UnitSystemsManager.h:202
Definition: UnitSystemsManager.h:52
static Float mm_per_foot()
Definition: UnitSystemsManager.h:193
Definition: UnitSystemsManager.h:56
Definition: UnitSystemsManager.h:57
static Float mm_per_m()
Definition: UnitSystemsManager.h:185
static Float kilo_per_gram()
Definition: UnitSystemsManager.h:208
static Float mm2_per_inch2()
Definition: UnitSystemsManager.h:198
Definition: UnitSystemsManager.h:50
static TUnitSystemsManager & getInstance()
Statische Singleton-Instanz holen.
Definition: UnitSystemsManager.h:82
static Float pound_per_newton()
Definition: UnitSystemsManager.h:222
Definition: UnitSystemsManager.h:62