148 ERRORMSG(
"Colors::Get() - bad eColor " << (
int) which);
156 ERRORMSG(
"Colors::Get() - bad eColorCycle " << (
int) which);
162 if (which >= 0 && which < eNumColorMaps && f >= 0.0 &&
f <= 1.0) {
163 const vector < Vector >& colorMap =
mapColors[which];
164 if (
f == 1.0)
return colorMap[colorMap.size() - 1];
165 double bin = 1.0 / (colorMap.size() - 1);
166 unsigned int low = (
unsigned int) (
f / bin);
167 double fraction = fmod(
f, bin) / bin;
168 const Vector &color1 = colorMap[low], &color2 = colorMap[low + 1];
169 return (color1 + fraction * (color2 - color1));
171 ERRORMSG(
"Colors::Get() - bad eColorMap " << (
int) which <<
" at " <<
f);
static const unsigned int nHydrophobicityMap
std::vector< std::vector< Vector > > cycleColors
static const unsigned int nTemperatureMap
static const unsigned int nRainbowMap
static const unsigned int nConservationMap
std::vector< std::vector< Vector > > mapColors
static const unsigned int nCycle1
const Vector & Get(eColor which) const
Vector colors[eNumColors]
void Set(double xs, double ys, double zs)
static const Colors colors
const Colors * GlobalColors(void)
Include a standard set of the NCBI C++ Toolkit most basic headers.
#define END_SCOPE(ns)
End the previously defined scope.
#define BEGIN_SCOPE(ns)
Define a new scope.
unsigned int
A callback function used to compare two keys in a database.
const struct ncbi::grid::netcache::search::fields::SIZE size
double f(double x_, const double &y_)