Hello everyone,

This is my first post on the forums. I've lurked on a few threads trying to understand how the Qwt spectrogram example can take data, but I can't get my head around QwtRasterData.

Qt Code:
  1. class SpectrogramData: public QwtRasterData
  2. {
  3. public:
  4. SpectrogramData():
  5. QwtRasterData(QwtDoubleRect(-1.5, -1.5, 3.0, 3.0))
  6. {
  7. }
  8.  
  9. virtual QwtRasterData *copy() const
  10. {
  11. return new SpectrogramData();
  12. }
  13.  
  14. virtual QwtDoubleInterval range() const
  15. {
  16. return QwtDoubleInterval(0.0, 10);
  17. }
  18.  
  19. virtual double value(double x, double y) const
  20. {
  21. const double c = 0.842;
  22.  
  23. const double v1 = x * x + (y-c) * (y+c);
  24. const double v2 = x * (y+c) + x * (y+c);
  25.  
  26. return 1.0 / (v1 * v1 + v2 * v2);
  27. }
  28. };
To copy to clipboard, switch view to plain text mode 

My data is an 11x11 array (double data[11][11];). Each entry is depicting a 1x1cm^2 area from a detector. How could I modify the spectrogram example to display my data?

Secondary: Would there be a way to disable interpolation?

Thank you.


Mr_Cloud