#include <UnitSystem.H>
Collaboration diagram for UnitSystem:
Public Methods | |
UnitSystem () | |
~UnitSystem () | |
void | name ( const char* ) |
const char* | name () const |
void | abbr ( const char* ) |
const char* | abbr () const |
void | description ( const char* ) |
const char* | description () const |
bool | addSpec ( const DimensionGroup* dg, const char* spec ) |
bool | getSpec ( Quantity& result, const DimensionGroup* dg ) |
bool | convert ( Quantity& result, const Quantity& source ) |
const UnitSystem* | next () const |
Private Attributes | |
char* | m_name |
char* | m_abbr |
char* | m_desc |
map< const DimensionGroup*, Quantity > | m_specs |
UnitSystem* | m_next |
Static Private Attributes | |
UnitSystem* | theUnitSystems = 0 |
|
Convert a quantity into acceptable units for the UnitSystem. In addition to converting into the specified units for the system, this routine should handle different styles of prefixes based on the magnitude of the result. For instance, the spec may call for viscosity in "Pa s". The user may prefer "mPa s" when the result is < 1 Pa s and >= .001 Pa s. This is a sticky problem, however, since we may have some (or all) units raised to powers. It may be impossible to get a good result (example: 0.9 m^2 is < 1, but is 900000 mm^2). |
![]() |
C++ Reference Manual | 20010520 |