How can I tell which scale is used on an axis?
Hi! I've created a Qwt Plot with the ability to switch between log scale and arithmetic scale. I'd like to be able to exclude any 0s in the data when I am in log scale mode. I set the scale this way:
Then later on when data comes in, I need to filter out the zeros. How can I figure out which scale engine is currently in use? Thanks!
Re: How can I tell which scale is used on an axis?
How do you switch? Using a push button or other GUI component that the user clicks? Connect to its clicked() signal and record which scale type is being used in some member variable.
The other, ugly way is to call plot->axisScaleEngine() and dynamic_cast<> it to determine the type.
Re: How can I tell which scale is used on an axis?
Or: plot->axisScaleEngine()->transformation()->type()
Uwe
Re: How can I tell which scale is used on an axis?
Quote:
Originally Posted by
Uwe
Or: plot->axisScaleEngine()->transformation()->type()
I should have guessed there would be something like that... Next time, I should use a shovel with a longer handle so I can dig deeper. This one was too short - I could only go one level down in the method hierarchy. :o
Re: How can I tell which scale is used on an axis?
By the way: I don't have bad feelings about dynamic casts or consider them as ugly.
But for ( nowadays maybe obsolete ) memory reasons I take care, that Qwt doesn't need to be compiled with RTTI. So you can always expect to find a solution without dynamic casts.
Uwe