![]() |
Vault
4.1
|
VDoubleColorMapper maps double values to colors. More...
#include <vcolor.h>
Public Member Functions | |
| virtual VColorPair | getColors (const VString &stringValue) const |
| virtual VColorPair | getColors (int intValue) const |
| virtual VColorPair | getColors (Vs64 int64Value) const |
| virtual VColorPair | getColors (VDouble doubleValue) const |
| void | addColors (VDouble doubleValue, const VColorPair &rangeColors) |
Protected Member Functions | |
| virtual void | _readColorElement (const VSettingsNode &colorNode) |
VDoubleColorMapper maps double values to colors.
Note that because of the usual floating-point discrepancies, we don't attempt to provide a mapping of arbitrary precision values here. Instead, we convert each key value to a string with 6 digits after the decimal point. This way we can get perfect matching in the map of values to that level of precision, regardless of the math operations that generate them. It does, however come at the cost of string conversion. If you want more precision then you probably want to use the VDoubleRangeColorMapper and treat the values as boundaries rather than keys.