27 #include "../../../color/RGBAColor.h"
28 #include "../../../dataaccess/dataset/DataSetType.h"
29 #include "../../../dataaccess/dataset/ObjectIdSet.h"
30 #include "../../../se.h"
39 #include <qwt_plot_curve.h>
40 #include <qwt_plot_grid.h>
41 #include <qwt_plot_histogram.h>
42 #include <qwt_plot_magnifier.h>
43 #include <qwt_plot_panner.h>
44 #include <qwt_plot_picker.h>
45 #include <qwt_plot_zoomer.h>
46 #include <qwt_picker_machine.h>
48 #include <qwt_symbol.h>
51 #include <qapplication.h>
71 setAutoFillBackground(
true );
72 setAutoReplot(
true );
79 m_panner =
new QwtPlotPanner(this->canvas());
80 m_panner->setMouseButton(Qt::RightButton);
83 m_leftPicker =
new QwtPlotPicker(QwtPlot::xBottom, QwtPlot::yLeft, QwtPlotPicker::RectRubberBand, QwtPicker::AlwaysOff, this->canvas());
84 m_leftPicker->setStateMachine(
new QwtPickerDragRectMachine );
86 m_leftPointPicker =
new QwtPlotPicker(QwtPlot::xBottom, QwtPlot::yLeft, QwtPlotPicker::CrossRubberBand, QwtPicker::AlwaysOff, this->canvas());
88 m_leftPointPicker->setMousePattern(QwtEventPattern::MouseSelect1, Qt::LeftButton);
90 m_rigthPointPicker =
new QwtPlotPicker(QwtPlot::xBottom, QwtPlot::yLeft, QwtPlotPicker::CrossRubberBand, QwtPicker::AlwaysOff, this->canvas());
94 m_ctrlPicker =
new QwtPlotPicker(QwtPlot::xBottom, QwtPlot::yLeft, QwtPlotPicker::RectRubberBand, QwtPicker::AlwaysOff, this->canvas());
95 m_ctrlPicker->setStateMachine(
new QwtPickerDragRectMachine );
96 m_ctrlPicker->setMousePattern(QwtEventPattern::MouseSelect1, Qt::LeftButton, Qt::ControlModifier);
98 m_shiftPicker =
new QwtPlotPicker(QwtPlot::xBottom, QwtPlot::yLeft, QwtPlotPicker::RectRubberBand, QwtPicker::AlwaysOff, this->canvas());
99 m_shiftPicker->setStateMachine(
new QwtPickerDragRectMachine );
100 m_shiftPicker->setMousePattern(QwtEventPattern::MouseSelect1, Qt::LeftButton, Qt::ShiftModifier);
109 canvas()->setCursor(Qt::CrossCursor);
120 delete m_shiftPicker;
130 m_chartStyle = newStyle;
138 QApplication::setOverrideCursor(Qt::WaitCursor);
139 const QwtPlotItemList& itmList = itemList();
141 for ( QwtPlotItemIterator it = itmList.begin();
142 it != itmList.end(); ++it )
155 QApplication::restoreOverrideCursor();
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());
208 QApplication::setOverrideCursor(Qt::WaitCursor);
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);
232 QApplication::restoreOverrideCursor();
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.