4 Attachment(s)
a few questions about using QwtMatrixRasterData (and other classes)
this component is very useful for my circle of tasks
but I need to change something and don't know how to do that exactly.
1. we have z-(color)-scale with gradient
Attachment 8795
I have 4 colors.
in my case it's very necessary to have only clear colors without smooth gradient between each color.
can I achieve it with this component? and how... may be try another alternative?
2. Also got it from example - possibility of hint
Attachment 8796
code:
Code:
public:
setTrackerMode(AlwaysOn);
}
bg.setAlpha(200);
text.
setBackgroundBrush(QBrush(bg
));
return text;
}
};
hereby we have coordinates in the hint near cursor (x, y)
how to add here the third value of z axis?
3. How to disable zooming out below a certain value (for example when the pic fit to width)?
example:
here in the picture good variant
Attachment 8797
and here - not appropriate
Attachment 8798
thanks a lot!
Re: a few questions about using QwtMatrixRasterData (and other classes)
Quote:
I have 4 colors. in my case it's very necessary to have only clear colors without smooth gradient between each color.
can I achieve it with this component? and how... may be try another alternative?
How to map values to colors is the job of the color map. You can write your own one, but I guess setting QwtLinearColorMap::FixedColors mode is all what needs to be done.
Quote:
hereby we have coordinates in the hint near cursor (x, y)
how to add here the third value of z axis?
pos is the position in plot coordinates. All you need to do is to ask the matrix raster data object for the z value at the position.
Quote:
How to disable zooming out below a certain value (for example when the pic fit to width)?
Depends on how you have implemented zooming.
F.e. QwtPlotZoomer never zooms out of the initial scale ranges, that have been set by the application. Here the answer would be simply: don't assign scale ranges you don't want to have.
Uwe
Re: a few questions about using QwtMatrixRasterData (and other classes)
Quote:
setting QwtLinearColorMap::FixedColors mode is all what needs to be done.
oh, sorry, didn't noticed, right that's what I need!
the second: I got it (z value) through the value() method of QwtMatrixRasterData as you told me, thanks!
and the third:
class MyZoomer - that's all I have about implemented zooming.
and it seems I didn't assign scale ranges anywhere at all.
how can I do it?
is the method setZoomBase() helpful in this case?
Re: a few questions about using QwtMatrixRasterData (and other classes)
Quote:
Originally Posted by
layer
and it seems I didn't assign scale ranges anywhere at all.
how can I do it?
QwtPlot::setAxisScale().
Uwe
Re: a few questions about using QwtMatrixRasterData (and other classes)
Re: a few questions about using QwtMatrixRasterData (and other classes)
:) all that I needed to do for the last question is write these few lines:
Code:
magnifier
->setAxisEnabled
(QwtPlot::xBottom,
false);
forbid zooming for x-axis, such pretty simple.
great Lib:)