I have a class which is defined like so:
class ImageData: public QObject, public QwtRasterData
{
...
private:
// We store pointers to a value to use for the color bar
// We need this instead of member variable so that the interactive color bar works
double *_colorMin;
double *_colorMax;
FuncPtr *_colorBarModifier;
};
My GUI changes the values of those pointers.
QwtPlotSpectrogram *spectrogram = new QwtPlotSpectrogram ();
spectrogram->setColorMap (new TransparentLinearColorMap (_colorMap));
spectrogram->setData (image);
image is of type ImageData which is derived from QwtRasterData. _colorMap was connected to the same values of the the min/max. Thus, when the GUI is up and the user is interacting with the color bar and Qwt replots; it is using the current value of those pointers.
Why this no longer works is I have to do this:
spectrogram->setColorMap (new TransparentLinearColorMap (_colorMap));
instead of my previous "spectrogram->setColorMap (_colorMap);" which would make the spectrogram use the same colorMap that the interactive GUI was using. In other words, since spectrogram owns the new'ed colorMap, my GUI is no longer interacting with the right one.
I hope that all makes sense! Anyway, I'm not saying this is the best way of doing this, but maybe I'm missing something easy on either fixing this or a better design?
I look forward to this! Especially if we can have multi-dimensional matrices and easy ways of slicing them.
Joey
Bookmarks