MaterialX 1.39.1
|
An abstract base class for unit converters. More...
#include <Unit.h>
Public Member Functions | |
virtual float | convert (float input, const string &inputUnit, const string &outputUnit) const =0 |
Convert a given value in a given unit to a desired unit. More... | |
virtual int | getUnitAsInteger (const string &) const |
Given a unit name return a value that it can map to as an integer Returns -1 value if not found. More... | |
virtual string | getUnitFromInteger (int) const |
Given an integer index return the unit name in the map used by the converter Returns Empty string if not found. More... | |
virtual Vector2 | convert (const Vector2 &input, const string &inputUnit, const string &outputUnit) const =0 |
Convert a given value in a given unit to a desired unit. More... | |
virtual Vector3 | convert (const Vector3 &input, const string &inputUnit, const string &outputUnit) const =0 |
Convert a given value in a given unit to a desired unit. More... | |
virtual Vector4 | convert (const Vector4 &input, const string &inputUnit, const string &outputUnit) const =0 |
Convert a given value in a given unit to a desired unit. More... | |
virtual void | write (DocumentPtr doc) const =0 |
Create unit definitions in a document based on the converter. More... | |
An abstract base class for unit converters.
Each unit converter instance is responsible for a single unit type.
|
pure virtual |
Convert a given value in a given unit to a desired unit.
Implemented in LinearUnitConverter.
|
pure virtual |
Convert a given value in a given unit to a desired unit.
Implemented in LinearUnitConverter.
|
pure virtual |
Convert a given value in a given unit to a desired unit.
Implemented in LinearUnitConverter.
|
pure virtual |
Convert a given value in a given unit to a desired unit.
Implemented in LinearUnitConverter.
|
inlinevirtual |
Given a unit name return a value that it can map to as an integer Returns -1 value if not found.
Reimplemented in LinearUnitConverter.
|
inlinevirtual |
Given an integer index return the unit name in the map used by the converter Returns Empty string if not found.
Reimplemented in LinearUnitConverter.
|
pure virtual |
Create unit definitions in a document based on the converter.
Implemented in LinearUnitConverter.