#1375 Reduced window zoom limit to 10 decades instead of 4

This commit is contained in:
Jacob Støren 2017-03-31 16:27:05 +02:00
parent e679b551c9
commit e5f593db60
4 changed files with 41 additions and 3 deletions

View File

@ -23,6 +23,7 @@ ${CEE_CURRENT_LIST_DIR}RiuPropertyViewTabWidget.h
${CEE_CURRENT_LIST_DIR}RiuQwtScalePicker.h ${CEE_CURRENT_LIST_DIR}RiuQwtScalePicker.h
${CEE_CURRENT_LIST_DIR}RiuQwtCurvePointTracker.h ${CEE_CURRENT_LIST_DIR}RiuQwtCurvePointTracker.h
${CEE_CURRENT_LIST_DIR}RiuQwtPlotWheelZoomer.h ${CEE_CURRENT_LIST_DIR}RiuQwtPlotWheelZoomer.h
${CEE_CURRENT_LIST_DIR}RiuQwtPlotZoomer.h
${CEE_CURRENT_LIST_DIR}RiuRecentFileActionProvider.h ${CEE_CURRENT_LIST_DIR}RiuRecentFileActionProvider.h
${CEE_CURRENT_LIST_DIR}RiuResultInfoPanel.h ${CEE_CURRENT_LIST_DIR}RiuResultInfoPanel.h
${CEE_CURRENT_LIST_DIR}RiuResultQwtPlot.h ${CEE_CURRENT_LIST_DIR}RiuResultQwtPlot.h

View File

@ -36,6 +36,7 @@
#include "RiaColorTables.h" #include "RiaColorTables.h"
#include "qwt_plot_zoneitem.h" #include "qwt_plot_zoneitem.h"
#include "qwt_date.h" #include "qwt_date.h"
#include "RiuQwtPlotZoomer.h"
@ -86,7 +87,7 @@ RiuFlowCharacteristicsPlot::RiuFlowCharacteristicsPlot(RimFlowCharacteristicsPlo
void RiuFlowCharacteristicsPlot::addWindowZoom(QwtPlot* plot) void RiuFlowCharacteristicsPlot::addWindowZoom(QwtPlot* plot)
{ {
auto zoomer = new QwtPlotZoomer(plot->canvas()); auto zoomer = new RiuQwtPlotZoomer(plot->canvas());
zoomer->setRubberBandPen(QColor(Qt::black)); zoomer->setRubberBandPen(QColor(Qt::black));
zoomer->setTrackerMode(QwtPicker::AlwaysOff); zoomer->setTrackerMode(QwtPicker::AlwaysOff);
zoomer->setTrackerPen(QColor(Qt::black)); zoomer->setTrackerPen(QColor(Qt::black));

View File

@ -0,0 +1,35 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2017- Statoil ASA
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "qwt_plot_zoomer.h"
class RiuQwtPlotZoomer : public QwtPlotZoomer
{
public:
RiuQwtPlotZoomer(QWidget * canvas, bool doReplot=true) : QwtPlotZoomer(canvas, doReplot) {}
protected:
virtual QSizeF minZoomSize() const override
{
return QwtPlotZoomer::minZoomSize() / 10.0e6;
}
};

View File

@ -47,6 +47,7 @@
#include <float.h> #include <float.h>
#include "qwt_plot_magnifier.h" #include "qwt_plot_magnifier.h"
#include "RiuQwtPlotWheelZoomer.h" #include "RiuQwtPlotWheelZoomer.h"
#include "RiuQwtPlotZoomer.h"
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
@ -59,14 +60,14 @@ RiuSummaryQwtPlot::RiuSummaryQwtPlot(RimSummaryPlot* plotDefinition, QWidget* pa
setDefaults(); setDefaults();
// LeftButton for the zooming // LeftButton for the zooming
m_zoomerLeft = new QwtPlotZoomer(canvas()); m_zoomerLeft = new RiuQwtPlotZoomer(canvas());
m_zoomerLeft->setRubberBandPen(QColor(Qt::black)); m_zoomerLeft->setRubberBandPen(QColor(Qt::black));
m_zoomerLeft->setTrackerMode(QwtPicker::AlwaysOff); m_zoomerLeft->setTrackerMode(QwtPicker::AlwaysOff);
m_zoomerLeft->setTrackerPen(QColor(Qt::black)); m_zoomerLeft->setTrackerPen(QColor(Qt::black));
m_zoomerLeft->initMousePattern(1); m_zoomerLeft->initMousePattern(1);
// Attach a zoomer for the right axis // Attach a zoomer for the right axis
m_zoomerRight = new QwtPlotZoomer(canvas()); m_zoomerRight = new RiuQwtPlotZoomer(canvas());
m_zoomerRight->setAxis(xTop, yRight); m_zoomerRight->setAxis(xTop, yRight);
m_zoomerRight->setTrackerMode(QwtPicker::AlwaysOff); m_zoomerRight->setTrackerMode(QwtPicker::AlwaysOff);
m_zoomerRight->initMousePattern(1); m_zoomerRight->initMousePattern(1);