///////////////////////////////////////////////////////////////////////////////// // // 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 "RimPlotCurve.h" #include "RiaDefines.h" #include "cafPdmChildField.h" #include "cafPdmProxyValueField.h" #include "cafPdmPtrField.h" #include "SummaryPlotCommands/RicSummaryPlotFeatureImpl.h" #include class RigMainGrid; class RimEclipseCase; class RimEclipseResultDefinition; class RimEclipseGeometrySelectionItem; class RimGeoMechResultDefinition; class RimGeoMechGeometrySelectionItem; class RimGeometrySelectionItem; class RiuFemTimeHistoryResultAccessor; class RiuSelectionItem; class RigEclipseResultAddress; class RimCase; //================================================================================================== /// /// //================================================================================================== class RimGridTimeHistoryCurve : public RimPlotCurve { CAF_PDM_HEADER_INIT; public: public: RimGridTimeHistoryCurve(); ~RimGridTimeHistoryCurve() override; void setFromSelectionItem( const RiuSelectionItem* selectionItem ); void setFromEclipseCellAndResult( RimEclipseCase* eclCase, size_t gridIdx, size_t i, size_t j, size_t k, const RigEclipseResultAddress& resAddr ); RiaDefines::PlotAxis yAxis() const; void setYAxis( RiaDefines::PlotAxis plotAxis ); std::vector yValues() const; std::vector timeStepValues() const; std::vector daysSinceSimulationStart() const; RigGridCellResultAddress resultAddress(); QString quantityName() const; QString caseName() const; RimCase* gridCase() const; protected: QString createCurveAutoName() override; void updateZoomInParentPlot() override; void onLoadDataAndUpdate( bool updateParentPlot ) override; void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override; void initAfterRead() override; void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override; private: RigMainGrid* mainGrid(); RimEclipseGeometrySelectionItem* eclipseGeomSelectionItem() const; RimGeoMechGeometrySelectionItem* geoMechGeomSelectionItem() const; void updateResultDefinitionFromCase(); QString geometrySelectionText() const; void updateQwtPlotAxis(); std::unique_ptr femTimeHistoryResultAccessor() const; private: caf::PdmProxyValueField m_geometrySelectionText; caf::PdmChildField m_eclipseResultDefinition; caf::PdmChildField m_geoMechResultDefinition; caf::PdmChildField m_geometrySelectionItem; caf::PdmField> m_plotAxis; };