A singleton class to hold the "internal" unit.
It also gives us names/units association and ways of searching using the names and getting the names back. Using "int" instead of awUtil::LinearUnits::System enum for easier python access.
#include <UserUnitsLength.h>
Public Member Functions |
|
int | getTotalUnits () const |
int | getInternal () const |
awString::IString | getInternalShortName () const |
awString::IString | getInternalLongName () const |
void | setInternal (int) |
void | setInternal (const awString::IString &) |
double | internalToGiven (double, int) const |
double | internalToGiven (double, const awString::IString &) const |
double | givenToInternal (double, int) const |
double | givenToInternal (double, const awString::IString &) const |
awString::IString | getShortName (int) const |
The names for units: |
|
awString::IString | getLongName (int) const |
int | findByName (const awString::IString &) const |
Return -1 if we can't find it. |
|
int | getTotalNames () const |
Should be the same as
getTotalUnits(). |
|
Static Public Member Functions |
|
static UserUnitsLength & | instance () |
static void | destruct () |
static UserUnitsLength& instance | ( | ) | [static] |
static void destruct | ( | ) | [static] |
int getTotalUnits | ( | ) | const |
int getInternal | ( | ) | const |
awString::IString getInternalShortName | ( | ) | const |
awString::IString getInternalLongName | ( | ) | const |
void setInternal | ( | int | ) |
void setInternal | ( | const awString::IString & | ) |
double internalToGiven | ( | double | , |
int | |||
) | const |
double internalToGiven | ( | double | , |
const awString::IString & | |||
) | const |
double givenToInternal | ( | double | , |
int | |||
) | const |
double givenToInternal | ( | double | , |
const awString::IString & | |||
) | const |
awString::IString getShortName | ( | int | ) | const |
The names for units:
awString::IString getLongName | ( | int | ) | const |
int findByName | ( | const awString::IString & | ) | const |
Return -1 if we can't find it.
int getTotalNames | ( | ) | const |
Should be the same as getTotalUnits().
Logic error otherwise. Mostly here for unit testing.