It QWidget implementation of color bar. More...
#include <ColorBar.h>
Signals | |
| void | colorBarChanged () |
Public Member Functions | |
Initializer Methods | |
Methods related to instantiation and destruction. | |
| ColorBar (QWidget *parent=0) | |
| It initializes a new ColorBar. More... | |
| ~ColorBar () | |
| Destructor. More... | |
Accessor methods | |
Methods used to get or set properties. | |
| void | setScaleVisible (bool flag) |
| Sets scale of color bar visibility. More... | |
| void | setHeight (int value) |
| Sets the height of colobar. More... | |
| void | setInterval (double min, double max) |
| It sets the min e max value of colorbar. More... | |
| void | setColorBar (te::color::ColorBar *cb) |
| It sets the color bar. More... | |
| void | setClickPrecision (double precision) |
| It sets the precision of mouse click. More... | |
| te::color::ColorBar * | getColorBar () |
| It returns the colorbar. More... | |
Protected Slots | |
| void | addPin () |
| It add a colorbar pin. More... | |
| void | editPin () |
| It edit a colorbar pin. More... | |
| void | equalStep () |
| It changes the pins positions for an equal distribution. More... | |
| void | removePin () |
| It remove a colorbar pin. More... | |
Protected Member Functions | |
Private methods | |
Methods used to manange colors and events. | |
| void | setScaleEngine () |
| Sets the transformation and the scale of colorbar values. More... | |
| void | buildColorBar () |
| It build and paint the colorbar. More... | |
| double | getPin (int pos) |
| It returns the pin based on mouse click and the click precision. More... | |
| double | convert2toolbarPos (int pos) |
| It convert a mouse position to a toolbar position. More... | |
| virtual void | paintEvent (QPaintEvent *e) |
| Inherit of QEvent, receive events to paint e update widgets. More... | |
| virtual void | mousePressEvent (QMouseEvent *e) |
| It waits a pressEvent from mouse to do something. More... | |
| virtual void | mouseReleaseEvent (QMouseEvent *e) |
| It waits a releaseEvent from mouse to do something. More... | |
| virtual void | mouseMoveEvent (QMouseEvent *e) |
| It waits a moveEvent from mouse to do something. More... | |
| virtual void | wheelEvent (QWheelEvent *e) |
| It waits the wheel from mouse to do something. More... | |
Protected Attributes | |
| QWidgetAction * | m_addPinAction |
| Add Pin Action. More... | |
| double | m_clickPrecision |
| Precision of click to get a color stop. More... | |
| te::color::ColorBar * | m_colorBar |
| Color map information. More... | |
| QMenu * | m_colorBarMenu |
| Popup menu for Pin on color bar. More... | |
| te::qt::widgets::ColorPickerToolButton * | m_colorBarPicker |
| Color picker for colorbar menu. More... | |
| double | m_currentPinPos |
| Value of the current Pin position. More... | |
| QWidgetAction * | m_editPinAction |
| Edit Pin Action. More... | |
| QAction * | m_equalStepAction |
| Equal Step Pin Action. More... | |
| int | m_height |
| Height of colobar. More... | |
| double | m_initialXPos |
| Position initial to move color. More... | |
| QwtInterval | m_interval |
| Color vector. More... | |
| QMenu * | m_pinMenu |
| Popup menu for Pin on color bar. More... | |
| te::qt::widgets::ColorPickerToolButton * | m_pinPicker |
| Color picker for pin menu. More... | |
| QAction * | m_removePinAction |
| Remove Pin Action. More... | |
It QWidget implementation of color bar.
It is used to construct color bar.
Definition at line 67 of file ColorBar.h.
| te::qt::widgets::colorbar::ColorBar::ColorBar | ( | QWidget * | parent = 0 | ) |
It initializes a new ColorBar.
| parent |
Definition at line 26 of file ColorBar.cpp.
References addPin(), editPin(), equalStep(), m_addPinAction, m_colorBarMenu, m_colorBarPicker, m_editPinAction, m_equalStepAction, m_initialXPos, m_interval, m_pinMenu, m_pinPicker, m_removePinAction, removePin(), setClickPrecision(), setHeight(), and setScaleEngine().
| te::qt::widgets::colorbar::ColorBar::~ColorBar | ( | ) |
Destructor.
Definition at line 79 of file ColorBar.cpp.
|
protectedslot |
|
protected |
It build and paint the colorbar.
Definition at line 128 of file ColorBar.cpp.
|
signal |
|
protected |
It convert a mouse position to a toolbar position.
| pos | Mouse click X on toolbar |
Definition at line 390 of file ColorBar.cpp.
|
protectedslot |
|
protectedslot |
It changes the pins positions for an equal distribution.
Definition at line 195 of file ColorBar.cpp.
Referenced by ColorBar().
| te::color::ColorBar * te::qt::widgets::colorbar::ColorBar::getColorBar | ( | ) |
|
protected |
It returns the pin based on mouse click and the click precision.
| pos | Mouse click X on toolbar |
Definition at line 362 of file ColorBar.cpp.
|
protectedvirtual |
It waits a moveEvent from mouse to do something.
| QMouseEvent |
Definition at line 299 of file ColorBar.cpp.
|
protectedvirtual |
It waits a pressEvent from mouse to do something.
| QMouseEvent |
Definition at line 257 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().
|
protectedvirtual |
It waits a releaseEvent from mouse to do something.
| QMouseEvent |
Definition at line 290 of file ColorBar.cpp.
|
protectedvirtual |
Inherit of QEvent, receive events to paint e update widgets.
| QPaintEvent |
Definition at line 228 of file ColorBar.cpp.
|
protectedslot |
| void te::qt::widgets::colorbar::ColorBar::setClickPrecision | ( | double | precision | ) |
It sets the precision of mouse click.
| double | precision of click. |
Definition at line 123 of file ColorBar.cpp.
Referenced by ColorBar().
| void te::qt::widgets::colorbar::ColorBar::setColorBar | ( | te::color::ColorBar * | cb | ) |
It sets the color bar.
| te::color::colorBar | to paint in the colorbar. |
Definition at line 105 of file ColorBar.cpp.
| void te::qt::widgets::colorbar::ColorBar::setHeight | ( | int | value | ) |
Sets the height of colobar.
| Value | of height. |
Definition at line 90 of file ColorBar.cpp.
Referenced by ColorBar().
| void te::qt::widgets::colorbar::ColorBar::setInterval | ( | double | min, |
| double | max | ||
| ) |
It sets the min e max value of colorbar.
| Minimum | value. |
| Maximum | value. |
Definition at line 97 of file ColorBar.cpp.
|
protected |
Sets the transformation and the scale of colorbar values.
Definition at line 117 of file ColorBar.cpp.
Referenced by ColorBar().
| void te::qt::widgets::colorbar::ColorBar::setScaleVisible | ( | bool | flag | ) |
Sets scale of color bar visibility.
| flag | Boolean value to set the scale of color bar visibility. |
Definition at line 83 of file ColorBar.cpp.
|
protectedvirtual |
It waits the wheel from mouse to do something.
| QWheelEvent |
Definition at line 320 of file ColorBar.cpp.
References te::color::ColorTransform::getAlpha(), te::color::ColorTransform::getBlue(), te::color::ColorTransform::getGreen(), te::color::ColorTransform::getHsl(), te::color::ColorTransform::getRed(), te::color::RGBAColor::getRgba(), and te::color::ColorTransform::setHsl().
|
protected |
|
protected |
Precision of click to get a color stop.
Definition at line 262 of file ColorBar.h.
|
protected |
Color map information.
Definition at line 254 of file ColorBar.h.
|
protected |
Popup menu for Pin on color bar.
Definition at line 266 of file ColorBar.h.
Referenced by ColorBar().
|
protected |
Color picker for colorbar menu.
Definition at line 270 of file ColorBar.h.
Referenced by ColorBar().
|
protected |
Value of the current Pin position.
Definition at line 264 of file ColorBar.h.
|
protected |
|
protected |
|
protected |
Height of colobar.
Definition at line 258 of file ColorBar.h.
|
protected |
Position initial to move color.
Definition at line 260 of file ColorBar.h.
Referenced by ColorBar().
|
protected |
|
protected |
Popup menu for Pin on color bar.
Definition at line 268 of file ColorBar.h.
Referenced by ColorBar().
|
protected |
|
protected |