mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Clean up after review
* Disable grid lines and tick marks if x range is empty. * Rename intervals to intervalCount when it is an integer count. * Fix some compile warnings.
This commit is contained in:
@@ -22,7 +22,7 @@
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QwtScaleDiv RiuQwtLinearScaleEngine::divideScale(double x1, double x2, double majorStepInterval, double minorStepInterval)
|
||||
QwtScaleDiv RiuQwtLinearScaleEngine::divideScaleWithExplicitIntervals(double x1, double x2, double majorStepInterval, double minorStepInterval)
|
||||
{
|
||||
QwtInterval interval(x1, x2);
|
||||
QwtInterval roundedInterval = this->align(interval, majorStepInterval);
|
||||
|
||||
@@ -28,5 +28,5 @@
|
||||
class RiuQwtLinearScaleEngine : public QwtLinearScaleEngine
|
||||
{
|
||||
public:
|
||||
QwtScaleDiv divideScale(double x1, double x2, double majorStepInterval, double minorStepInterval);
|
||||
QwtScaleDiv divideScaleWithExplicitIntervals(double x1, double x2, double majorStepInterval, double minorStepInterval);
|
||||
};
|
||||
|
||||
@@ -315,7 +315,7 @@ void RiuWellLogTrack::setMajorAndMinorTickIntervals(double majorTickInterval, do
|
||||
if (scaleEngine)
|
||||
{
|
||||
QwtInterval currentRange = this->axisInterval(QwtPlot::xTop);
|
||||
QwtScaleDiv scaleDiv = scaleEngine->divideScale(currentRange.minValue(), currentRange.maxValue(), majorTickInterval, minorTickInterval);
|
||||
QwtScaleDiv scaleDiv = scaleEngine->divideScaleWithExplicitIntervals(currentRange.minValue(), currentRange.maxValue(), majorTickInterval, minorTickInterval);
|
||||
|
||||
this->setAxisScaleDiv(QwtPlot::xTop, scaleDiv);
|
||||
}
|
||||
@@ -324,10 +324,10 @@ void RiuWellLogTrack::setMajorAndMinorTickIntervals(double majorTickInterval, do
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuWellLogTrack::setAutoTickIntervals(int maxMajorTickIntervals, int maxMinorTickIntervals)
|
||||
void RiuWellLogTrack::setAutoTickIntervalCounts(int maxMajorTickIntervalCount, int maxMinorTickIntervalCount)
|
||||
{
|
||||
this->setAxisMaxMajor(QwtPlot::xTop, maxMajorTickIntervals);
|
||||
this->setAxisMaxMinor(QwtPlot::xTop, maxMinorTickIntervals);
|
||||
this->setAxisMaxMajor(QwtPlot::xTop, maxMajorTickIntervalCount);
|
||||
this->setAxisMaxMinor(QwtPlot::xTop, maxMinorTickIntervalCount);
|
||||
// Reapply axis limits to force Qwt to use the tick settings.
|
||||
QwtInterval currentRange = this->axisInterval(QwtPlot::xTop);
|
||||
this->setAxisScale(QwtPlot::xTop, currentRange.minValue(), currentRange.maxValue());
|
||||
|
||||
@@ -56,7 +56,7 @@ public:
|
||||
int widthScaleFactor() const;
|
||||
void enableGridLines(bool majorGridLines, bool minorGridLines);
|
||||
void setMajorAndMinorTickIntervals(double majorTickInterval, double minorTickInterval);
|
||||
void setAutoTickIntervals(int maxMajorTickIntervals, int maxMinorTickIntervals);
|
||||
void setAutoTickIntervalCounts(int maxMajorTickIntervalCount, int maxMinorTickIntervalCount);
|
||||
double getCurrentMajorTickInterval() const;
|
||||
double getCurrentMinorTickInterval() const;
|
||||
protected:
|
||||
|
||||
Reference in New Issue
Block a user