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)

It initializes a new ColorBar.

Parameters
parent
te::qt::widgets::colorbar::ColorBar::~ColorBar ( )

Destructor.

Member Function Documentation

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

It add a colorbar pin.

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

It build and paint the colorbar.

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
void te::qt::widgets::colorbar::ColorBar::editPin ( )
protectedslot

It edit a colorbar pin.

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

It changes the pins positions for an equal distribution.

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

It returns the colorbar.

Returns
Current color bar.
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.
virtual 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.
virtual 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.
virtual 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.
virtual void te::qt::widgets::colorbar::ColorBar::paintEvent ( QPaintEvent *  e)
protectedvirtual

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

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

It remove a colorbar pin.

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

It sets the precision of mouse click.

Parameters
doubleprecision of click.
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.
void te::qt::widgets::colorbar::ColorBar::setHeight ( int  value)

Sets the height of colobar.

Parameters
Valueof height.
void te::qt::widgets::colorbar::ColorBar::setInterval ( double  min,
double  max 
)

It sets the min e max value of colorbar.

Parameters
Minimumvalue.
Maximumvalue.
void te::qt::widgets::colorbar::ColorBar::setScaleEngine ( )
protected

Sets the transformation and the scale of colorbar values.

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.
virtual 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.

Member Data Documentation

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

Add Pin Action.

Definition at line 276 of file ColorBar.h.

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.

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.

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.

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

Equal Step Pin Action.

Definition at line 282 of file ColorBar.h.

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.

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

Color vector.

Definition at line 258 of file ColorBar.h.

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

Popup menu for Pin on color bar.

Definition at line 270 of file ColorBar.h.

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.

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

Remove Pin Action.

Definition at line 280 of file ColorBar.h.


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