It models the concept of color bar. More...
#include <ColorBar.h>
Public Member Functions | |
Initializer Methods | |
Methods related to instantiation and destruction. | |
ColorBar () | |
It initializes a new ColorBar(default constructor) More... | |
ColorBar (int size) | |
It initializes a new ColorBar. More... | |
ColorBar (const RGBAColor &colorBegin, const RGBAColor &colorEnd, int size) | |
It initializes a new ColorBar. More... | |
ColorBar (const ColorBar &rhs) | |
Copy constructor. More... | |
te::color::ColorBar & | operator= (const ColorBar &rhs) |
~ColorBar () | |
Destructor. More... | |
Accessor methods | |
Methods used to get or set properties. | |
const std::string & | getName () const |
It returns the color bar name. More... | |
void | setName (const std::string &name) |
It sets the color bar name and adjust its entry in the scheme group if needed. More... | |
const std::map< double, te::color::RGBAColor > & | getColorMap () const |
It gets color map. More... | |
const std::vector< te::color::RGBAColor > & | getColorBar () |
It generates color bar. More... | |
const std::vector< te::color::RGBAColor > & | getSlices (const int &n) |
It generates color bar. More... | |
const te::color::RGBAColor & | getMeanSlice () |
const std::vector< te::color::RGBAColor > & | getLowerMeanSlices (const int &n) |
const std::vector< te::color::RGBAColor > & | getUpperMeanSlices (const int &n) |
void | setBarSize (const int &size) |
It sets number of colors in the color bar. More... | |
int | getBarSize () |
It returns number of colors in the color bar. More... | |
void | addColor (const RGBAColor &color, const double &pos) |
It adds a color in the color bar. More... | |
void | remove (const RGBAColor &color) |
It removes a color in the color bar. More... | |
void | remove (const int &index) |
It removes a color in the color bar. More... | |
void | remove (const double &pos) |
It removes a color in the color bar. More... | |
void | removeReverse (const int &index) |
It removes a color in the color bar. More... | |
void | changeColor (const double &pos, const RGBAColor &color) |
It moves a color to new posisiton. More... | |
void | changeColor (const int &index, const RGBAColor &color) |
It moves a color to new posisiton. More... | |
void | move (const RGBAColor &color, const double &pos) |
It moves a color to new posisiton. More... | |
int | move (const int &index, const double &pos) |
It moves a color to new posisiton. More... | |
double | move (const double &pi, const double &pm) |
It moves a color to new posisiton. More... | |
int | moveReverse (const int &index, const double &pos) |
It moves a color to new posisiton. More... | |
Private Member Functions | |
Private methods | |
Methods used to generate colors. | |
void | generateColorBar () |
It generates bar colors. More... | |
void | generateSlices (const int &n) |
It generates legend colors. More... | |
Private Attributes | |
int | m_barSize |
Size of color bar (number of colors in the color bar). More... | |
std::vector< RGBAColor > | m_colorBarVec |
Color vector. More... | |
std::map< double, RGBAColor > | m_colorMap |
Color map. More... | |
std::vector< RGBAColor > | m_colorSliceVec |
Color step vector. More... | |
std::string | m_name |
Color bar name. More... | |
It models the concept of color bar.
It is used to construct color bar.
Definition at line 49 of file ColorBar.h.
te::color::ColorBar::ColorBar | ( | ) |
It initializes a new ColorBar(default constructor)
te::color::ColorBar::ColorBar | ( | int | size | ) |
It initializes a new ColorBar.
size | Number of colors to be generated. |
te::color::ColorBar::ColorBar | ( | const RGBAColor & | colorBegin, |
const RGBAColor & | colorEnd, | ||
int | size | ||
) |
It initializes a new ColorBar.
colorBegin | Begin color. |
colorEnd | End color. |
size | Number of colors to be generated. |
te::color::ColorBar::ColorBar | ( | const ColorBar & | rhs | ) |
Copy constructor.
te::color::ColorBar::~ColorBar | ( | ) |
Destructor.
void te::color::ColorBar::addColor | ( | const RGBAColor & | color, |
const double & | pos | ||
) |
It adds a color in the color bar.
color | Color to be added in the color bar. |
pos | Position where the color is added. |
void te::color::ColorBar::changeColor | ( | const double & | pos, |
const RGBAColor & | color | ||
) |
It moves a color to new posisiton.
pos | position of the color in the color bar. |
color | The new color. |
void te::color::ColorBar::changeColor | ( | const int & | index, |
const RGBAColor & | color | ||
) |
It moves a color to new posisiton.
index | index of the color in the color bar. |
color | The new color. |
|
private |
It generates bar colors.
|
private |
It generates legend colors.
n | Number of slices. It is the amount of legends. |
int te::color::ColorBar::getBarSize | ( | ) |
It returns number of colors in the color bar.
const std::vector<te::color::RGBAColor>& te::color::ColorBar::getColorBar | ( | ) |
It generates color bar.
const std::map<double, te::color::RGBAColor>& te::color::ColorBar::getColorMap | ( | ) | const |
It gets color map.
const std::vector<te::color::RGBAColor>& te::color::ColorBar::getLowerMeanSlices | ( | const int & | n | ) |
const te::color::RGBAColor& te::color::ColorBar::getMeanSlice | ( | ) |
const std::string& te::color::ColorBar::getName | ( | ) | const |
It returns the color bar name.
const std::vector<te::color::RGBAColor>& te::color::ColorBar::getSlices | ( | const int & | n | ) |
It generates color bar.
n | Number of slices. It is the amount of legends. |
const std::vector<te::color::RGBAColor>& te::color::ColorBar::getUpperMeanSlices | ( | const int & | n | ) |
void te::color::ColorBar::move | ( | const RGBAColor & | color, |
const double & | pos | ||
) |
It moves a color to new posisiton.
color | Color to be moved in the color bar. |
int te::color::ColorBar::move | ( | const int & | index, |
const double & | pos | ||
) |
It moves a color to new posisiton.
index | Index of color to be moved in the color bar. |
pos | The new postion of color in the color bar. |
double te::color::ColorBar::move | ( | const double & | pi, |
const double & | pm | ||
) |
It moves a color to new posisiton.
index | Index of color to be moved in the color bar. |
pos | The new postion of color in the color bar. |
int te::color::ColorBar::moveReverse | ( | const int & | index, |
const double & | pos | ||
) |
It moves a color to new posisiton.
index | Reverse index of color to be moved in the color bar. |
pos | The new postion of color in the color bar. |
te::color::ColorBar& te::color::ColorBar::operator= | ( | const ColorBar & | rhs | ) |
Assignment operator.
void te::color::ColorBar::remove | ( | const RGBAColor & | color | ) |
It removes a color in the color bar.
color | Color to be removed in the color bar. |
void te::color::ColorBar::remove | ( | const int & | index | ) |
It removes a color in the color bar.
index | Index of color to be removed in the color bar. |
void te::color::ColorBar::remove | ( | const double & | pos | ) |
It removes a color in the color bar.
pos | Position of color to be removed in the color bar. |
void te::color::ColorBar::removeReverse | ( | const int & | index | ) |
It removes a color in the color bar.
index | Reverse index of color to be removed in the color bar. |
void te::color::ColorBar::setBarSize | ( | const int & | size | ) |
It sets number of colors in the color bar.
size | Number of colors in the color bar. |
void te::color::ColorBar::setName | ( | const std::string & | name | ) |
It sets the color bar name and adjust its entry in the scheme group if needed.
name | The new color bar name. |
|
private |
Size of color bar (number of colors in the color bar).
Definition at line 293 of file ColorBar.h.
|
private |
Color vector.
Definition at line 290 of file ColorBar.h.
|
private |
Color map.
Definition at line 294 of file ColorBar.h.
|
private |
Color step vector.
Definition at line 291 of file ColorBar.h.
|
private |
Color bar name.
Definition at line 292 of file ColorBar.h.