From 32fa6d492091284f6482bf112f18df9ad7541333 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Fri, 22 Sep 2017 08:23:50 +0200 Subject: [PATCH] #1918 Observed Data : Removed RigCase RigSummaryCaseData from RimSummaryCase --- .../FlowCommands/RicPlotProductionRateFeature.cpp | 2 +- .../SummaryPlotCommands/RicSummaryCurveCreator.cpp | 8 ++++---- .../ProjectDataModel/Summary/RimSummaryCase.cpp | 9 +++++++-- .../ProjectDataModel/Summary/RimSummaryCase.h | 3 ++- .../ProjectDataModel/Summary/RimSummaryCurve.cpp | 4 +--- .../Summary/RimSummaryCurveFilter.cpp | 14 +++++++------- 6 files changed, 22 insertions(+), 18 deletions(-) diff --git a/ApplicationCode/Commands/FlowCommands/RicPlotProductionRateFeature.cpp b/ApplicationCode/Commands/FlowCommands/RicPlotProductionRateFeature.cpp index 90c574e18a..53c7b59f9e 100644 --- a/ApplicationCode/Commands/FlowCommands/RicPlotProductionRateFeature.cpp +++ b/ApplicationCode/Commands/FlowCommands/RicPlotProductionRateFeature.cpp @@ -289,7 +289,7 @@ RimSummaryCurve* RicPlotProductionRateFeature::addSummaryCurve( RimSummaryPlot* -1, -1); - if (!gridSummaryCase->caseData()->summaryReader()->hasAddress(addr)) + if (!gridSummaryCase->summaryReader()->hasAddress(addr)) { return nullptr; } diff --git a/ApplicationCode/Commands/SummaryPlotCommands/RicSummaryCurveCreator.cpp b/ApplicationCode/Commands/SummaryPlotCommands/RicSummaryCurveCreator.cpp index a228249ce2..fec8e709bb 100644 --- a/ApplicationCode/Commands/SummaryPlotCommands/RicSummaryCurveCreator.cpp +++ b/ApplicationCode/Commands/SummaryPlotCommands/RicSummaryCurveCreator.cpp @@ -668,7 +668,7 @@ std::set RicSummaryCurveCreator::findPossibleSummaryAd for (RimSummaryCase* currCase : selectedCases) { RifSummaryReaderInterface* reader = nullptr; - if (currCase && currCase->caseData()) reader = currCase->caseData()->summaryReader(); + if (currCase) reader = currCase->summaryReader(); if (reader) { const std::vector& allAddresses = reader->allResultAddresses(); @@ -852,7 +852,7 @@ void RicSummaryCurveCreator::syncPreviewCurvesFromUiSelection() for (RimSummaryCase* currCase : m_selectedCases) { RifSummaryReaderInterface* reader = nullptr; - if (currCase && currCase->caseData()) reader = currCase->caseData()->summaryReader(); + if (currCase) reader = currCase->summaryReader(); if (reader) { const std::vector& allAddresses = reader->allResultAddresses(); @@ -976,9 +976,9 @@ std::set RicSummaryCurveCreator::getAllSummaryWellNames() for (RimSummaryCase* rimCase : cases) { RifSummaryReaderInterface* reader = nullptr; - if (rimCase && rimCase->caseData()) + if (rimCase) { - reader = rimCase->caseData()->summaryReader(); + reader = rimCase->summaryReader(); } if (reader) diff --git a/ApplicationCode/ProjectDataModel/Summary/RimSummaryCase.cpp b/ApplicationCode/ProjectDataModel/Summary/RimSummaryCase.cpp index ac487f95d3..11b9caa176 100644 --- a/ApplicationCode/ProjectDataModel/Summary/RimSummaryCase.cpp +++ b/ApplicationCode/ProjectDataModel/Summary/RimSummaryCase.cpp @@ -77,9 +77,14 @@ void RimSummaryCase::reloadCase() //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RigSummaryCaseData* RimSummaryCase::caseData() +RifSummaryReaderInterface* RimSummaryCase::summaryReader() { - return m_summaryCaseData.p(); + if (m_summaryCaseData.notNull()) + { + return m_summaryCaseData->summaryReader(); + } + + return nullptr; } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/ProjectDataModel/Summary/RimSummaryCase.h b/ApplicationCode/ProjectDataModel/Summary/RimSummaryCase.h index 6fd90177f7..c9feebc303 100644 --- a/ApplicationCode/ProjectDataModel/Summary/RimSummaryCase.h +++ b/ApplicationCode/ProjectDataModel/Summary/RimSummaryCase.h @@ -24,6 +24,7 @@ #include "cafPdmPtrField.h" class RigSummaryCaseData; +class RifSummaryReaderInterface; //================================================================================================== // @@ -47,7 +48,7 @@ public: void loadCase(); void reloadCase(); - RigSummaryCaseData* caseData(); + RifSummaryReaderInterface* summaryReader(); virtual void updateFilePathsFromProjectPath(const QString& newProjectPath, const QString& oldProjectPath) = 0; diff --git a/ApplicationCode/ProjectDataModel/Summary/RimSummaryCurve.cpp b/ApplicationCode/ProjectDataModel/Summary/RimSummaryCurve.cpp index f3df2568b4..d404cb16ec 100644 --- a/ApplicationCode/ProjectDataModel/Summary/RimSummaryCurve.cpp +++ b/ApplicationCode/ProjectDataModel/Summary/RimSummaryCurve.cpp @@ -549,9 +549,7 @@ RifSummaryReaderInterface* RimSummaryCurve::summaryReader() const { if (!m_summaryCase()) return nullptr; - if (!m_summaryCase->caseData()) return nullptr; - - return m_summaryCase()->caseData()->summaryReader(); + return m_summaryCase()->summaryReader(); } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/ProjectDataModel/Summary/RimSummaryCurveFilter.cpp b/ApplicationCode/ProjectDataModel/Summary/RimSummaryCurveFilter.cpp index 7775da18c6..3c07da0623 100644 --- a/ApplicationCode/ProjectDataModel/Summary/RimSummaryCurveFilter.cpp +++ b/ApplicationCode/ProjectDataModel/Summary/RimSummaryCurveFilter.cpp @@ -361,9 +361,9 @@ void RimSummaryCurveFilter::syncCurvesFromUiSelection() for (RimSummaryCase* currentCase: m_selectedSummaryCases) { - if (!currentCase || !currentCase->caseData() || !currentCase->caseData()->summaryReader()) continue; + if (!currentCase || !currentCase->summaryReader()) continue; - RifSummaryReaderInterface* reader = currentCase->caseData()->summaryReader(); + RifSummaryReaderInterface* reader = currentCase->summaryReader(); for(const RifEclipseSummaryAddress& addr: m_uiFilterResultMultiSelection.v()) { @@ -524,9 +524,9 @@ void RimSummaryCurveFilter::createSetOfCasesAndResultAdresses( { for (RimSummaryCase* currentCase : cases) { - if (!currentCase || !currentCase->caseData() || !currentCase->caseData()->summaryReader()) continue; + if (!currentCase || !currentCase->summaryReader()) continue; - RifSummaryReaderInterface* reader = currentCase->caseData()->summaryReader(); + RifSummaryReaderInterface* reader = currentCase->summaryReader(); const std::vector allAddresses = reader->allResultAddresses(); int addressCount = static_cast(allAddresses.size()); @@ -683,7 +683,7 @@ std::set RimSummaryCurveFilter::findPossibleSummaryAdd for(RimSummaryCase* currCase: m_selectedSummaryCases) { RifSummaryReaderInterface* reader = nullptr; - if(currCase && currCase->caseData()) reader = currCase->caseData()->summaryReader(); + if(currCase) reader = currCase->summaryReader(); if(reader) { @@ -734,9 +734,9 @@ std::set RimSummaryCurveFilter::getAllSummaryWellNames() for (RimSummaryCase* rimCase : cases) { RifSummaryReaderInterface* reader = nullptr; - if (rimCase && rimCase->caseData()) + if (rimCase) { - reader = rimCase->caseData()->summaryReader(); + reader = rimCase->summaryReader(); } if (reader)