HDK
|
#include <Unit.h>
Public Member Functions | |
virtual | ~LinearUnitConverter () |
const string & | getUnitType () const |
Return the unit type string. More... | |
void | write (DocumentPtr doc) const override |
Create unit definitions in a document based on the converter. More... | |
Conversion | |
const std::unordered_map < string, float > & | getUnitScale () const |
float | conversionRatio (const string &inputUnit, const string &outputUnit) const |
float | convert (float input, const string &inputUnit, const string &outputUnit) const override |
Vector2 | convert (const Vector2 &input, const string &inputUnit, const string &outputUnit) const override |
Vector3 | convert (const Vector3 &input, const string &inputUnit, const string &outputUnit) const override |
Vector4 | convert (const Vector4 &input, const string &inputUnit, const string &outputUnit) const override |
Shader Mapping | |
int | getUnitAsInteger (const string &unitName) const override |
virtual string | getUnitFromInteger (int index) const override |
Public Member Functions inherited from UnitConverter | |
UnitConverter () | |
virtual | ~UnitConverter () |
Static Public Member Functions | |
static LinearUnitConverterPtr | create (UnitTypeDefPtr UnitDef) |
Creator. More... | |
A converter class for linear units that require only a scalar multiplication.
|
inlinevirtual |
|
overridevirtual |
Convert a given value in a given unit to a desired unit
Implements UnitConverter.
|
overridevirtual |
Convert a given value in a given unit to a desired unit
Implements UnitConverter.
|
overridevirtual |
Convert a given value in a given unit to a desired unit
Implements UnitConverter.
|
overridevirtual |
Convert a given value in a given unit to a desired unit
Implements UnitConverter.
|
static |
Creator.
Given a unit name return a value that it can map to as an integer. Returns -1 value if not found
Reimplemented from UnitConverter.
Given an integer index return the unit name in the map used by the converter. Returns Empty string if not found
Reimplemented from UnitConverter.
|
inline |
|
overridevirtual |
Create unit definitions in a document based on the converter.
Implements UnitConverter.