Open CASCADE Technology Reference Manual 8.0.0
Loading...
Searching...
No Matches
Static Public Member Functions
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: More...

#include <UnitsAPI.hxx>

Static Public Member Functions

static double CurrentToLS (const double aData, const char *const 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 double CurrentToSI (const double aData, const char *const 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 double CurrentFromLS (const double aData, const char *const 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 double CurrentFromSI (const double aData, const char *const 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 double AnyToLS (const double aData, const char *const 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 double AnyToLS (const double aData, const char *const aUnit, occ::handle< Units_Dimensions > &aDim)
 Converts the local unit value to the local system units value. and gives the associated dimension of the unit.
 
static double AnyToSI (const double aData, const char *const aUnit)
 Converts the local unit value to the SI system units value. Example: AnyToSI(1.,"in.") returns 0.0254.
 
static double AnyToSI (const double aData, const char *const aUnit, occ::handle< Units_Dimensions > &aDim)
 Converts the local unit value to the SI system units value. and gives the associated dimension of the unit.
 
static double AnyFromLS (const double aData, const char *const 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 double AnyFromSI (const double aData, const char *const 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 double CurrentToAny (const double aData, const char *const aQuantity, const char *const 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 double CurrentFromAny (const double aData, const char *const aQuantity, const char *const 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 double AnyToAny (const double aData, const char *const aUnit1, const char *const aUnit2)
 Converts the local unit value to another local unit value. Example: AnyToAny(0.0254,"in.","mm") returns 1. ;.
 
static double LSToSI (const double aData, const char *const 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 double SIToLS (const double aData, const char *const 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 void SetLocalSystem (const UnitsAPI_SystemUnits aSystemUnit=UnitsAPI_SI)
 Sets the local system units. Example: SetLocalSystem(UnitsAPI_MDTV)
 
static UnitsAPI_SystemUnits LocalSystem ()
 Returns the current local system units.
 
static void SetCurrentUnit (const char *const aQuantity, const char *const aUnit)
 Sets the current unit dimension <aUnit> to the unit quantity <aQuantity>. Example: SetCurrentUnit("LENGTH","mm")
 
static const charCurrentUnit (const char *const aQuantity)
 Returns the current unit dimension <aUnit> from the unit quantity <aQuantity>.
 
static void Save ()
 saves the units in the file .CurrentUnits of the directory pointed by the CSF_CurrentUnitsUserDefaults environment variable.
 
static void Reload ()
 
static occ::handle< Units_DimensionsDimensions (const char *const aQuantity)
 return the dimension associated to the quantity
 
static occ::handle< Units_DimensionsDimensionLess ()
 
static occ::handle< Units_DimensionsDimensionMass ()
 
static occ::handle< Units_DimensionsDimensionLength ()
 
static occ::handle< Units_DimensionsDimensionTime ()
 
static occ::handle< Units_DimensionsDimensionElectricCurrent ()
 
static occ::handle< Units_DimensionsDimensionThermodynamicTemperature ()
 
static occ::handle< Units_DimensionsDimensionAmountOfSubstance ()
 
static occ::handle< Units_DimensionsDimensionLuminousIntensity ()
 
static occ::handle< Units_DimensionsDimensionPlaneAngle ()
 
static occ::handle< Units_DimensionsDimensionSolidAngle ()
 Returns the basic dimensions.
 
static bool Check (const char *const aQuantity, const char *const aUnit)
 Checks the coherence between the quantity <aQuantity> and the unit <aUnits> in the current system and returns FALSE when it's WRONG.
 

Detailed Description

The UnitsAPI global functions are used to convert a value from any unit into another unit. Principles Conversion is executed among three unit systems:

Member Function Documentation

◆ AnyFromLS()

static double UnitsAPI::AnyFromLS ( const double aData,
const char *const aUnit )
static

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.

◆ AnyFromSI()

static double UnitsAPI::AnyFromSI ( const double aData,
const char *const aUnit )
static

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.

◆ AnyToAny()

static double UnitsAPI::AnyToAny ( const double aData,
const char *const aUnit1,
const char *const aUnit2 )
static

Converts the local unit value to another local unit value. Example: AnyToAny(0.0254,"in.","mm") returns 1. ;.

◆ AnyToLS() [1/2]

static double UnitsAPI::AnyToLS ( const double aData,
const char *const aUnit )
static

Converts the local unit value to the local system units value. Example: AnyToLS(1.,"in.") returns 25.4 if the LocalSystem is MDTV.

◆ AnyToLS() [2/2]

static double UnitsAPI::AnyToLS ( const double aData,
const char *const aUnit,
occ::handle< Units_Dimensions > & aDim )
static

Converts the local unit value to the local system units value. and gives the associated dimension of the unit.

◆ AnyToSI() [1/2]

static double UnitsAPI::AnyToSI ( const double aData,
const char *const aUnit )
static

Converts the local unit value to the SI system units value. Example: AnyToSI(1.,"in.") returns 0.0254.

◆ AnyToSI() [2/2]

static double UnitsAPI::AnyToSI ( const double aData,
const char *const aUnit,
occ::handle< Units_Dimensions > & aDim )
static

Converts the local unit value to the SI system units value. and gives the associated dimension of the unit.

◆ Check()

static bool UnitsAPI::Check ( const char *const aQuantity,
const char *const aUnit )
static

Checks the coherence between the quantity <aQuantity> and the unit <aUnits> in the current system and returns FALSE when it's WRONG.

◆ CurrentFromAny()

static double UnitsAPI::CurrentFromAny ( const double aData,
const char *const aQuantity,
const char *const aUnit )
static

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.

◆ CurrentFromLS()

static double UnitsAPI::CurrentFromLS ( const double aData,
const char *const aQuantity )
static

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.

◆ CurrentFromSI()

static double UnitsAPI::CurrentFromSI ( const double aData,
const char *const aQuantity )
static

Converts the SI system units value to the current unit value. Example: CurrentFromSI(0.001,"LENGTH") returns 1 if current length unit is millimeter.

◆ CurrentToAny()

static double UnitsAPI::CurrentToAny ( const double aData,
const char *const aQuantity,
const char *const aUnit )
static

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.

◆ CurrentToLS()

static double UnitsAPI::CurrentToLS ( const double aData,
const char *const aQuantity )
static

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.

◆ CurrentToSI()

static double UnitsAPI::CurrentToSI ( const double aData,
const char *const aQuantity )
static

Converts the current unit value to the SI system units value. Example: CurrentToSI(1.,"LENGTH") returns 0.001 if current length unit is millimeter.

◆ CurrentUnit()

static const char * UnitsAPI::CurrentUnit ( const char *const aQuantity)
static

Returns the current unit dimension <aUnit> from the unit quantity <aQuantity>.

◆ DimensionAmountOfSubstance()

static occ::handle< Units_Dimensions > UnitsAPI::DimensionAmountOfSubstance ( )
static

◆ DimensionElectricCurrent()

static occ::handle< Units_Dimensions > UnitsAPI::DimensionElectricCurrent ( )
static

◆ DimensionLength()

static occ::handle< Units_Dimensions > UnitsAPI::DimensionLength ( )
static

◆ DimensionLess()

static occ::handle< Units_Dimensions > UnitsAPI::DimensionLess ( )
static

◆ DimensionLuminousIntensity()

static occ::handle< Units_Dimensions > UnitsAPI::DimensionLuminousIntensity ( )
static

◆ DimensionMass()

static occ::handle< Units_Dimensions > UnitsAPI::DimensionMass ( )
static

◆ DimensionPlaneAngle()

static occ::handle< Units_Dimensions > UnitsAPI::DimensionPlaneAngle ( )
static

◆ Dimensions()

static occ::handle< Units_Dimensions > UnitsAPI::Dimensions ( const char *const aQuantity)
static

return the dimension associated to the quantity

◆ DimensionSolidAngle()

static occ::handle< Units_Dimensions > UnitsAPI::DimensionSolidAngle ( )
static

Returns the basic dimensions.

◆ DimensionThermodynamicTemperature()

static occ::handle< Units_Dimensions > UnitsAPI::DimensionThermodynamicTemperature ( )
static

◆ DimensionTime()

static occ::handle< Units_Dimensions > UnitsAPI::DimensionTime ( )
static

◆ LocalSystem()

static UnitsAPI_SystemUnits UnitsAPI::LocalSystem ( )
static

Returns the current local system units.

◆ LSToSI()

static double UnitsAPI::LSToSI ( const double aData,
const char *const aQuantity )
static

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.

◆ Reload()

static void UnitsAPI::Reload ( )
static

◆ Save()

static void UnitsAPI::Save ( )
static

saves the units in the file .CurrentUnits of the directory pointed by the CSF_CurrentUnitsUserDefaults environment variable.

◆ SetCurrentUnit()

static void UnitsAPI::SetCurrentUnit ( const char *const aQuantity,
const char *const aUnit )
static

Sets the current unit dimension <aUnit> to the unit quantity <aQuantity>. Example: SetCurrentUnit("LENGTH","mm")

◆ SetLocalSystem()

static void UnitsAPI::SetLocalSystem ( const UnitsAPI_SystemUnits aSystemUnit = UnitsAPI_SI)
static

Sets the local system units. Example: SetLocalSystem(UnitsAPI_MDTV)

◆ SIToLS()

static double UnitsAPI::SIToLS ( const double aData,
const char *const aQuantity )
static

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.


The documentation for this class was generated from the following file: