Omnidome
Fulldome Mapping Software Toolkit
|
An encapsulation for length units. More...
#include <LengthUnit.h>
Public Types | |
enum | Type { METER, MILLIMETER, CENTIMETER, INCH, FOOT, NUM_UNIT_TYPES, INVALID_UNIT = -1 } |
Supported unit types. More... | |
Public Member Functions | |
LengthUnit (Type=METER) | |
Make a new unit with a certain type. More... | |
LengthUnit (QString const &) | |
Make a new unit from abbreviation type. More... | |
QString | abbreviation () const |
Return abbreviation of unit. More... | |
Type | type () const |
Return type of unit. More... | |
void | setType (Type) |
Set type of unit. More... | |
QString | nameSingular () const |
Return singular name of unit. More... | |
QString | namePlural () const |
Return plural name of unit. More... | |
void | fromStream (QDataStream &) |
Deserialize from stream. More... | |
void | toStream (QDataStream &) const |
Serialize to stream. More... | |
Static Public Member Functions | |
static QString | abbreviation (Type) |
Return abbreviation for unit with type. More... | |
static Type | type (QString const &abbr) |
Get unit type from abbreviation. More... | |
static QString | nameSingular (Type) |
Return singular name of unit with type. More... | |
static QString | namePlural (Type) |
Return plural name of unit with type. More... | |
Private Types | |
typedef std::map< Type, QString > | map_type |
Private Attributes | |
Type | type_ |
Friends | |
bool | operator== (LengthUnit const &, LengthUnit const &) |
Test for equality. ScreenSetup is ignored. More... | |
An encapsulation for length units.
|
private |
Make a new unit with a certain type.
omni::LengthUnit::LengthUnit | ( | QString const & | _abbr | ) |
Make a new unit from abbreviation type.
|
static |
Return abbreviation for unit with type.
QString omni::LengthUnit::abbreviation | ( | ) | const |
Return abbreviation of unit.
void omni::LengthUnit::fromStream | ( | QDataStream & | _is | ) |
Deserialize from stream.
|
static |
Return plural name of unit with type.
QString omni::LengthUnit::namePlural | ( | ) | const |
Return plural name of unit.
|
static |
Return singular name of unit with type.
QString omni::LengthUnit::nameSingular | ( | ) | const |
Return singular name of unit.
void omni::LengthUnit::setType | ( | Type | _type | ) |
Set type of unit.
void omni::LengthUnit::toStream | ( | QDataStream & | _os | ) | const |
Serialize to stream.
|
static |
Get unit type from abbreviation.
LengthUnit::Type omni::LengthUnit::type | ( | ) | const |
Return type of unit.
|
friend |
Test for equality. ScreenSetup is ignored.
|
private |