27 #include "../../../color/RGBAColor.h"
28 #include "../../../dataaccess/dataset/DataSetType.h"
29 #include "../../../dataaccess/dataset/ObjectIdSet.h"
30 #include "../../../se.h"
31 #include "../utils/ScopedCursor.h"
40 #include <qwt_plot_curve.h>
41 #include <qwt_plot_grid.h>
42 #include <qwt_plot_histogram.h>
43 #include <qwt_plot_magnifier.h>
44 #include <qwt_plot_panner.h>
45 #include <qwt_plot_picker.h>
46 #include <qwt_plot_zoomer.h>
47 #include <qwt_picker_machine.h>
49 #include <qwt_symbol.h>
52 #include <qapplication.h>
72 setAutoFillBackground(
true );
73 setAutoReplot(
true );
80 m_panner =
new QwtPlotPanner(this->canvas());
81 m_panner->setMouseButton(Qt::RightButton);
84 m_leftPicker =
new QwtPlotPicker(QwtPlot::xBottom, QwtPlot::yLeft, QwtPlotPicker::RectRubberBand, QwtPicker::AlwaysOff, this->canvas());
85 m_leftPicker->setStateMachine(
new QwtPickerDragRectMachine );
87 m_leftPointPicker =
new QwtPlotPicker(QwtPlot::xBottom, QwtPlot::yLeft, QwtPlotPicker::CrossRubberBand, QwtPicker::AlwaysOff, this->canvas());
89 m_leftPointPicker->setMousePattern(QwtEventPattern::MouseSelect1, Qt::LeftButton);
91 m_rigthPointPicker =
new QwtPlotPicker(QwtPlot::xBottom, QwtPlot::yLeft, QwtPlotPicker::CrossRubberBand, QwtPicker::AlwaysOff, this->canvas());
95 m_ctrlPicker =
new QwtPlotPicker(QwtPlot::xBottom, QwtPlot::yLeft, QwtPlotPicker::RectRubberBand, QwtPicker::AlwaysOff, this->canvas());
96 m_ctrlPicker->setStateMachine(
new QwtPickerDragRectMachine );
97 m_ctrlPicker->setMousePattern(QwtEventPattern::MouseSelect1, Qt::LeftButton, Qt::ControlModifier);
99 m_shiftPicker =
new QwtPlotPicker(QwtPlot::xBottom, QwtPlot::yLeft, QwtPlotPicker::RectRubberBand, QwtPicker::AlwaysOff, this->canvas());
100 m_shiftPicker->setStateMachine(
new QwtPickerDragRectMachine );
101 m_shiftPicker->setMousePattern(QwtEventPattern::MouseSelect1, Qt::LeftButton, Qt::ShiftModifier);
110 canvas()->setCursor(Qt::CrossCursor);
121 delete m_shiftPicker;
131 m_chartStyle = newStyle;
140 const QwtPlotItemList& itmList = itemList();
142 for ( QwtPlotItemIterator it = itmList.begin();
143 it != itmList.end(); ++it )
161 const QwtPlotItemList& itmList = itemList();
163 for ( QwtPlotItemIterator it = itmList.begin();
164 it != itmList.end(); ++it )
184 QwtText title( m_chartStyle->getTitle());
185 QwtText axisX(m_chartStyle->getAxisX());
186 QwtText axisY(m_chartStyle->getAxisY());
188 title.setFont(m_chartStyle->getTitleFont());
189 axisX.setFont(m_chartStyle->getAxisFont());
190 axisY.setFont(m_chartStyle->getAxisFont());
193 setAxisTitle( QwtPlot::yLeft, axisY);
194 setAxisTitle( QwtPlot::xBottom, axisX);
196 if(m_chartStyle->getGridChecked())
197 m_grid->attach(
this);
201 canvas()->setPalette(m_chartStyle->getColor());
209 const QwtPlotItemList& itmList = itemList();
210 for ( QwtPlotItemIterator it = itmList.begin();
211 it != itmList.end(); ++it )
215 if (QObject::sender() == m_ctrlPicker || QObject::sender() == m_shiftPicker)
216 emit selected(static_cast<te::qt::widgets::ScatterChart*>(*it)->highlight( rect),
true);
218 emit selected(static_cast<te::qt::widgets::ScatterChart*>(*it)->highlight( rect),
false);
224 if (QObject::sender() == m_ctrlPicker || QObject::sender() == m_shiftPicker)
225 emit selected(static_cast<te::qt::widgets::HistogramChart*>(*it)->highlight( rect),
true);
227 emit selected(static_cast<te::qt::widgets::HistogramChart*>(*it)->highlight( rect),
false);
A class that models the description of a dataset.
This class represents a set of unique ids created in the same context. i.e. from the same data set...
A class to represent a histogram chart.
A class to represent a scatter's chart.
A class used to define a chartDisplay's style.
A class to represent a chart display.