Files
ResInsight/ApplicationLibCode/UserInterface/RiuQwtPlotWheelZoomer.h
T

50 lines
1.4 KiB
C++
Raw Normal View History

2017-03-27 16:45:00 +02:00
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2017- Statoil ASA
//
2017-03-27 16:45:00 +02:00
// 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.
//
2017-03-27 16:45:00 +02:00
// 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>
2017-03-27 16:45:00 +02:00
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "qwt_plot.h"
2017-03-27 16:45:00 +02:00
#include <QObject>
#include <map>
2017-03-27 16:45:00 +02:00
class QEvent;
class RiuQwtPlotWheelZoomer : public QObject
{
Q_OBJECT
2017-03-27 16:45:00 +02:00
public:
RiuQwtPlotWheelZoomer( QwtPlot* plot );
2017-03-27 16:45:00 +02:00
bool eventFilter( QObject* watched, QEvent* event ) override;
2017-03-27 16:45:00 +02:00
void setAxisIsLogarithmic( QwtAxis::Position axis, bool logarithmic );
signals:
2017-03-27 16:45:00 +02:00
void zoomUpdated();
private:
void zoomOnAxis( QwtPlot* plot, QwtAxis::Position axis, double zoomFactor, int eventPos );
bool axisIsLogarithmic( QwtAxis::Position axis ) const;
2017-03-27 16:45:00 +02:00
private:
QwtPlot* m_plot;
std::map<QwtAxis::Position, bool> m_axesAreLogarithmic;
2017-03-27 16:45:00 +02:00
};