#include <Unit.h>
|
enum class | Prefix {
Yotta
, Zetta
, Exa
, Peta
,
Tera
, Giga
, Mega
, Kilo
,
Hecto
, Deca
, Base
, Deci
,
Centi
, Milli
, Micro
, Nano
,
Pico
, Femto
, Atto
, Zepto
,
Yocto
} |
|
Define a Unit following the International System of Units and the http://www.w3.org/2007/ont/unit# ontology.
◆ base()
Unit Unit::base |
( |
| ) |
const |
- Returns
- if the base of the unit, i.e., for millimetre, return metre, for millimetre/second return metre/second
◆ baseUnits()
◆ byName()
◆ bySymbol()
- Returns
- unit given a symbol
◆ byUri()
◆ derivedUnits()
◆ isValid()
bool Unit::isValid |
( |
| ) |
const |
◆ name()
QString Unit::name |
( |
| ) |
const |
- Returns
- the name of the unit (i.e. metre, second...)
◆ operator*()
- Returns
- the unit obtained from multiplying two units, or an error if the unit does not exists
◆ operator/()
- Returns
- the unit obtained from dividing two units, or an error if the unit does not exists
◆ operator==()
bool Unit::operator== |
( |
const Unit & | _unit | ) |
const |
- Returns
- true if two units are identical
◆ prefixName()
QString Unit::prefixName |
( |
Prefix | p | ) |
|
|
static |
The name corresponding to the prefix.
◆ prefixScale()
qreal Unit::prefixScale |
( |
Prefix | p | ) |
|
|
static |
The scale corresponding to the prefix.
◆ prefixSymbol()
QString Unit::prefixSymbol |
( |
Prefix | p | ) |
|
|
static |
The symbol corresponding to the prefix.
◆ scale()
qreal Unit::scale |
( |
| ) |
const |
- Returns
- the scale of the unit in relation to the base, i.e. how much to multiply a value express in this unit to obtain the value in the base unit ( value in this is equal to scale * value in the base). For millimetre this will return 1e-3.
◆ symbol()
QString Unit::symbol |
( |
| ) |
const |
- Returns
- the symbol that correspond to this unit (i.e. m, mm, m/s, mm^2, km^2...)
◆ uri()
The documentation for this class was generated from the following files:
- knowl/src/knowCore/Unit.h
- knowl/src/knowCore/Unit.cpp