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)
Definition at line 29 of file ColorBar.cpp.
te::color::ColorBar::ColorBar | ( | int | size | ) |
It initializes a new ColorBar.
size | Number of colors to be generated. |
Definition at line 34 of file ColorBar.cpp.
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. |
Definition at line 43 of file ColorBar.cpp.
te::color::ColorBar::ColorBar | ( | const ColorBar & | rhs | ) |
Copy constructor.
Definition at line 50 of file ColorBar.cpp.
te::color::ColorBar::~ColorBar | ( | ) |
Destructor.
Definition at line 70 of file ColorBar.cpp.
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.
Definition at line 264 of file ColorBar.cpp.
Referenced by te::qt::widgets::ColorCatalogWidget::onSchemaComboBoxActivated(), te::qt::widgets::GroupingWidget::updateUi(), and te::qt::widgets::ColorMapWidget::updateUi().
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.
Definition at line 381 of file ColorBar.cpp.
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.
Definition at line 392 of file ColorBar.cpp.
|
private |
It generates bar colors.
Definition at line 89 of file ColorBar.cpp.
References te::color::RGBAColor::getAlpha(), te::color::RGBAColor::getBlue(), te::color::RGBAColor::getGreen(), te::color::RGBAColor::getRed(), and te::color::RGBAColor::setColor().
|
private |
It generates legend colors.
n | Number of slices. It is the amount of legends. |
Definition at line 151 of file ColorBar.cpp.
int te::color::ColorBar::getBarSize | ( | ) |
It returns number of colors in the color bar.
Definition at line 259 of file ColorBar.cpp.
const std::vector< te::color::RGBAColor > & te::color::ColorBar::getColorBar | ( | ) |
const std::map< double, te::color::RGBAColor > & te::color::ColorBar::getColorMap | ( | ) | const |
const std::vector< te::color::RGBAColor > & te::color::ColorBar::getLowerMeanSlices | ( | const int & | n | ) |
Definition at line 202 of file ColorBar.cpp.
const te::color::RGBAColor & te::color::ColorBar::getMeanSlice | ( | ) |
Definition at line 191 of file ColorBar.cpp.
const std::string & te::color::ColorBar::getName | ( | ) | const |
It returns the color bar name.
Definition at line 74 of file ColorBar.cpp.
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. |
Definition at line 167 of file ColorBar.cpp.
const std::vector< te::color::RGBAColor > & te::color::ColorBar::getUpperMeanSlices | ( | const int & | n | ) |
Definition at line 228 of file ColorBar.cpp.
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.
Definition at line 409 of file ColorBar.cpp.
References te::color::RGBAColor::getAlpha(), te::color::RGBAColor::getBlue(), te::color::RGBAColor::getGreen(), and te::color::RGBAColor::getRed().
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.
Definition at line 493 of file ColorBar.cpp.
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.
Definition at line 522 of file ColorBar.cpp.
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.
Definition at line 617 of file ColorBar.cpp.
te::color::ColorBar & te::color::ColorBar::operator= | ( | const ColorBar & | rhs | ) |
Assignment operator.
Definition at line 56 of file ColorBar.cpp.
References m_barSize, m_colorBarVec, m_colorMap, m_colorSliceVec, and m_name.
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.
Definition at line 305 of file ColorBar.cpp.
References te::color::RGBAColor::getAlpha(), te::color::RGBAColor::getBlue(), te::color::RGBAColor::getGreen(), and te::color::RGBAColor::getRed().
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.
Definition at line 326 of file ColorBar.cpp.
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.
Definition at line 346 of file ColorBar.cpp.
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.
Definition at line 361 of file ColorBar.cpp.
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.
Definition at line 252 of file ColorBar.cpp.
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. |
Definition at line 79 of file ColorBar.cpp.
|
private |
Size of color bar (number of colors in the color bar).
Definition at line 293 of file ColorBar.h.
Referenced by operator=().
|
private |
|
private |
|
private |
|
private |