{
public:
SpectrogramData(double (*b)(double, double), double rang1[2], double rang2[2]):
QwtRasterData(QwtDoubleRect
(rang1
[0], rang2
[0], rang1
[1]- rang1
[0], rang2
[1]- rang2
[0])) {
benchFunc = b;
rangeX1[0] = rang1[0]; rangeX1[1] = rang1[1];
rangeX2[0] = rang1[0]; rangeX2[1] = rang2[1];
}
{
return new SpectrogramData( benchFunc , &rangeX1[2], &rangeX2[2]); //<<< << this is the reason for the error
}
{
}
virtual double value(double x, double y) const
{
const double result = benchFunc(x,y);
return result;
}
private:
double (*benchFunc)(double, double); // function pointer
double rangeX1[2];
double rangeX2[2];
};
class SpectrogramData: public QwtRasterData
{
public:
SpectrogramData(double (*b)(double, double), double rang1[2], double rang2[2]):
QwtRasterData(QwtDoubleRect(rang1[0], rang2[0], rang1[1]- rang1[0], rang2[1]- rang2[0]))
{
benchFunc = b;
rangeX1[0] = rang1[0]; rangeX1[1] = rang1[1];
rangeX2[0] = rang1[0]; rangeX2[1] = rang2[1];
}
virtual QwtRasterData *copy() const
{
return new SpectrogramData( benchFunc , &rangeX1[2], &rangeX2[2]); //<<< << this is the reason for the error
}
virtual QwtDoubleInterval range() const
{
return QwtDoubleInterval(0.0, 10.0);
}
virtual double value(double x, double y) const
{
const double result = benchFunc(x,y);
return result;
}
private:
double (*benchFunc)(double, double); // function pointer
double rangeX1[2];
double rangeX2[2];
};
To copy to clipboard, switch view to plain text mode
Bookmarks