OCC Main Page | FoundationClasses | Toolkits | Packages | Class Hierarchy | Data Structures | File List | Data Fields | Globals

FoundationClasses
TKernel
UnitsAPI


UnitsAPI Class Reference

The UnitsAPI global functions are used to
convert a value from any unit into another unit.
Principles
Conversion is executed among three unit systems:
- the SI System
- the user's Local System
- the user's Current System.
The SI System is the standard international unit
system. It is indicated by SI in the synopses of
the UnitsAPI functions.
The MDTV System corresponds to the SI
international standard but the length unit and all
its derivatives use millimeters instead of the meters.
Both systems are proposed by Open CASCADE;
the SI System is the standard option. By
selecting one of these two systems, the user
defines his Local System through the
SetLocalSystem function. The Local System is
indicated by LS in the synopses of the UnitsAPI functions.
The user's Local System units can be modified in
the working environment. The user defines his
Current System by modifying its units through
the SetCurrentUnit function. The Current
System is indicated by Current in the synopses
of the UnitsAPI functions.
.

#include <UnitsAPI.hxx>


Public Member Functions

void * operator new (size_t, void *anAddress)
void * operator new (size_t size)
void operator delete (void *anAddress)

Static Public Member Functions

static Standard_EXPORT Standard_Real CurrentToLS (const Standard_Real aData, const Standard_CString aQuantity)
 Converts the current unit value to the local system units value.
Example: CurrentToLS(1.,"LENGTH") returns 1000. if the current length unit
is meter and LocalSystem is MDTV.
.
static Standard_EXPORT Standard_Real CurrentToSI (const Standard_Real aData, const Standard_CString aQuantity)
 Converts the current unit value to the SI system units value.
Example: CurrentToSI(1.,"LENGTH") returns 0.001 if current length unit
is millimeter.
.
static Standard_EXPORT Standard_Real CurrentFromLS (const Standard_Real aData, const Standard_CString aQuantity)
 Converts the local system units value to the current unit value.
Example: CurrentFromLS(1000.,"LENGTH") returns 1. if current length unit
is meter and LocalSystem is MDTV.
.
static Standard_EXPORT Standard_Real CurrentFromSI (const Standard_Real aData, const Standard_CString aQuantity)
 Converts the SI system units value to the current unit value.
Example: CurrentFromSI(0.001,"LENGTH") returns 1 if current length unit
is millimeter.
.
static Standard_EXPORT Standard_Real AnyToLS (const Standard_Real aData, const Standard_CString aUnit)
 Converts the local unit value to the local system units value.
Example: AnyToLS(1.,"in.") returns 25.4 if the LocalSystem is MDTV.
.
static Standard_EXPORT Standard_Real AnyToLS (const Standard_Real aData, const Standard_CString aUnit, Handle(Units_Dimensions)&aDim)
 Converts the local unit value to the local system units value.
and gives the associated dimension of the unit
.
static Standard_EXPORT Standard_Real AnyToSI (const Standard_Real aData, const Standard_CString aUnit)
 Converts the local unit value to the SI system units value.
Example: AnyToSI(1.,"in.") returns 0.0254
.
static Standard_EXPORT Standard_Real AnyToSI (const Standard_Real aData, const Standard_CString aUnit, Handle(Units_Dimensions)&aDim)
 Converts the local unit value to the SI system units value.
and gives the associated dimension of the unit
.
static Standard_EXPORT Standard_Real AnyFromLS (const Standard_Real aData, const Standard_CString aUnit)
 Converts the local system units value to the local unit value.
Example: AnyFromLS(25.4,"in.") returns 1. if the LocalSystem is MDTV.
Note: aUnit is also used to identify the type of physical quantity to convert.
.
static Standard_EXPORT Standard_Real AnyFromSI (const Standard_Real aData, const Standard_CString aUnit)
 Converts the SI system units value to the local unit value.
Example: AnyFromSI(0.0254,"in.") returns 0.001
Note: aUnit is also used to identify the type of physical quantity to convert.
.
static Standard_EXPORT Standard_Real CurrentToAny (const Standard_Real aData, const Standard_CString aQuantity, const Standard_CString aUnit)
 Converts the aData value expressed in the
current unit for the working environment, as
defined for the physical quantity aQuantity by the
last call to the SetCurrentUnit function, into the unit aUnit.
.
static Standard_EXPORT Standard_Real CurrentFromAny (const Standard_Real aData, const Standard_CString aQuantity, const Standard_CString aUnit)
 Converts the aData value expressed in the unit
aUnit, into the current unit for the working
environment, as defined for the physical quantity
aQuantity by the last call to the SetCurrentUnit function.
.
static Standard_EXPORT Standard_Real AnyToAny (const Standard_Real aData, const Standard_CString aUnit1, const Standard_CString aUnit2)
 Converts the local unit value to another local unit value.
Example: AnyToAny(0.0254,"in.","millimeter") returns 1. ;
.
static Standard_EXPORT Standard_Real LSToSI (const Standard_Real aData, const Standard_CString aQuantity)
 Converts the local system units value to the SI system unit value.
Example: LSToSI(1.,"LENGTH") returns 0.001 if the local system
length unit is millimeter.
.
static Standard_EXPORT Standard_Real SIToLS (const Standard_Real aData, const Standard_CString aQuantity)
 Converts the SI system unit value to the local system units value.
Example: SIToLS(1.,"LENGTH") returns 1000. if the local system
length unit is millimeter.
.
static Standard_EXPORT void SetLocalSystem (const UnitsAPI_SystemUnits aSystemUnit=UnitsAPI_SI)
 Sets the local system units.
Example: SetLocalSystem(UnitsAPI_MDTV)
.
static Standard_EXPORT UnitsAPI_SystemUnits LocalSystem ()
 Returns the current local system units.
.
static Standard_EXPORT void SetCurrentUnit (const Standard_CString aQuantity, const Standard_CString aUnit)
 Sets the current unit dimension <aunit> to the unit quantity <aquantity>.
Example: SetCurrentUnit("LENGTH","millimeter")
.
static Standard_EXPORT Standard_CString CurrentUnit (const Standard_CString aQuantity)
 Returns the current unit dimension <aunit> from the unit quantity <aquantity>.
.
static Standard_EXPORT void Save ()
 saves the units in the file .CurrentUnits of the directory pointed by the
CSF_CurrentUnitsUserDefaults environment variable.

static Standard_EXPORT void Reload ()
static Standard_EXPORT Handle_Units_Dimensions Dimensions (const Standard_CString aQuantity)
 return the dimension associated to the quantity

static Standard_EXPORT Handle_Units_Dimensions DimensionLess ()
static Standard_EXPORT Handle_Units_Dimensions DimensionMass ()
static Standard_EXPORT Handle_Units_Dimensions DimensionLength ()
static Standard_EXPORT Handle_Units_Dimensions DimensionTime ()
static Standard_EXPORT Handle_Units_Dimensions DimensionElectricCurrent ()
static Standard_EXPORT Handle_Units_Dimensions DimensionThermodynamicTemperature ()
static Standard_EXPORT Handle_Units_Dimensions DimensionAmountOfSubstance ()
static Standard_EXPORT Handle_Units_Dimensions DimensionLuminousIntensity ()
static Standard_EXPORT Handle_Units_Dimensions DimensionPlaneAngle ()
static Standard_EXPORT Handle_Units_Dimensions DimensionSolidAngle ()
 Returns the basic dimensions.
.
static Standard_EXPORT Standard_Boolean Check (const Standard_CString aQuantity, const Standard_CString aUnit)
 Checks the coherence between the quantity <aquantity>
and the unit <aunits> in the current system and
returns FALSE when it's WRONG.
.

Static Private Member Functions

static Standard_EXPORT void CheckLoading (const UnitsAPI_SystemUnits aSystemUnit)


Member Function Documentation

static Standard_EXPORT Standard_Real UnitsAPI::AnyFromLS const Standard_Real  aData,
const Standard_CString  aUnit
[static]
 

static Standard_EXPORT Standard_Real UnitsAPI::AnyFromSI const Standard_Real  aData,
const Standard_CString  aUnit
[static]
 

static Standard_EXPORT Standard_Real UnitsAPI::AnyToAny const Standard_Real  aData,
const Standard_CString  aUnit1,
const Standard_CString  aUnit2
[static]
 

static Standard_EXPORT Standard_Real UnitsAPI::AnyToLS const Standard_Real  aData,
const Standard_CString  aUnit,
Handle(Units_Dimensions)&  aDim
[static]
 

static Standard_EXPORT Standard_Real UnitsAPI::AnyToLS const Standard_Real  aData,
const Standard_CString  aUnit
[static]
 

static Standard_EXPORT Standard_Real UnitsAPI::AnyToSI const Standard_Real  aData,
const Standard_CString  aUnit,
Handle(Units_Dimensions)&  aDim
[static]
 

static Standard_EXPORT Standard_Real UnitsAPI::AnyToSI const Standard_Real  aData,
const Standard_CString  aUnit
[static]
 

static Standard_EXPORT Standard_Boolean UnitsAPI::Check const Standard_CString  aQuantity,
const Standard_CString  aUnit
[static]
 

static Standard_EXPORT void UnitsAPI::CheckLoading const UnitsAPI_SystemUnits  aSystemUnit  )  [static, private]
 

static Standard_EXPORT Standard_Real UnitsAPI::CurrentFromAny const Standard_Real  aData,
const Standard_CString  aQuantity,
const Standard_CString  aUnit
[static]
 

static Standard_EXPORT Standard_Real UnitsAPI::CurrentFromLS const Standard_Real  aData,
const Standard_CString  aQuantity
[static]
 

static Standard_EXPORT Standard_Real UnitsAPI::CurrentFromSI const Standard_Real  aData,
const Standard_CString  aQuantity
[static]
 

static Standard_EXPORT Standard_Real UnitsAPI::CurrentToAny const Standard_Real  aData,
const Standard_CString  aQuantity,
const Standard_CString  aUnit
[static]
 

static Standard_EXPORT Standard_Real UnitsAPI::CurrentToLS const Standard_Real  aData,
const Standard_CString  aQuantity
[static]
 

static Standard_EXPORT Standard_Real UnitsAPI::CurrentToSI const Standard_Real  aData,
const Standard_CString  aQuantity
[static]
 

static Standard_EXPORT Standard_CString UnitsAPI::CurrentUnit const Standard_CString  aQuantity  )  [static]
 

static Standard_EXPORT Handle_Units_Dimensions UnitsAPI::DimensionAmountOfSubstance  )  [static]
 

static Standard_EXPORT Handle_Units_Dimensions UnitsAPI::DimensionElectricCurrent  )  [static]
 

static Standard_EXPORT Handle_Units_Dimensions UnitsAPI::DimensionLength  )  [static]
 

static Standard_EXPORT Handle_Units_Dimensions UnitsAPI::DimensionLess  )  [static]
 

static Standard_EXPORT Handle_Units_Dimensions UnitsAPI::DimensionLuminousIntensity  )  [static]
 

static Standard_EXPORT Handle_Units_Dimensions UnitsAPI::DimensionMass  )  [static]
 

static Standard_EXPORT Handle_Units_Dimensions UnitsAPI::DimensionPlaneAngle  )  [static]
 

static Standard_EXPORT Handle_Units_Dimensions UnitsAPI::Dimensions const Standard_CString  aQuantity  )  [static]
 

static Standard_EXPORT Handle_Units_Dimensions UnitsAPI::DimensionSolidAngle  )  [static]
 

static Standard_EXPORT Handle_Units_Dimensions UnitsAPI::DimensionThermodynamicTemperature  )  [static]
 

static Standard_EXPORT Handle_Units_Dimensions UnitsAPI::DimensionTime  )  [static]
 

static Standard_EXPORT UnitsAPI_SystemUnits UnitsAPI::LocalSystem  )  [static]
 

static Standard_EXPORT Standard_Real UnitsAPI::LSToSI const Standard_Real  aData,
const Standard_CString  aQuantity
[static]
 

void UnitsAPI::operator delete void *  anAddress  )  [inline]
 

void* UnitsAPI::operator new size_t  size  )  [inline]
 

void* UnitsAPI::operator new size_t  ,
void *  anAddress
[inline]
 

static Standard_EXPORT void UnitsAPI::Reload  )  [static]
 

static Standard_EXPORT void UnitsAPI::Save  )  [static]
 

static Standard_EXPORT void UnitsAPI::SetCurrentUnit const Standard_CString  aQuantity,
const Standard_CString  aUnit
[static]
 

static Standard_EXPORT void UnitsAPI::SetLocalSystem const UnitsAPI_SystemUnits  aSystemUnit = UnitsAPI_SI  )  [static]
 

static Standard_EXPORT Standard_Real UnitsAPI::SIToLS const Standard_Real  aData,
const Standard_CString  aQuantity
[static]
 


The documentation for this class was generated from the following file:
Generated on Mon Aug 25 13:14:16 2008 for OpenCASCADE by  doxygen 1.4.1