A class to represent a chart display. More...
#include <ChartDisplay.h>
Signals | |
void | selected (te::da::ObjectIdSet *, const bool &) |
Emmit when objects were selected. More... | |
Public Member Functions | |
void | adjustDisplay () |
Updates the general display settings according to the ChartStyle. The adjusted properties are: Title; Axis titles (x and Y); Weather to display the grid or not; Background color;. More... | |
ChartDisplay (QWidget *parent=NULL, QString title="", ChartStyle *style=0) | |
Constructor. More... | |
te::qt::widgets::ChartStyle * | getStyle () |
Returns a pointer to the display's style. More... | |
void | highlightOIds (const te::da::ObjectIdSet *oids) |
Highlights the objects identified by oids. More... | |
void | setPickerStyle (int chartType) |
It sets the QwtPlotPicker's state machine (selection mode) More... | |
void | setSelectionColor (QColor selColor) |
color used to hgihlight selected objects on this display. More... | |
void | setStyle (te::qt::widgets::ChartStyle *newStyle) |
It sets the display's style. More... | |
~ChartDisplay () | |
Destructor. More... | |
Protected Slots | |
void | onPointPicked (const QPointF &pos) |
Called when the user clicks on the canvas area. Will highlight the data, if possible, depending on the type of chart being displayed (f.e. histogram, scatter, etc). More... | |
void | onRectPicked (const QRectF &rect) |
Called when the user selects an area of the canvas. Will highlight the data, if possible, depending on the type of chart being displayed (f.e. histogram, scatter, etc). More... | |
Private Attributes | |
ChartStyle * | m_chartStyle |
The display's style. More... | |
QwtPlotPicker * | m_ctrlPicker |
The display's control button picker. More... | |
QwtPlotGrid * | m_grid |
The display's grid. More... | |
QwtPlotPicker * | m_leftPicker |
The display's left button picker. More... | |
QwtPlotPanner * | m_panner |
The display's panner. More... | |
QwtPlotPicker * | m_shiftPicker |
The display's control button picker. More... | |
A class to represent a chart display.
Definition at line 63 of file ChartDisplay.h.
te::qt::widgets::ChartDisplay::ChartDisplay | ( | QWidget * | parent = NULL , |
QString | title = "" , |
||
ChartStyle * | style = 0 |
||
) |
Constructor.
It constructs a ChartDisplay with the given title and style.
parent | this widget's parent |
title | this widget's title. |
Definition at line 56 of file ChartDisplay.cpp.
References te::map::DotLine, m_chartStyle, m_ctrlPicker, m_grid, m_leftPicker, m_panner, m_shiftPicker, onPointPicked(), selected(), and te::map::SolidLine.
te::qt::widgets::ChartDisplay::~ChartDisplay | ( | ) |
Destructor.
Definition at line 101 of file ChartDisplay.cpp.
void te::qt::widgets::ChartDisplay::adjustDisplay | ( | ) |
Updates the general display settings according to the ChartStyle. The adjusted properties are: Title; Axis titles (x and Y); Weather to display the grid or not; Background color;.
Definition at line 219 of file ChartDisplay.cpp.
Referenced by te::qt::widgets::HistogramDialog::onOkPushButtonClicked(), te::qt::widgets::ScatterDialog::onOkPushButtonClicked(), and te::qt::widgets::RasterHistogramWidget::RasterHistogramWidget().
te::qt::widgets::ChartStyle * te::qt::widgets::ChartDisplay::getStyle | ( | ) |
Returns a pointer to the display's style.
Definition at line 163 of file ChartDisplay.cpp.
void te::qt::widgets::ChartDisplay::highlightOIds | ( | const te::da::ObjectIdSet * | oids | ) |
Highlights the objects identified by oids.
oids | The identifiers of plotitems to be highlighted. |
Definition at line 174 of file ChartDisplay.cpp.
References te::qt::widgets::ScatterChart::highlight(), te::qt::widgets::HistogramChart::highlight(), te::qt::widgets::HISTOGRAM_CHART, and te::qt::widgets::SCATTER_CHART.
|
protectedslot |
Called when the user clicks on the canvas area. Will highlight the data, if possible, depending on the type of chart being displayed (f.e. histogram, scatter, etc).
Definition at line 245 of file ChartDisplay.cpp.
References te::qt::widgets::HISTOGRAM_CHART, and te::qt::widgets::SCATTER_CHART.
Referenced by ChartDisplay().
|
protectedslot |
Called when the user selects an area of the canvas. Will highlight the data, if possible, depending on the type of chart being displayed (f.e. histogram, scatter, etc).
Definition at line 274 of file ChartDisplay.cpp.
References te::qt::widgets::SCATTER_CHART.
|
signal |
Emmit when objects were selected.
Referenced by ChartDisplay().
void te::qt::widgets::ChartDisplay::setPickerStyle | ( | int | chartType | ) |
It sets the QwtPlotPicker's state machine (selection mode)
chartType | The type of the chart that the picker will be adjusted to funtion for. |
Although the selection function can work for any chart based on a single point (or click) some charts can benefit from a different behavior, such as a drag & release selection. This function will adjust the picker state machine to better suit the type of chart being displayed.
The current chart types supported and their respective selection mode are as follow:
te::qt::widgets::HISTOGRAM_CHART = Point selection; te::qt::widgets::SCATTER_CHART = Rectangle selection;
Definition at line 111 of file ChartDisplay.cpp.
References te::qt::widgets::SCATTER_CHART.
Referenced by te::qt::widgets::ScatterDialog::onOkPushButtonClicked().
void te::qt::widgets::ChartDisplay::setSelectionColor | ( | QColor | selColor | ) |
color used to hgihlight selected objects on this display.
selColor | The color used to hgihlight selected objects on this display. |
Definition at line 199 of file ChartDisplay.cpp.
References te::qt::widgets::HISTOGRAM_CHART, te::qt::widgets::SCATTER_CHART, te::qt::widgets::ScatterChart::setSelectionColor(), and te::qt::widgets::HistogramChart::setSelectionColor().
void te::qt::widgets::ChartDisplay::setStyle | ( | te::qt::widgets::ChartStyle * | newStyle | ) |
It sets the display's style.
newStyle | The new style. |
Definition at line 168 of file ChartDisplay.cpp.
Referenced by te::qt::widgets::ChartStyleFrame::getDisplay(), and te::qt::widgets::ChartStyleFrame::setDisplay().
|
private |
|
private |
The display's control button picker.
Definition at line 172 of file ChartDisplay.h.
Referenced by ChartDisplay().
|
private |
|
private |
The display's left button picker.
Definition at line 171 of file ChartDisplay.h.
Referenced by ChartDisplay().
|
private |
|
private |
The display's control button picker.
Definition at line 173 of file ChartDisplay.h.
Referenced by ChartDisplay().