///////////////////////////////////////////////////////////////////////////////// // // 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 // for more details. // ///////////////////////////////////////////////////////////////////////////////// #pragma once #include "RiuInterfaceToViewWindow.h" #include "cafPdmPointer.h" #include "qwt_plot.h" #include #include class RimFlowCharacteristicsPlot; class RiuNightchartsWidget; class RiuResultQwtPlot; class RiuQwtPlotCurve; class QLabel; namespace cvf { class Color3f; } //================================================================================================== // // // //================================================================================================== class RiuFlowCharacteristicsPlot : public QFrame, public RiuInterfaceToViewWindow { Q_OBJECT; public: RiuFlowCharacteristicsPlot(RimFlowCharacteristicsPlot* plotDefinition, QWidget* parent = nullptr); ~RiuFlowCharacteristicsPlot() override; void setLorenzCurve(const QStringList& dateTimeStrings, const std::vector& dateTimes, const std::vector& timeHistoryValues); void addFlowCapStorageCapCurve(const QDateTime& dateTime, const std::vector& xVals, const std::vector& yVals); void addSweepEfficiencyCurve(const QDateTime& dateTime, const std::vector& xVals, const std::vector& yVals); void removeAllCurves(); void zoomAll(); void showLegend(bool show); RimFlowCharacteristicsPlot* ownerPlotDefinition(); RimViewWindow* ownerViewWindow() const override; static void addWindowZoom(QwtPlot* plot); static RiuQwtPlotCurve* createEmptyCurve(QwtPlot* plot, const QString& curveName, const QColor& curveColor); protected: QSize sizeHint() const override; QSize minimumSizeHint() const override; private: void setDefaults(); void initializeColors(const std::vector& dateTimes); static void addCurveWithLargeSymbol(QwtPlot* plot, const QString& curveName, const QColor& color, const QDateTime& dateTime, double timeHistoryValue); private: caf::PdmPointer m_plotDefinition; QPointer m_lorenzPlot; QPointer m_flowCapVsStorageCapPlot; QPointer m_sweepEffPlot; std::map m_dateToColorMap; };