Refactor: Use PlotCollection interface more places.

This commit is contained in:
Kristian Bendiksen 2021-05-05 09:43:49 +02:00
parent 0fb69f7524
commit 8b2173f951
20 changed files with 271 additions and 311 deletions

View File

@ -126,7 +126,7 @@ void RicCreateTemporaryLgrFeature::updateViews( RimEclipseCase* eclipseCase )
RimProject::current()->mainPlotCollection()->deleteAllCachedData();
computeCachedData( eclipseCase );
RimProject::current()->mainPlotCollection()->wellLogPlotCollection()->reloadAllPlots();
RimProject::current()->mainPlotCollection()->wellLogPlotCollection()->loadDataAndUpdateAllPlots();
if ( guiApp ) eclipseCase->createDisplayModelAndUpdateAllViews();
}

View File

@ -387,3 +387,15 @@ void RimCorrelationPlotCollection::applyEnsembleFieldAndTimeStepToReport( RimCor
plot->crossPlot()->setEnsembleParameter( crossPlotEnsembleParameterName );
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimCorrelationPlotCollection::loadDataAndUpdateAllPlots()
{
for ( const auto& corrPlot : m_correlationPlots )
corrPlot->loadDataAndUpdate();
for ( const auto& reports : m_correlationReports )
reports->loadDataAndUpdate();
}

View File

@ -73,6 +73,7 @@ public:
void insertPlot( RimAbstractCorrelationPlot* plot, size_t index ) final;
void removePlot( RimAbstractCorrelationPlot* correlationPlot ) final;
void deleteAllPlots() final;
void loadDataAndUpdateAllPlots() override;
std::vector<RimCorrelationReportPlot*> reports() const;

View File

@ -69,7 +69,7 @@ RimFlowPlotCollection::~RimFlowPlotCollection()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimFlowPlotCollection::closeDefaultPlotWindowAndDeletePlots()
void RimFlowPlotCollection::deleteAllPlots()
{
if ( m_defaultWellAllocPlot )
{
@ -88,7 +88,7 @@ void RimFlowPlotCollection::closeDefaultPlotWindowAndDeletePlots()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimFlowPlotCollection::loadDataAndUpdate()
void RimFlowPlotCollection::loadDataAndUpdateAllPlots()
{
caf::ProgressInfo plotProgress( m_storedWellAllocPlots.size() + m_storedFlowCharacteristicsPlots.size() + 3, "" );

View File

@ -18,6 +18,8 @@
#pragma once
#include "RimAbstractPlotCollection.h"
#include "cafPdmChildArrayField.h"
#include "cafPdmChildField.h"
#include "cafPdmObject.h"
@ -31,7 +33,7 @@ class RimWellDistributionPlotCollection;
///
///
//==================================================================================================
class RimFlowPlotCollection : public caf::PdmObject
class RimFlowPlotCollection : public caf::PdmObject, public RimPlotCollection
{
CAF_PDM_HEADER_INIT;
@ -39,9 +41,9 @@ public:
RimFlowPlotCollection();
~RimFlowPlotCollection() override;
void closeDefaultPlotWindowAndDeletePlots();
void loadDataAndUpdate();
size_t plotCount() const;
void deleteAllPlots() override;
void loadDataAndUpdateAllPlots() override;
size_t plotCount() const override;
void addWellAllocPlotToStoredPlots( RimWellAllocationPlot* plot );
void addFlowCharacteristicsPlotToStoredPlots( RimFlowCharacteristicsPlot* plot );

View File

@ -124,7 +124,16 @@ size_t RimSaturationPressurePlotCollection::plotCount() const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimSaturationPressurePlotCollection::deleteAllChildObjects()
void RimSaturationPressurePlotCollection::deleteAllPlots()
{
m_saturationPressurePlots.deleteAllChildObjects();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimSaturationPressurePlotCollection::loadDataAndUpdateAllPlots()
{
for ( const auto& p : m_saturationPressurePlots )
p->loadDataAndUpdate();
}

View File

@ -17,17 +17,19 @@
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "RimAbstractPlotCollection.h"
#include "cafPdmChildArrayField.h"
#include "cafPdmObject.h"
class RimSaturationPressurePlot;
class RimEclipseResultCase;
class RimSaturationPressurePlot;
//==================================================================================================
///
///
//==================================================================================================
class RimSaturationPressurePlotCollection : public caf::PdmObject
class RimSaturationPressurePlotCollection : public caf::PdmObject, public RimPlotCollection
{
CAF_PDM_HEADER_INIT;
@ -39,8 +41,9 @@ public:
int timeStep );
std::vector<RimSaturationPressurePlot*> plots() const;
size_t plotCount() const;
void deleteAllChildObjects();
size_t plotCount() const override;
void deleteAllPlots() override;
void loadDataAndUpdateAllPlots() override;
private:
caf::PdmChildArrayField<RimSaturationPressurePlot*> m_saturationPressurePlots;

View File

@ -172,7 +172,7 @@ caf::PdmFieldHandle* RimMainPlotCollection::objectToggleField()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimWellLogPlotCollection* RimMainPlotCollection::wellLogPlotCollection()
RimWellLogPlotCollection* RimMainPlotCollection::wellLogPlotCollection() const
{
return m_wellLogPlotCollection();
}
@ -180,7 +180,7 @@ RimWellLogPlotCollection* RimMainPlotCollection::wellLogPlotCollection()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimRftPlotCollection* RimMainPlotCollection::rftPlotCollection()
RimRftPlotCollection* RimMainPlotCollection::rftPlotCollection() const
{
return m_rftPlotCollection();
}
@ -188,7 +188,7 @@ RimRftPlotCollection* RimMainPlotCollection::rftPlotCollection()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimPltPlotCollection* RimMainPlotCollection::pltPlotCollection()
RimPltPlotCollection* RimMainPlotCollection::pltPlotCollection() const
{
return m_pltPlotCollection();
}
@ -196,7 +196,7 @@ RimPltPlotCollection* RimMainPlotCollection::pltPlotCollection()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimSummaryPlotCollection* RimMainPlotCollection::summaryPlotCollection()
RimSummaryPlotCollection* RimMainPlotCollection::summaryPlotCollection() const
{
return m_summaryPlotCollection();
}
@ -204,7 +204,7 @@ RimSummaryPlotCollection* RimMainPlotCollection::summaryPlotCollection()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimSummaryCrossPlotCollection* RimMainPlotCollection::summaryCrossPlotCollection()
RimSummaryCrossPlotCollection* RimMainPlotCollection::summaryCrossPlotCollection() const
{
return m_summaryCrossPlotCollection();
}
@ -212,7 +212,7 @@ RimSummaryCrossPlotCollection* RimMainPlotCollection::summaryCrossPlotCollection
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimFlowPlotCollection* RimMainPlotCollection::flowPlotCollection()
RimFlowPlotCollection* RimMainPlotCollection::flowPlotCollection() const
{
return m_flowPlotCollection();
}
@ -220,7 +220,7 @@ RimFlowPlotCollection* RimMainPlotCollection::flowPlotCollection()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimGridCrossPlotCollection* RimMainPlotCollection::gridCrossPlotCollection()
RimGridCrossPlotCollection* RimMainPlotCollection::gridCrossPlotCollection() const
{
return m_gridCrossPlotCollection();
}
@ -228,7 +228,7 @@ RimGridCrossPlotCollection* RimMainPlotCollection::gridCrossPlotCollection()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimSaturationPressurePlotCollection* RimMainPlotCollection::saturationPressurePlotCollection()
RimSaturationPressurePlotCollection* RimMainPlotCollection::saturationPressurePlotCollection() const
{
return m_saturationPressurePlotCollection();
}
@ -236,7 +236,7 @@ RimSaturationPressurePlotCollection* RimMainPlotCollection::saturationPressurePl
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimMultiPlotCollection* RimMainPlotCollection::multiPlotCollection()
RimMultiPlotCollection* RimMainPlotCollection::multiPlotCollection() const
{
return m_multiPlotCollection();
}
@ -244,7 +244,7 @@ RimMultiPlotCollection* RimMainPlotCollection::multiPlotCollection()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimVfpPlotCollection* RimMainPlotCollection::vfpPlotCollection()
RimVfpPlotCollection* RimMainPlotCollection::vfpPlotCollection() const
{
return m_vfpPlotCollection();
}
@ -252,7 +252,7 @@ RimVfpPlotCollection* RimMainPlotCollection::vfpPlotCollection()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimAnalysisPlotCollection* RimMainPlotCollection::analysisPlotCollection()
RimAnalysisPlotCollection* RimMainPlotCollection::analysisPlotCollection() const
{
return m_analysisPlotCollection();
}
@ -260,7 +260,7 @@ RimAnalysisPlotCollection* RimMainPlotCollection::analysisPlotCollection()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimCorrelationPlotCollection* RimMainPlotCollection::correlationPlotCollection()
RimCorrelationPlotCollection* RimMainPlotCollection::correlationPlotCollection() const
{
return m_correlationPlotCollection();
}
@ -268,7 +268,7 @@ RimCorrelationPlotCollection* RimMainPlotCollection::correlationPlotCollection()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimStimPlanModelPlotCollection* RimMainPlotCollection::stimPlanModelPlotCollection()
RimStimPlanModelPlotCollection* RimMainPlotCollection::stimPlanModelPlotCollection() const
{
return m_stimPlanModelPlotCollection();
}
@ -277,7 +277,7 @@ RimStimPlanModelPlotCollection* RimMainPlotCollection::stimPlanModelPlotCollecti
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimGridStatisticsPlotCollection* RimMainPlotCollection::gridStatisticsPlotCollection()
RimGridStatisticsPlotCollection* RimMainPlotCollection::gridStatisticsPlotCollection() const
{
return m_gridStatisticsPlotCollection();
}
@ -285,7 +285,7 @@ RimGridStatisticsPlotCollection* RimMainPlotCollection::gridStatisticsPlotCollec
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimEnsembleFractureStatisticsPlotCollection* RimMainPlotCollection::ensembleFractureStatisticsPlotCollection()
RimEnsembleFractureStatisticsPlotCollection* RimMainPlotCollection::ensembleFractureStatisticsPlotCollection() const
{
return m_ensembleFractureStatisticsPlotCollection();
}
@ -296,23 +296,9 @@ RimEnsembleFractureStatisticsPlotCollection* RimMainPlotCollection::ensembleFrac
//--------------------------------------------------------------------------------------------------
void RimMainPlotCollection::deleteAllContainedObjects()
{
m_wellLogPlotCollection()->deleteAllPlots();
m_rftPlotCollection()->deleteAllPlots();
m_pltPlotCollection()->deleteAllPlots();
m_summaryPlotCollection()->deleteAllPlots();
m_summaryCrossPlotCollection()->deleteAllPlots();
m_gridCrossPlotCollection->deleteAllPlots();
m_flowPlotCollection()->closeDefaultPlotWindowAndDeletePlots();
m_saturationPressurePlotCollection()->deleteAllChildObjects();
m_multiPlotCollection()->deleteAllChildObjects();
m_vfpPlotCollection()->deleteAllChildObjects();
m_analysisPlotCollection()->deleteAllPlots();
m_correlationPlotCollection()->deleteAllPlots();
m_stimPlanModelPlotCollection()->deleteAllPlots();
#ifdef USE_QTCHARTS
m_gridStatisticsPlotCollection()->deleteAllPlots();
m_ensembleFractureStatisticsPlotCollection()->deleteAllPlots();
#endif
std::vector<RimPlotCollection*> plotCollections = allPlotCollections();
for ( auto p : plotCollections )
p->deleteAllPlots();
}
//--------------------------------------------------------------------------------------------------
@ -328,77 +314,8 @@ void RimMainPlotCollection::updateCurrentTimeStepInPlots()
//--------------------------------------------------------------------------------------------------
void RimMainPlotCollection::updatePlotsWithFormations()
{
if ( m_wellLogPlotCollection )
{
for ( RimWellLogPlot* wellLogPlot : m_wellLogPlotCollection->wellLogPlots() )
{
wellLogPlot->loadDataAndUpdate();
}
}
if ( m_pltPlotCollection )
{
for ( RimWellPltPlot* pltPlot : m_pltPlotCollection->pltPlots() )
{
pltPlot->loadDataAndUpdate();
}
}
if ( m_rftPlotCollection )
{
for ( RimWellRftPlot* rftPlot : m_rftPlotCollection->rftPlots() )
{
rftPlot->loadDataAndUpdate();
}
}
if ( m_flowPlotCollection )
{
m_flowPlotCollection->loadDataAndUpdate();
}
if ( m_gridCrossPlotCollection )
{
for ( RimGridCrossPlot* crossPlot : m_gridCrossPlotCollection->plots() )
{
crossPlot->loadDataAndUpdate();
}
}
if ( m_multiPlotCollection )
{
for ( RimMultiPlot* plotWindow : m_multiPlotCollection->multiPlots() )
{
plotWindow->loadDataAndUpdate();
}
}
if ( m_stimPlanModelPlotCollection )
{
for ( RimStimPlanModelPlot* stimPlanModelPlot : m_stimPlanModelPlotCollection->stimPlanModelPlots() )
{
stimPlanModelPlot->loadDataAndUpdate();
}
}
#ifdef USE_QTCHARTS
if ( m_gridStatisticsPlotCollection )
{
for ( RimGridStatisticsPlot* gridStatisticsPlot : m_gridStatisticsPlotCollection->gridStatisticsPlots() )
{
gridStatisticsPlot->loadDataAndUpdate();
}
}
if ( m_ensembleFractureStatisticsPlotCollection )
{
for ( RimEnsembleFractureStatisticsPlot* ensembleFractureStatisticsPlot :
m_ensembleFractureStatisticsPlotCollection->ensembleFractureStatisticsPlots() )
{
ensembleFractureStatisticsPlot->loadDataAndUpdate();
}
}
#endif
std::vector<RimPlotCollection*> plotCollections = plotCollectionsWithFormations();
loadDataAndUpdatePlotCollections( plotCollections );
}
//--------------------------------------------------------------------------------------------------
@ -406,21 +323,8 @@ void RimMainPlotCollection::updatePlotsWithFormations()
//--------------------------------------------------------------------------------------------------
void RimMainPlotCollection::updatePlotsWithCompletions()
{
if ( m_wellLogPlotCollection )
{
for ( RimWellLogPlot* wellLogPlot : m_wellLogPlotCollection->wellLogPlots() )
{
wellLogPlot->loadDataAndUpdate();
}
}
if ( m_multiPlotCollection )
{
for ( RimMultiPlot* plotWindow : m_multiPlotCollection->multiPlots() )
{
plotWindow->loadDataAndUpdate();
}
}
std::vector<RimPlotCollection*> plotCollections = plotCollectionsWithCompletions();
loadDataAndUpdatePlotCollections( plotCollections );
}
//--------------------------------------------------------------------------------------------------
@ -460,74 +364,16 @@ void RimMainPlotCollection::ensureCalculationIdsAreAssigned()
//--------------------------------------------------------------------------------------------------
void RimMainPlotCollection::loadDataAndUpdateAllPlots()
{
RimWellLogPlotCollection* wlpColl = nullptr;
RimSummaryPlotCollection* spColl = nullptr;
RimFlowPlotCollection* flowColl = nullptr;
RimRftPlotCollection* rftColl = nullptr;
RimPltPlotCollection* pltColl = nullptr;
RimSaturationPressurePlotCollection* sppColl = nullptr;
RimCorrelationPlotCollection* corrColl = nullptr;
RimMultiPlotCollection* gpwColl = nullptr;
RimStimPlanModelPlotCollection* frmColl = nullptr;
std::vector<RimPlotCollection*> plotCollections;
plotCollections.push_back( summaryCrossPlotCollection() );
plotCollections.push_back( gridCrossPlotCollection() );
plotCollections.push_back( analysisPlotCollection() );
plotCollections.push_back( vfpPlotCollection() );
#ifdef USE_QTCHARTS
plotCollections.push_back( gridStatisticsPlotCollection() );
plotCollections.push_back( ensembleFractureStatisticsPlotCollection() );
#endif
if ( wellLogPlotCollection() )
{
wlpColl = wellLogPlotCollection();
}
if ( summaryPlotCollection() )
{
spColl = summaryPlotCollection();
}
if ( flowPlotCollection() )
{
flowColl = flowPlotCollection();
}
if ( rftPlotCollection() )
{
rftColl = rftPlotCollection();
}
if ( pltPlotCollection() )
{
pltColl = pltPlotCollection();
}
if ( saturationPressurePlotCollection() )
{
sppColl = saturationPressurePlotCollection();
}
if ( correlationPlotCollection() )
{
corrColl = correlationPlotCollection();
}
if ( multiPlotCollection() )
{
gpwColl = multiPlotCollection();
}
if ( stimPlanModelPlotCollection() )
{
frmColl = stimPlanModelPlotCollection();
}
std::vector<RimPlotCollection*> plotCollections = allPlotCollections();
loadDataAndUpdatePlotCollectionsWithProgressInfo( plotCollections );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimMainPlotCollection::loadDataAndUpdatePlotCollectionsWithProgressInfo( const std::vector<RimPlotCollection*>& plotCollections )
{
size_t plotCount = 0;
plotCount += wlpColl ? wlpColl->wellLogPlots().size() : 0;
plotCount += spColl ? spColl->plots().size() : 0;
plotCount += flowColl ? flowColl->plotCount() : 0;
plotCount += rftColl ? rftColl->rftPlots().size() : 0;
plotCount += pltColl ? pltColl->pltPlots().size() : 0;
plotCount += sppColl ? sppColl->plotCount() : 0;
plotCount += corrColl ? corrColl->plotCount() + corrColl->reports().size() : 0;
plotCount += gpwColl ? gpwColl->multiPlots().size() : 0;
plotCount += frmColl ? frmColl->stimPlanModelPlots().size() : 0;
for ( auto coll : plotCollections )
if ( coll ) plotCount += coll->plotCount();
@ -543,89 +389,77 @@ void RimMainPlotCollection::loadDataAndUpdateAllPlots()
plotProgress.incrementProgress();
}
}
if ( wlpColl )
{
for ( auto wellLogPlot : wlpColl->wellLogPlots() )
{
wellLogPlot->loadDataAndUpdate();
plotProgress.incrementProgress();
}
}
if ( spColl )
{
for ( auto plot : spColl->plots() )
{
plot->loadDataAndUpdate();
plotProgress.incrementProgress();
}
}
if ( flowColl )
{
plotProgress.setNextProgressIncrement( flowColl->plotCount() );
flowColl->loadDataAndUpdate();
plotProgress.incrementProgress();
}
if ( rftColl )
{
for ( const auto& rftPlot : rftColl->rftPlots() )
{
rftPlot->loadDataAndUpdate();
plotProgress.incrementProgress();
}
}
if ( pltColl )
{
for ( const auto& pltPlot : pltColl->pltPlots() )
{
pltPlot->loadDataAndUpdate();
plotProgress.incrementProgress();
}
}
if ( sppColl )
{
for ( const auto& sppPlot : sppColl->plots() )
{
sppPlot->loadDataAndUpdate();
plotProgress.incrementProgress();
}
}
if ( corrColl )
{
for ( const auto& corrPlot : corrColl->plots() )
{
corrPlot->loadDataAndUpdate();
plotProgress.incrementProgress();
}
for ( const auto& reports : corrColl->reports() )
{
reports->loadDataAndUpdate();
plotProgress.incrementProgress();
}
}
if ( gpwColl )
{
for ( const auto& multiPlot : gpwColl->multiPlots() )
{
multiPlot->loadDataAndUpdate();
plotProgress.incrementProgress();
}
}
if ( frmColl )
{
for ( const auto& stimPlanModelPlot : frmColl->stimPlanModelPlots() )
{
stimPlanModelPlot->loadDataAndUpdate();
plotProgress.incrementProgress();
}
}
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimMainPlotCollection::loadDataAndUpdatePlotCollections( const std::vector<RimPlotCollection*>& plotCollections )
{
for ( auto coll : plotCollections )
{
if ( coll ) coll->loadDataAndUpdateAllPlots();
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<RimPlotCollection*> RimMainPlotCollection::allPlotCollections() const
{
std::vector<RimPlotCollection*> plotCollections;
plotCollections.push_back( wellLogPlotCollection() );
plotCollections.push_back( summaryPlotCollection() );
plotCollections.push_back( summaryCrossPlotCollection() );
plotCollections.push_back( gridCrossPlotCollection() );
plotCollections.push_back( analysisPlotCollection() );
plotCollections.push_back( vfpPlotCollection() );
plotCollections.push_back( flowPlotCollection() );
plotCollections.push_back( pltPlotCollection() );
plotCollections.push_back( rftPlotCollection() );
plotCollections.push_back( stimPlanModelPlotCollection() );
plotCollections.push_back( correlationPlotCollection() );
plotCollections.push_back( saturationPressurePlotCollection() );
plotCollections.push_back( multiPlotCollection() );
#ifdef USE_QTCHARTS
plotCollections.push_back( gridStatisticsPlotCollection() );
plotCollections.push_back( ensembleFractureStatisticsPlotCollection() );
#endif
return plotCollections;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<RimPlotCollection*> RimMainPlotCollection::plotCollectionsWithFormations() const
{
std::vector<RimPlotCollection*> plotCollections;
plotCollections.push_back( wellLogPlotCollection() );
plotCollections.push_back( pltPlotCollection() );
plotCollections.push_back( rftPlotCollection() );
plotCollections.push_back( flowPlotCollection() );
plotCollections.push_back( gridCrossPlotCollection() );
plotCollections.push_back( multiPlotCollection() );
plotCollections.push_back( stimPlanModelPlotCollection() );
#ifdef USE_QTCHARTS
plotCollections.push_back( gridStatisticsPlotCollection() );
plotCollections.push_back( ensembleFractureStatisticsPlotCollection() );
#endif
return plotCollections;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<RimPlotCollection*> RimMainPlotCollection::plotCollectionsWithCompletions() const
{
std::vector<RimPlotCollection*> plotCollections;
plotCollections.push_back( wellLogPlotCollection() );
plotCollections.push_back( multiPlotCollection() );
return plotCollections;
}

View File

@ -42,6 +42,7 @@ class RimFlowPlotCollection;
class RimSaturationPressurePlotCollection;
class RimStimPlanModelPlotCollection;
class RimVfpPlotCollection;
class RimPlotCollection;
#ifdef USE_QTCHARTS
class RimGridStatisticsPlotCollection;
@ -60,23 +61,23 @@ public:
RimMainPlotCollection();
~RimMainPlotCollection() override;
RimWellLogPlotCollection* wellLogPlotCollection();
RimRftPlotCollection* rftPlotCollection();
RimPltPlotCollection* pltPlotCollection();
RimSummaryPlotCollection* summaryPlotCollection();
RimSummaryCrossPlotCollection* summaryCrossPlotCollection();
RimAnalysisPlotCollection* analysisPlotCollection();
RimCorrelationPlotCollection* correlationPlotCollection();
RimFlowPlotCollection* flowPlotCollection();
RimGridCrossPlotCollection* gridCrossPlotCollection();
RimSaturationPressurePlotCollection* saturationPressurePlotCollection();
RimMultiPlotCollection* multiPlotCollection();
RimStimPlanModelPlotCollection* stimPlanModelPlotCollection();
RimVfpPlotCollection* vfpPlotCollection();
RimWellLogPlotCollection* wellLogPlotCollection() const;
RimRftPlotCollection* rftPlotCollection() const;
RimPltPlotCollection* pltPlotCollection() const;
RimSummaryPlotCollection* summaryPlotCollection() const;
RimSummaryCrossPlotCollection* summaryCrossPlotCollection() const;
RimAnalysisPlotCollection* analysisPlotCollection() const;
RimCorrelationPlotCollection* correlationPlotCollection() const;
RimFlowPlotCollection* flowPlotCollection() const;
RimGridCrossPlotCollection* gridCrossPlotCollection() const;
RimSaturationPressurePlotCollection* saturationPressurePlotCollection() const;
RimMultiPlotCollection* multiPlotCollection() const;
RimStimPlanModelPlotCollection* stimPlanModelPlotCollection() const;
RimVfpPlotCollection* vfpPlotCollection() const;
#ifdef USE_QTCHARTS
RimGridStatisticsPlotCollection* gridStatisticsPlotCollection();
RimEnsembleFractureStatisticsPlotCollection* ensembleFractureStatisticsPlotCollection();
RimGridStatisticsPlotCollection* gridStatisticsPlotCollection() const;
RimEnsembleFractureStatisticsPlotCollection* ensembleFractureStatisticsPlotCollection() const;
#endif
void deleteAllContainedObjects();
@ -93,6 +94,12 @@ private:
caf::PdmFieldHandle* objectToggleField() override;
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
void loadDataAndUpdatePlotCollectionsWithProgressInfo( const std::vector<RimPlotCollection*>& );
void loadDataAndUpdatePlotCollections( const std::vector<RimPlotCollection*>& );
std::vector<RimPlotCollection*> plotCollectionsWithFormations() const;
std::vector<RimPlotCollection*> plotCollectionsWithCompletions() const;
std::vector<RimPlotCollection*> allPlotCollections() const;
private:
caf::PdmChildField<RimWellLogPlotCollection*> m_wellLogPlotCollection;
caf::PdmChildField<RimRftPlotCollection*> m_rftPlotCollection;

View File

@ -46,7 +46,7 @@ RimMultiPlotCollection::~RimMultiPlotCollection()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimMultiPlotCollection::deleteAllChildObjects()
void RimMultiPlotCollection::deleteAllPlots()
{
m_multiPlots.deleteAllChildObjects();
}
@ -78,3 +78,20 @@ void RimMultiPlotCollection::addMultiPlot( RimMultiPlot* plot )
{
m_multiPlots().push_back( plot );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimMultiPlotCollection::loadDataAndUpdateAllPlots()
{
for ( const auto& p : m_multiPlots.childObjects() )
p->loadDataAndUpdate();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
size_t RimMultiPlotCollection::plotCount() const
{
return m_multiPlots.size();
}

View File

@ -17,6 +17,8 @@
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "RimAbstractPlotCollection.h"
#include "cafPdmChildArrayField.h"
#include "cafPdmObject.h"
@ -26,7 +28,7 @@ class RimMultiPlot;
///
///
//==================================================================================================
class RimMultiPlotCollection : public caf::PdmObject
class RimMultiPlotCollection : public caf::PdmObject, public RimPlotCollection
{
CAF_PDM_HEADER_INIT;
@ -34,7 +36,9 @@ public:
RimMultiPlotCollection();
~RimMultiPlotCollection() override;
void deleteAllChildObjects();
void deleteAllPlots() override;
void loadDataAndUpdateAllPlots() override;
size_t plotCount() const override;
std::vector<RimMultiPlot*> multiPlots() const;
RimMultiPlot* createMultiPlot();

View File

@ -214,6 +214,25 @@ const std::vector<RimWellPltPlot*> RimPltPlotCollection::pltPlots() const
return plots;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimPltPlotCollection::loadDataAndUpdateAllPlots()
{
for ( auto& plot : m_pltPlots )
{
plot->loadDataAndUpdate();
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
size_t RimPltPlotCollection::plotCount() const
{
return m_pltPlots.size();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@ -19,6 +19,8 @@
#pragma once
#include "RimAbstractPlotCollection.h"
#include "cafPdmChildArrayField.h"
#include "cafPdmField.h"
#include "cafPdmObject.h"
@ -42,7 +44,7 @@ class RimWellPltPlot;
///
///
//==================================================================================================
class RimPltPlotCollection : public caf::PdmObject
class RimPltPlotCollection : public caf::PdmObject, public RimPlotCollection
{
CAF_PDM_HEADER_INIT;
@ -68,7 +70,9 @@ public:
const std::vector<RimWellPltPlot*> pltPlots() const;
void addPlot( gsl::not_null<RimWellPltPlot*> newPlot );
void removePlot( gsl::not_null<RimWellPltPlot*> plot );
void deleteAllPlots();
void deleteAllPlots() override;
void loadDataAndUpdateAllPlots() override;
size_t plotCount() const override;
private:
caf::PdmChildArrayField<RimWellPltPlot*> m_pltPlots;

View File

@ -177,7 +177,7 @@ void RimReloadCaseTools::updateAllPlots()
RimFlowPlotCollection* flowPlotCollection = project->mainPlotCollection()->flowPlotCollection();
if ( flowPlotCollection )
{
flowPlotCollection->loadDataAndUpdate();
flowPlotCollection->loadDataAndUpdateAllPlots();
}
RimMultiPlotCollection* multiPlotCollection = project->mainPlotCollection()->multiPlotCollection();

View File

@ -214,6 +214,25 @@ const std::vector<RimWellRftPlot*> RimRftPlotCollection::rftPlots() const
return plots;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimRftPlotCollection::loadDataAndUpdateAllPlots()
{
for ( auto& plot : m_rftPlots )
{
plot->loadDataAndUpdate();
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
size_t RimRftPlotCollection::plotCount() const
{
return m_rftPlots.size();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@ -19,6 +19,8 @@
#pragma once
#include "RimAbstractPlotCollection.h"
#include "cafPdmChildArrayField.h"
#include "cafPdmField.h"
#include "cafPdmObject.h"
@ -42,7 +44,7 @@ class RimWellRftPlot;
///
///
//==================================================================================================
class RimRftPlotCollection : public caf::PdmObject
class RimRftPlotCollection : public caf::PdmObject, public RimPlotCollection
{
CAF_PDM_HEADER_INIT;
@ -68,7 +70,9 @@ public:
const std::vector<RimWellRftPlot*> rftPlots() const;
void addPlot( gsl::not_null<RimWellRftPlot*> newPlot );
void removePlot( gsl::not_null<RimWellRftPlot*> plot );
void deleteAllPlots();
void deleteAllPlots() override;
void loadDataAndUpdateAllPlots() override;
size_t plotCount() const override;
private:
caf::PdmChildArrayField<RimWellRftPlot*> m_rftPlots;

View File

@ -166,7 +166,7 @@ void RimWellLogPlotCollection::deleteAllPlots()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogPlotCollection::reloadAllPlots()
void RimWellLogPlotCollection::loadDataAndUpdateAllPlots()
{
for ( const auto& w : m_wellLogPlots() )
{
@ -233,6 +233,9 @@ void RimWellLogPlotCollection::removeExtractors( const RigGeoMechCaseData* caseD
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogPlotCollection::onChildDeleted( caf::PdmChildArrayFieldHandle* childArray,
std::vector<caf::PdmObjectHandle*>& referringObjects )
{
@ -249,3 +252,11 @@ void RimWellLogPlotCollection::onChildDeleted( caf::PdmChildArrayFieldHandle*
RiuPlotMainWindow* mainPlotWindow = RiaGuiApplication::instance()->mainPlotWindow();
mainPlotWindow->updateWellLogPlotToolBar();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
size_t RimWellLogPlotCollection::plotCount() const
{
return m_wellLogPlots.size();
}

View File

@ -19,6 +19,8 @@
#pragma once
#include "RimAbstractPlotCollection.h"
#include "cafPdmChildArrayField.h"
#include "cafPdmField.h"
#include "cafPdmObject.h"
@ -40,7 +42,7 @@ class RimEclipseCase;
///
///
//==================================================================================================
class RimWellLogPlotCollection : public caf::PdmObject
class RimWellLogPlotCollection : public caf::PdmObject, public RimPlotCollection
{
CAF_PDM_HEADER_INIT;
@ -58,9 +60,9 @@ public:
std::vector<RimWellLogPlot*> wellLogPlots() const;
void addWellLogPlot( gsl::not_null<RimWellLogPlot*> wellLogPlot );
void deleteAllPlots();
void reloadAllPlots();
void deleteAllPlots() override;
void loadDataAndUpdateAllPlots() override;
size_t plotCount() const override;
void deleteAllExtractors();
void removeExtractors( const RigWellPath* wellPathGeometry );

View File

@ -47,7 +47,7 @@ RimStimPlanModelPlotCollection::~RimStimPlanModelPlotCollection()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimStimPlanModelPlotCollection::reloadAllPlots()
void RimStimPlanModelPlotCollection::loadDataAndUpdateAllPlots()
{
for ( const auto& w : m_stimPlanModelPlots() )
{
@ -55,6 +55,14 @@ void RimStimPlanModelPlotCollection::reloadAllPlots()
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
size_t RimStimPlanModelPlotCollection::plotCount() const
{
return m_stimPlanModelPlots.size();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@ -18,6 +18,8 @@
#pragma once
#include "RimAbstractPlotCollection.h"
#include "cafPdmChildArrayField.h"
#include "cafPdmField.h"
#include "cafPdmObject.h"
@ -28,7 +30,7 @@ class RimStimPlanModelPlot;
///
///
//==================================================================================================
class RimStimPlanModelPlotCollection : public caf::PdmObject
class RimStimPlanModelPlotCollection : public caf::PdmObject, public RimPlotCollection
{
CAF_PDM_HEADER_INIT;
@ -42,7 +44,9 @@ public:
void reloadAllPlots();
void deleteAllPlots();
void deleteAllPlots() override;
void loadDataAndUpdateAllPlots() override;
size_t plotCount() const override;
private:
caf::PdmChildArrayField<RimStimPlanModelPlot*> m_stimPlanModelPlots;