2 #include <qwt_global.h>
3 #include <qwt_scale_widget.h>
4 #include <qwt_plot_curve.h>
5 #include <qwt_color_map.h>
6 #if QWT_VERSION >= 0x060000
7 #include <qwt_compat.h>
8 #include <qwt_series_data.h>
9 #include <qwt_plot_canvas.h>
12 inline void set_data(QwtPlotCurve *curve,
const QVector<double> &x,
const QVector<double> &y) {
13 curve->setSamples(x,y);
15 inline void set_color_map( QwtScaleWidget *scale, QwtDoubleInterval &range,
const QwtLinearColorMap &colorMap ) {
16 QwtLinearColorMap* copyMap =
new QwtLinearColorMap( colorMap.color1( ), colorMap.color2( ) );
17 QVector<double> colorStops = colorMap.colorStops();
18 for (
int i = 1; i < colorStops.size() - 1; ++i) {
19 copyMap->addColorStop( colorStops[i], QColor(colorMap.rgb(QwtInterval(0,1), colorStops[i])) );
21 scale->setColorMap( range, copyMap );
23 template<
class T>
inline void set_symbol( T *qwt_thing,
const QwtSymbol &sym ) {
24 qwt_thing->setSymbol(&sym);
27 #include <qwt_interval_data.h>
29 inline void set_data(QwtPlotCurve *curve,
const QVector<double> &x,
const QVector<double> &y) {
32 inline void set_color_map( QwtScaleWidget *scale, QwtDoubleInterval &range,
const QwtLinearColorMap &colorMap ) {
33 scale->setColorMap( range, colorMap );
35 template<
class T>
inline void set_symbol( T *qwt_thing,
const QwtSymbol &sym ) {
36 qwt_thing->setSymbol(sym);
void set_color_map(QwtScaleWidget *scale, QwtDoubleInterval &range, const QwtLinearColorMap &colorMap)
void set_data(QwtPlotCurve *curve, const QVector< double > &x, const QVector< double > &y)
void set_symbol(T *qwt_thing, const QwtSymbol &sym)
QwtIntervalData qwt_interval_t