repository for casafeather app
Source
xxxxxxxxxx
typedef QwtInterval QwtDoubleInterval;
typedef QwtIntervalSeriesData qwt_interval_t;
inline void set_data(QwtPlotCurve *curve, const QVector<double> &x, const QVector<double> &y) {
curve->setSamples(x,y);
}
inline void set_color_map( QwtScaleWidget *scale, QwtDoubleInterval &range, const QwtLinearColorMap &colorMap ) {
QwtLinearColorMap* copyMap = new QwtLinearColorMap( colorMap.color1( ), colorMap.color2( ) );
QVector<double> colorStops = colorMap.colorStops();
for ( int i = 1; i < colorStops.size() - 1; ++i) {
copyMap->addColorStop( colorStops[i], QColor(colorMap.rgb(QwtInterval(0,1), colorStops[i])) );
}
scale->setColorMap( range, copyMap );
}
template<class T> inline void set_symbol( T *qwt_thing, const QwtSymbol &sym ) {
qwt_thing->setSymbol(&sym);
}
typedef QwtIntervalData qwt_interval_t;
inline void set_data(QwtPlotCurve *curve, const QVector<double> &x, const QVector<double> &y) {
curve->setData(x,y);
}
inline void set_color_map( QwtScaleWidget *scale, QwtDoubleInterval &range, const QwtLinearColorMap &colorMap ) {
scale->setColorMap( range, colorMap );
}
template<class T> inline void set_symbol( T *qwt_thing, const QwtSymbol &sym ) {
qwt_thing->setSymbol(sym);
}