45   m_colorMap[0.] = colorBegin;
 
   46   m_colorMap[1.] = colorEnd;
 
   51   : m_colorBarVec(rhs.m_colorBarVec), m_colorSliceVec(rhs.m_colorSliceVec),
 
   52     m_name(rhs.m_name), m_barSize(rhs.m_barSize), m_colorMap(rhs.m_colorMap)
 
   92   double rd, gd, bd, ad;
 
   94   std::map<int, RGBAColor> colorMap;
 
   96   std::map<double, RGBAColor>::iterator iit;
 
   98   for(iit = m_colorMap.begin(); iit != m_colorMap.end(); ++iit)
 
  100     p = (int)((*iit).first * (
double)(m_barSize-1) + .5);
 
  101     colorMap[p] = (*iit).second;
 
  105   std::map<int, RGBAColor>::iterator it = colorMap.begin();
 
  106   while(it != colorMap.end())
 
  111       m_colorBarVec.pop_back();
 
  112     m_colorBarVec.push_back(c);
 
  115     if(it != colorMap.end())
 
  127         for(i = 1; i <= s; ++i)
 
  129           int r = (int)(rd * (
double)i + .5) + c.
getRed();
 
  130           int g = (int)(gd * (
double)i + .5) + c.
getGreen();
 
  131           int b = (int)(bd * (
double)i + .5) + c.
getBlue();
 
  132           int a = (int)(ad * (
double)i + .5) + c.
getAlpha();
 
  134           m_colorBarVec.push_back(cor);
 
  139   while((
int)m_colorBarVec.size() < m_barSize)
 
  140     m_colorBarVec.push_back(colorMap.rbegin()->second);
 
  145   if(m_colorBarVec.empty())
 
  148   return m_colorBarVec;
 
  155   double d = (double)(m_barSize-1) / (double)(n-1);
 
  157   m_colorSliceVec.clear();
 
  159   for(i = 0; i < n; ++i)
 
  161     j = (int)((
double)i * d + .5);
 
  162     c = m_colorBarVec[j];
 
  163     m_colorSliceVec.push_back(c);
 
  169   m_colorSliceVec.clear();
 
  172     return m_colorSliceVec;
 
  175     m_colorSliceVec.push_back(m_colorMap.begin()->second);
 
  176     return m_colorSliceVec;
 
  179   if(m_colorBarVec.empty())
 
  182   if((
int)m_colorSliceVec.size() != n)
 
  184     m_colorSliceVec.clear();
 
  188   return m_colorSliceVec;
 
  193   if(m_colorBarVec.empty())
 
  196   int size = m_colorBarVec.size();
 
  197   int mean = (int)((
double)size / 2. + .5);
 
  199   return m_colorBarVec[mean];
 
  204   if(m_colorBarVec.empty())
 
  214     d = ((double)(m_barSize-1) / (double)(n-1)) / 2.;
 
  216   m_colorSliceVec.clear();
 
  218   for(i = 0; i < n; ++i)
 
  220     j = (int)((
double)i * d + .5);
 
  221     c = m_colorBarVec[j];
 
  222     m_colorSliceVec.push_back(c);
 
  225   return m_colorSliceVec;
 
  230   if(m_colorBarVec.empty())
 
  235   double d = ((double)(m_barSize-1) / (double)(n-1)) / 2.;
 
  237   m_colorSliceVec.clear();
 
  239   double halfsize = (double)(m_barSize-1) / 2.;
 
  240   int shift = (int)halfsize;
 
  242   for(i = 0; i < n; ++i)
 
  244     j = ((int)((
double)i * d + .5)) + shift;
 
  245     c = m_colorBarVec[j];
 
  246     m_colorSliceVec.push_back(c);
 
  249   return m_colorSliceVec;
 
  254   m_colorBarVec.clear();
 
  255   m_colorSliceVec.clear();
 
  268   std::map<double, RGBAColor>::iterator it = m_colorMap.find(ppos);
 
  269   m_colorBarVec.clear();
 
  270   m_colorSliceVec.clear();
 
  278   if(it == m_colorMap.end())
 
  279     m_colorMap[pos] = color;
 
  283     std::map<double, RGBAColor>::iterator itt = it;
 
  289       p = pos - (pos - p) / 2.;
 
  295       p = pos + (p - pos) / 2.;
 
  298     m_colorMap.erase(it);
 
  301     m_colorMap[pos] = color;
 
  307   std::map<double, RGBAColor>::iterator it;
 
  309   m_colorBarVec.clear();
 
  310   m_colorSliceVec.clear();
 
  312   if(m_colorMap.size() > 2)
 
  314     for(it = m_colorMap.begin(); it != m_colorMap.end(); ++it)
 
  319         m_colorMap.erase(it);
 
  329   std::map<double, RGBAColor>::iterator it;
 
  330   m_colorBarVec.clear();
 
  331   m_colorSliceVec.clear();
 
  333   if(m_colorMap.size() > 2)
 
  335     for(i = 0, it = m_colorMap.begin(); it != m_colorMap.end(); ++i, ++it)
 
  339         m_colorMap.erase(it);
 
  348   if(m_colorMap.size() == 2)
 
  351   std::map<double, RGBAColor>::iterator it = m_colorMap.find(pos);
 
  353   if(it != m_colorMap.end())
 
  355     m_colorBarVec.clear();
 
  356     m_colorSliceVec.clear();
 
  357     m_colorMap.erase(pos);
 
  364   std::map<double, RGBAColor>::reverse_iterator it;
 
  365   m_colorBarVec.clear();
 
  366   m_colorSliceVec.clear();
 
  368   if(m_colorMap.size() > 2)
 
  370     for(i = 0, it = m_colorMap.rbegin(); it != m_colorMap.rend(); ++i, ++it)
 
  374         m_colorMap.erase(it->first);
 
  383   std::map<double, RGBAColor>::iterator it = m_colorMap.find(pos);
 
  384   if(it != m_colorMap.end())
 
  386     m_colorBarVec.clear();
 
  387     m_colorSliceVec.clear();
 
  395   std::map<double, RGBAColor>::iterator it;
 
  396   m_colorBarVec.clear();
 
  397   m_colorSliceVec.clear();
 
  399   for(i = 0, it = m_colorMap.begin(); it != m_colorMap.end(); ++i, ++it)
 
  413   std::map<double, RGBAColor>::iterator it;
 
  414   m_colorBarVec.clear();
 
  415   m_colorSliceVec.clear();
 
  423   for(it = m_colorMap.begin(); it != m_colorMap.end(); ++it)
 
  430   if(it == m_colorMap.end()) 
 
  434   if(p == 0. || p == 1.) 
 
  436       if(m_colorMap.size() == 2) 
 
  438         std::map<double, RGBAColor>::iterator itt = it;
 
  443         (*it).second = (*itt).second;
 
  444         (*itt).second = color;
 
  449   m_colorMap.erase(it); 
 
  451   it = m_colorMap.find(pos);
 
  453   if(it == m_colorMap.end()) 
 
  455     m_colorMap[pos] = color;
 
  462     std::map<double, RGBAColor>::iterator itt = it;
 
  473       p = pos - (pos - p) / 2.;
 
  484       p = pos + (p - pos) / 2.;
 
  487     m_colorMap.erase(it);
 
  489     m_colorMap[pos] = color;
 
  498   std::map<double, RGBAColor>::iterator it;
 
  499   m_colorBarVec.clear();
 
  500   m_colorSliceVec.clear();
 
  502   if(index >= (
int)m_colorMap.size())
 
  505   if(index == 0 || index == (
int)(m_colorMap.size()-1))
 
  508   for(i = 0, it = m_colorMap.begin(); it != m_colorMap.end(); ++i, ++it)
 
  515   for(i = 0, it = m_colorMap.begin(); it != m_colorMap.end(); ++i, ++it)
 
  524   std::map<double, RGBAColor>::iterator it = m_colorMap.find(p);
 
  525   if(it == m_colorMap.end())
 
  528   double pp, d = 1. / (double)m_barSize;
 
  537   if(p == 0. || p == 1.)
 
  540   std::map<double, RGBAColor>::iterator itp = m_colorMap.find(pos);
 
  542   m_colorBarVec.clear();
 
  543   m_colorSliceVec.clear();
 
  548   if(itp == m_colorMap.end())
 
  558       it = m_colorMap.begin();
 
  560       while(it->first != pos)
 
  573       it = m_colorMap.begin();
 
  581       m_colorMap[pos] = cc;
 
  589       it = m_colorMap.begin();
 
  590       while(it->first != pos)
 
  602       it = m_colorMap.end();
 
  611       m_colorMap[pos] = cc;
 
  622   std::map<double, RGBAColor>::reverse_iterator it;
 
  623   m_colorBarVec.clear();
 
  624   m_colorSliceVec.clear();
 
  626   if(index >= (
int)m_colorMap.size())
 
  629   for(i = 0, it = m_colorMap.rbegin(); it != m_colorMap.rend(); ++i, ++it)
 
  636   for(i = 0, it = m_colorMap.rbegin(); it != m_colorMap.rend(); ++i, ++it)
 
void setBarSize(const int &size)
It sets number of colors in the color bar. 
 
It models the concept of color bar. 
 
int moveReverse(const int &index, const double &pos)
It moves a color to new posisiton. 
 
int getBarSize()
It returns number of colors in the color bar. 
 
ColorBar()
It initializes a new ColorBar(default constructor) 
 
void addColor(const RGBAColor &color, const double &pos)
It adds a color in the color bar. 
 
The concept of color bar. 
 
int getGreen() const 
It returns the green component color value (a value from 0 to 255). 
 
const std::string & getName() const 
It returns the color bar name. 
 
void generateSlices(const int &n)
It generates legend colors. 
 
const std::vector< te::color::RGBAColor > & getColorBar()
It generates color bar. 
 
std::vector< RGBAColor > m_colorSliceVec
Color step vector. 
 
te::color::ColorBar & operator=(const ColorBar &rhs)
 
void setName(const std::string &name)
It sets the color bar name and adjust its entry in the scheme group if needed. 
 
std::map< double, RGBAColor > m_colorMap
Color map. 
 
std::vector< RGBAColor > m_colorBarVec
Color vector. 
 
void setColor(const std::string &hexColor)
It sets the color using a two hexadecimal RGB-encoded color. 
 
void move(const RGBAColor &color, const double &pos)
It moves a color to new posisiton. 
 
A helper class for 32-bit RGBA (Red-Green-Blue-Alpha channel) color. 
 
const std::vector< te::color::RGBAColor > & getSlices(const int &n)
It generates color bar. 
 
void generateColorBar()
It generates bar colors. 
 
void removeReverse(const int &index)
It removes a color in the color bar. 
 
const std::vector< te::color::RGBAColor > & getLowerMeanSlices(const int &n)
 
const std::map< double, te::color::RGBAColor > & getColorMap() const 
It gets color map. 
 
void changeColor(const double &pos, const RGBAColor &color)
It moves a color to new posisiton. 
 
const std::vector< te::color::RGBAColor > & getUpperMeanSlices(const int &n)
 
const te::color::RGBAColor & getMeanSlice()
 
int m_barSize
Size of color bar (number of colors in the color bar). 
 
std::string m_name
Color bar name. 
 
int getBlue() const 
It returns the blue component color value (a value from 0 to 255). 
 
void remove(const RGBAColor &color)
It removes a color in the color bar. 
 
int getAlpha() const 
It returns the alpha component color value (a value from 0 to 255). 
 
int getRed() const 
It returns the red component color value (a value from 0 to 255).