Om
1.0.0
A universal framework for multimedia simulation
|
A class that represents the scaling curve to use when displaying a value. More...
#include <omGraphicsGUIValueCurve.h>
Public Types | |
enum | Enum { LINEAR = 0, LOGARITHMIC = 1, SQUARE = 2, SQUARE_ROOT = 3, CUBE = 4, CUBE_ROOT = 5 } |
An enum that specifies the different kinds of curves. More... | |
Public Member Functions | |
ValueCurve () | |
Create a new value curve with the default curve - linear. More... | |
ValueCurve (Enum newType) | |
Create a new value curve using the specified value curve type enum value. More... | |
operator Enum () const | |
Convert this value curve type to an enum value. More... | |
Float | evaluate (Float a, const AABB1f &range=AABB1f(0.0f, 1.0f)) const |
Apply this curve to a value with the specified linear parameter from 0 to 1 and output range. More... | |
Double | evaluate (Double a, const AABB1d &range=AABB1d(0.0f, 1.0f)) const |
Float | evaluateInverse (Float value, const AABB1f &range=AABB1f(0.0f, 1.0f)) const |
Apply this curve to a value in reverse with the specified value and input range. More... | |
Double | evaluateInverse (Double value, const AABB1d &range=AABB1d(0.0f, 1.0f)) const |
String | toString () const |
Return a string representation of the value curve type. More... | |
operator String () const | |
Convert this value curve type into a string representation. More... | |
Static Public Member Functions | |
static Float | transform (Float value, const AABB1f &range, ValueCurve curve) |
Transform a 1D value in the given range by the specified value curve. More... | |
static Vector2f | transform (const Vector2f &value, const AABB2f &range, ValueCurve xCurve, ValueCurve yCurve) |
Transform a 2D value in the given range by the specified value curve. More... | |
static Vector3f | transform (const Vector3f &value, const AABB3f &range, ValueCurve xCurve, ValueCurve yCurve, ValueCurve zCurve) |
Transform a 3D value in the given range by the specified value curve. More... | |
A class that represents the scaling curve to use when displaying a value.
This class allows the user to specify how to display slider values, graphs, etc. Certain types of data are better visualized with a log scale, for instance.
An enum that specifies the different kinds of curves.
|
inline |
Create a new value curve with the default curve - linear.
|
inline |
Create a new value curve using the specified value curve type enum value.
|
inline |
Convert this value curve type to an enum value.
Float om::graphics::gui::base::ValueCurve::evaluate | ( | Float | a, |
const AABB1f & | range = AABB1f(0.0f, 1.0f) |
||
) | const |
Apply this curve to a value with the specified linear parameter from 0 to 1 and output range.
This method takes a parameter which ranges from 0 to 1, indicating the linear range of the value. It applies the transfer function of this curve to that parameter and returns the result, adjusted to lie within the specified value output range. The result indicates the actual parameter value that should be displayed at the original linear position.
Use this method to convert from a display location to the actual value at the display location.
Double om::graphics::gui::base::ValueCurve::evaluate | ( | Double | a, |
const AABB1d & | range = AABB1d(0.0f, 1.0f) |
||
) | const |
Float om::graphics::gui::base::ValueCurve::evaluateInverse | ( | Float | value, |
const AABB1f & | range = AABB1f(0.0f, 1.0f) |
||
) | const |
Apply this curve to a value in reverse with the specified value and input range.
This method takes a parameter which ranges from its minimum to maximum value and undoes the value curve, producing a linear parameter value that ranges from 0 to 1.
Use this method to convert from actual values to where they should be displayed.
Double om::graphics::gui::base::ValueCurve::evaluateInverse | ( | Double | value, |
const AABB1d & | range = AABB1d(0.0f, 1.0f) |
||
) | const |
String om::graphics::gui::base::ValueCurve::toString | ( | ) | const |
Return a string representation of the value curve type.
|
inline |
Convert this value curve type into a string representation.
|
static |
Transform a 1D value in the given range by the specified value curve.
|
static |
Transform a 2D value in the given range by the specified value curve.
|
static |
Transform a 3D value in the given range by the specified value curve.