///////////////////////////////////////////////////////////////////////////////// // // Copyright (C) 2021 Equinor 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 "RimMultiPlot.h" #include "RimSummaryDataSourceStepping.h" #include "cafPdmChildField.h" #include "cafPdmObject.h" #include "cafPdmPtrArrayField.h" #include class RimSummaryPlot; class RimSummaryPlotSourceStepping; class RimSummaryPlotNameHelper; class RimSummaryNameHelper; //================================================================================================== /// /// //================================================================================================== class RimSummaryMultiPlot : public RimMultiPlot, public RimSummaryDataSourceStepping { CAF_PDM_HEADER_INIT; public: RimSummaryMultiPlot(); ~RimSummaryMultiPlot() override; const RimSummaryNameHelper* nameHelper() const; void setAutoTitlePlot( bool enable ); void setAutoTitleGraphs( bool enable ); std::vector availableAxes() const override; std::vector curvesForStepping( RimSummaryDataSourceStepping::Axis axis ) const override; std::vector curveSets() const override; std::vector allCurves( RimSummaryDataSourceStepping::Axis axis ) const override; void addPlot( RimPlot* plot ) override; void insertPlot( RimPlot* plot, size_t index ) override; std::vector fieldsToShowInToolbar(); void syncAxisRanges(); protected: bool handleGlobalKeyEvent( QKeyEvent* keyEvent ) override; bool handleGlobalWheelEvent( QWheelEvent* wheelEvent ) override; private: void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override; void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override; void populateNameHelper( RimSummaryPlotNameHelper* nameHelper ); void defineEditorAttribute( const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute ) override; std::vector summaryPlots() const; static void insertGraphsIntoPlot( RimSummaryMultiPlot* plot, const std::vector& graphs ); void updatePlotWindowTitle() override; private: caf::PdmField m_autoPlotTitles; caf::PdmField m_autoPlotTitlesOnSubPlots; caf::PdmField m_syncAxisRanges; caf::PdmField m_disableWheelZoom; caf::PdmChildField m_sourceStepping; std::unique_ptr m_nameHelper; };