All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
te::qt::widgets::colorbar::ColorBar Class Reference

It QWidget implementation of color bar. More...

#include <ColorBar.h>

Inheritance diagram for te::qt::widgets::colorbar::ColorBar:

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::ColorBargetColorBar ()
 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::ColorBarm_colorBar
 Color map information. More...
 
QMenu * m_colorBarMenu
 Popup menu for Pin on color bar. More...
 
te::qt::widgets::ColorPickerToolButtonm_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::ColorPickerToolButtonm_pinPicker
 Color picker for pin menu. More...
 
QAction * m_removePinAction
 Remove Pin Action. More...
 

Detailed Description

It QWidget implementation of color bar.

It is used to construct color bar.

Definition at line 67 of file ColorBar.h.

Constructor & Destructor Documentation

te::qt::widgets::colorbar::ColorBar::ColorBar ( QWidget *  parent = 0)
te::qt::widgets::colorbar::ColorBar::~ColorBar ( )

Destructor.

Definition at line 81 of file ColorBar.cpp.

Member Function Documentation

void te::qt::widgets::colorbar::ColorBar::addPin ( )
protectedslot

It add a colorbar pin.

Definition at line 187 of file ColorBar.cpp.

Referenced by ColorBar().

void te::qt::widgets::colorbar::ColorBar::buildColorBar ( )
protected

It build and paint the colorbar.

Definition at line 133 of file ColorBar.cpp.

void te::qt::widgets::colorbar::ColorBar::colorBarChanged ( )
signal
double te::qt::widgets::colorbar::ColorBar::convert2toolbarPos ( int  pos)
protected

It convert a mouse position to a toolbar position.

Parameters
posMouse click X on toolbar
Returns
Toolbar position

Definition at line 398 of file ColorBar.cpp.

void te::qt::widgets::colorbar::ColorBar::editPin ( )
protectedslot

It edit a colorbar pin.

Definition at line 176 of file ColorBar.cpp.

Referenced by ColorBar().

void te::qt::widgets::colorbar::ColorBar::equalStep ( )
protectedslot

It changes the pins positions for an equal distribution.

Definition at line 200 of file ColorBar.cpp.

Referenced by ColorBar().

te::color::ColorBar * te::qt::widgets::colorbar::ColorBar::getColorBar ( )

It returns the colorbar.

Returns
Current color bar.

Definition at line 117 of file ColorBar.cpp.

Referenced by te::qt::widgets::GroupingWidget::updateUi(), and te::qt::widgets::ColorMapWidget::updateUi().

double te::qt::widgets::colorbar::ColorBar::getPin ( int  pos)
protected

It returns the pin based on mouse click and the click precision.

Parameters
posMouse click X on toolbar
Returns
Pin found or -1, if not found.

Definition at line 370 of file ColorBar.cpp.

void te::qt::widgets::colorbar::ColorBar::mouseMoveEvent ( QMouseEvent *  e)
protectedvirtual

It waits a moveEvent from mouse to do something.

Parameters
QMouseEvent
Note
In this case, it treat the moce of colorStops.

Definition at line 307 of file ColorBar.cpp.

void te::qt::widgets::colorbar::ColorBar::mousePressEvent ( QMouseEvent *  e)
protectedvirtual

It waits a pressEvent from mouse to do something.

Parameters
QMouseEvent
Note
In this case, it treat the remove colorStops funciontion
and sets the start position to move stops.

Definition at line 262 of file ColorBar.cpp.

References te::color::RGBAColor::getBlue(), te::color::RGBAColor::getGreen(), and te::color::RGBAColor::getRed().

void te::qt::widgets::colorbar::ColorBar::mouseReleaseEvent ( QMouseEvent *  e)
protectedvirtual

It waits a releaseEvent from mouse to do something.

Parameters
QMouseEvent
Note
In this case, it treat the finalization of move colorStops.

Definition at line 298 of file ColorBar.cpp.

void te::qt::widgets::colorbar::ColorBar::paintEvent ( QPaintEvent *  e)
protectedvirtual

Inherit of QEvent, receive events to paint e update widgets.

Parameters
QPaintEvent

Definition at line 233 of file ColorBar.cpp.

void te::qt::widgets::colorbar::ColorBar::removePin ( )
protectedslot

It remove a colorbar pin.

Definition at line 167 of file ColorBar.cpp.

Referenced by ColorBar().

void te::qt::widgets::colorbar::ColorBar::setClickPrecision ( double  precision)

It sets the precision of mouse click.

Parameters
doubleprecision of click.

Definition at line 128 of file ColorBar.cpp.

Referenced by ColorBar().

void te::qt::widgets::colorbar::ColorBar::setColorBar ( te::color::ColorBar cb)

It sets the color bar.

Parameters
te::color::colorBarto paint in the colorbar.
Note
This class takes the ownership of the colorbar pointer.

Definition at line 108 of file ColorBar.cpp.

Referenced by te::qt::widgets::GroupingWidget::updateUi(), and te::qt::widgets::ColorMapWidget::updateUi().

void te::qt::widgets::colorbar::ColorBar::setHeight ( int  value)

Sets the height of colobar.

Parameters
Valueof height.

Definition at line 93 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.

Parameters
Minimumvalue.
Maximumvalue.

Definition at line 100 of file ColorBar.cpp.

void te::qt::widgets::colorbar::ColorBar::setScaleEngine ( )
protected

Sets the transformation and the scale of colorbar values.

Definition at line 122 of file ColorBar.cpp.

Referenced by ColorBar().

void te::qt::widgets::colorbar::ColorBar::setScaleVisible ( bool  flag)

Sets scale of color bar visibility.

Parameters
flagBoolean value to set the scale of color bar visibility.
Note
TRUE is the defaul behavior.

Definition at line 86 of file ColorBar.cpp.

void te::qt::widgets::colorbar::ColorBar::wheelEvent ( QWheelEvent *  e)
protectedvirtual

It waits the wheel from mouse to do something.

Parameters
QWheelEvent
Note
In this case, it change the color lightness.

Definition at line 328 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().

Member Data Documentation

QWidgetAction* te::qt::widgets::colorbar::ColorBar::m_addPinAction
protected

Add Pin Action.

Definition at line 276 of file ColorBar.h.

Referenced by ColorBar().

double te::qt::widgets::colorbar::ColorBar::m_clickPrecision
protected

Precision of click to get a color stop.

Definition at line 264 of file ColorBar.h.

te::color::ColorBar* te::qt::widgets::colorbar::ColorBar::m_colorBar
protected

Color map information.

Definition at line 256 of file ColorBar.h.

QMenu* te::qt::widgets::colorbar::ColorBar::m_colorBarMenu
protected

Popup menu for Pin on color bar.

Definition at line 268 of file ColorBar.h.

Referenced by ColorBar().

te::qt::widgets::ColorPickerToolButton* te::qt::widgets::colorbar::ColorBar::m_colorBarPicker
protected

Color picker for colorbar menu.

Definition at line 272 of file ColorBar.h.

Referenced by ColorBar().

double te::qt::widgets::colorbar::ColorBar::m_currentPinPos
protected

Value of the current Pin position.

Definition at line 266 of file ColorBar.h.

QWidgetAction* te::qt::widgets::colorbar::ColorBar::m_editPinAction
protected

Edit Pin Action.

Definition at line 278 of file ColorBar.h.

Referenced by ColorBar().

QAction* te::qt::widgets::colorbar::ColorBar::m_equalStepAction
protected

Equal Step Pin Action.

Definition at line 282 of file ColorBar.h.

Referenced by ColorBar().

int te::qt::widgets::colorbar::ColorBar::m_height
protected

Height of colobar.

Definition at line 260 of file ColorBar.h.

double te::qt::widgets::colorbar::ColorBar::m_initialXPos
protected

Position initial to move color.

Definition at line 262 of file ColorBar.h.

Referenced by ColorBar().

QwtInterval te::qt::widgets::colorbar::ColorBar::m_interval
protected

Color vector.

Definition at line 258 of file ColorBar.h.

Referenced by ColorBar().

QMenu* te::qt::widgets::colorbar::ColorBar::m_pinMenu
protected

Popup menu for Pin on color bar.

Definition at line 270 of file ColorBar.h.

Referenced by ColorBar().

te::qt::widgets::ColorPickerToolButton* te::qt::widgets::colorbar::ColorBar::m_pinPicker
protected

Color picker for pin menu.

Definition at line 274 of file ColorBar.h.

Referenced by ColorBar().

QAction* te::qt::widgets::colorbar::ColorBar::m_removePinAction
protected

Remove Pin Action.

Definition at line 280 of file ColorBar.h.

Referenced by ColorBar().


The documentation for this class was generated from the following files: