mirror of
https://github.com/OPM/ResInsight.git
synced 2026-11-01 08:38:00 -06:00
Move files
Fix includes
This commit is contained in:
1 parent
ea9a1b7d85
commit
04cd253fc6
46 files changed
+606
-329
No files matched your search
@@ -19,8 +19,8 @@
|
||||
#include "RicPlotProductionRateFeature.h"
|
||||
|
||||
#include "RiaGuiApplication.h"
|
||||
|
||||
#include "PlotBuilderCommands/RicSummaryPlotBuilder.h"
|
||||
#include "Summary/RiaSummaryPlotTools.h"
|
||||
#include "Summary/RiaSummaryTools.h"
|
||||
|
||||
#include "RifEclipseSummaryAddress.h"
|
||||
#include "RifSummaryReaderInterface.h"
|
||||
@@ -40,7 +40,6 @@
|
||||
#include "RimSummaryCurveAppearanceCalculator.h"
|
||||
#include "RimSummaryMultiPlot.h"
|
||||
#include "RimSummaryPlot.h"
|
||||
#include "Summary/RiaSummaryTools.h"
|
||||
|
||||
#include "RiuPlotMainWindow.h"
|
||||
|
||||
@@ -101,7 +100,7 @@ void RicPlotProductionRateFeature::onActionTriggered( bool isChecked )
|
||||
description += well->name();
|
||||
RimSummaryPlot* plot = new RimSummaryPlot();
|
||||
plot->setUiName( description );
|
||||
RimSummaryMultiPlot* multiPlot = RicSummaryPlotBuilder::createAndAppendSingleSummaryMultiPlot( plot );
|
||||
RimSummaryMultiPlot* multiPlot = RiaSummaryPlotTools::createAndAppendSingleSummaryMultiPlot( plot );
|
||||
|
||||
if ( RimSimWellInViewTools::isInjector( well ) )
|
||||
{
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
set(SOURCE_GROUP_HEADER_FILES
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicNewMultiPlotFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicSummaryPlotBuilder.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicNewSummaryMultiPlotFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicNewSummaryPlotFromDataVectorFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicNewSummaryMultiPlotFromDataVectorFeature.h
|
||||
@@ -17,7 +16,6 @@ set(SOURCE_GROUP_HEADER_FILES
|
||||
|
||||
set(SOURCE_GROUP_SOURCE_FILES
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicNewMultiPlotFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicSummaryPlotBuilder.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicNewSummaryMultiPlotFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicNewSummaryPlotFromDataVectorFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicNewSummaryMultiPlotFromDataVectorFeature.cpp
|
||||
|
||||
+2
-3
@@ -24,10 +24,9 @@
|
||||
#include "RiaStdStringTools.h"
|
||||
#include "Summary/RiaSummaryAddressAnalyzer.h"
|
||||
#include "Summary/RiaSummaryAddressModifier.h"
|
||||
#include "Summary/RiaSummaryPlotTools.h"
|
||||
#include "Summary/RiaSummaryTools.h"
|
||||
|
||||
#include "RicSummaryPlotBuilder.h"
|
||||
|
||||
#include "RimEnsembleCurveSet.h"
|
||||
#include "RimSummaryAddressCollection.h"
|
||||
#include "RimSummaryCase.h"
|
||||
@@ -74,7 +73,7 @@ void RicAppendSummaryPlotsForObjectsFeature::appendPlots( RimSummaryMultiPlot*
|
||||
|
||||
for ( auto summaryAdrCollection : sumAddressCollections )
|
||||
{
|
||||
auto duplicatedPlots = RicSummaryPlotBuilder::duplicateSummaryPlots( plotsForOneInstance );
|
||||
auto duplicatedPlots = RiaSummaryPlotTools::duplicateSummaryPlots( plotsForOneInstance );
|
||||
|
||||
for ( auto duplicatedPlot : duplicatedPlots )
|
||||
{
|
||||
|
||||
+4
-6
@@ -18,7 +18,7 @@
|
||||
|
||||
#include "RicNewEmptySummaryMultiPlotFeature.h"
|
||||
|
||||
#include "RicSummaryPlotBuilder.h"
|
||||
#include "Summary/RiaSummaryPlotTools.h"
|
||||
|
||||
#include "RimProject.h"
|
||||
#include "RimSummaryCase.h"
|
||||
@@ -27,8 +27,6 @@
|
||||
#include "RimSummaryMultiPlotCollection.h"
|
||||
#include "RimSummaryPlot.h"
|
||||
|
||||
#include "RicSummaryPlotBuilder.h"
|
||||
|
||||
#include "cafSelectionManager.h"
|
||||
#include "cvfAssert.h"
|
||||
|
||||
@@ -45,9 +43,9 @@ void RicNewEmptySummaryMultiPlotFeature::onActionTriggered( bool isChecked )
|
||||
std::vector<RimSummaryEnsemble*> selectedEnsembles;
|
||||
|
||||
bool skipCreationOfPlotBasedOnPreferences = false;
|
||||
RicSummaryPlotBuilder::createAndAppendDefaultSummaryMultiPlot( selectedIndividualSummaryCases,
|
||||
selectedEnsembles,
|
||||
skipCreationOfPlotBasedOnPreferences );
|
||||
RiaSummaryPlotTools::createAndAppendDefaultSummaryMultiPlot( selectedIndividualSummaryCases,
|
||||
selectedEnsembles,
|
||||
skipCreationOfPlotBasedOnPreferences );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
#include "RicNewMultiPlotFeature.h"
|
||||
|
||||
#include "RicSummaryPlotBuilder.h"
|
||||
#include "Summary/RiaSummaryPlotTools.h"
|
||||
|
||||
#include "RimPlot.h"
|
||||
#include "RimWellLogTrack.h"
|
||||
@@ -54,9 +54,9 @@ caf::PdmScriptResponse RicNewMultiPlotFeature::execute()
|
||||
plots.push_back( reinterpret_cast<RimPlot*>( ptr ) );
|
||||
}
|
||||
|
||||
auto copyOfPlots = RicSummaryPlotBuilder::duplicatePlots( plots );
|
||||
auto copyOfPlots = RiaSummaryPlotTools::duplicatePlots( plots );
|
||||
|
||||
RicSummaryPlotBuilder::createAndAppendMultiPlot( copyOfPlots );
|
||||
RiaSummaryPlotTools::createAndAppendMultiPlot( copyOfPlots );
|
||||
}
|
||||
|
||||
return caf::PdmScriptResponse();
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
#include "RicNewSummaryMultiPlotFeature.h"
|
||||
|
||||
#include "RicSummaryPlotBuilder.h"
|
||||
#include "Summary/RiaSummaryPlotTools.h"
|
||||
|
||||
#include "RimProject.h"
|
||||
#include "RimSummaryCase.h"
|
||||
@@ -27,8 +27,6 @@
|
||||
#include "RimSummaryMultiPlotCollection.h"
|
||||
#include "RimSummaryPlot.h"
|
||||
|
||||
#include "RicSummaryPlotBuilder.h"
|
||||
|
||||
#include "cafSelectionManager.h"
|
||||
#include "cvfAssert.h"
|
||||
|
||||
@@ -80,9 +78,9 @@ void RicNewSummaryMultiPlotFeature::onActionTriggered( bool isChecked )
|
||||
}
|
||||
|
||||
bool skipCreationOfPlotBasedOnPreferences = false;
|
||||
RicSummaryPlotBuilder::createAndAppendDefaultSummaryMultiPlot( selectedIndividualSummaryCases,
|
||||
selectedEnsembles,
|
||||
skipCreationOfPlotBasedOnPreferences );
|
||||
RiaSummaryPlotTools::createAndAppendDefaultSummaryMultiPlot( selectedIndividualSummaryCases,
|
||||
selectedEnsembles,
|
||||
skipCreationOfPlotBasedOnPreferences );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
+3
-4
@@ -19,6 +19,7 @@
|
||||
#include "RicNewSummaryMultiPlotFromDataVectorFeature.h"
|
||||
|
||||
#include "RiaPreferencesSummary.h"
|
||||
#include "Summary/RiaSummaryPlotTools.h"
|
||||
#include "Summary/RiaSummaryTools.h"
|
||||
|
||||
#include "RimSummaryAddress.h"
|
||||
@@ -26,8 +27,6 @@
|
||||
#include "RimSummaryEnsemble.h"
|
||||
#include "RimSummaryPlot.h"
|
||||
|
||||
#include "RicSummaryPlotBuilder.h"
|
||||
|
||||
#include "RifEclipseSummaryAddress.h"
|
||||
#include "RifReaderEclipseSummary.h"
|
||||
|
||||
@@ -132,11 +131,11 @@ void RicNewSummaryMultiPlotFromDataVectorFeature::onActionTriggered( bool isChec
|
||||
}
|
||||
}
|
||||
|
||||
auto newPlot = RicSummaryPlotBuilder::createPlot( eclipseAddresses, selectedCases, selectedEnsembles );
|
||||
auto newPlot = RiaSummaryPlotTools::createPlot( eclipseAddresses, selectedCases, selectedEnsembles );
|
||||
|
||||
std::vector<RimSummaryPlot*> plots{ newPlot };
|
||||
|
||||
RicSummaryPlotBuilder::createAndAppendSummaryMultiPlot( plots );
|
||||
RiaSummaryPlotTools::createAndAppendSummaryMultiPlot( plots );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
+4
-4
@@ -18,11 +18,11 @@
|
||||
|
||||
#include "RicNewSummaryPlotFromCurveFeature.h"
|
||||
|
||||
#include "Summary/RiaSummaryPlotTools.h"
|
||||
|
||||
#include "RimSummaryCurve.h"
|
||||
#include "RimSummaryPlot.h"
|
||||
|
||||
#include "RicSummaryPlotBuilder.h"
|
||||
|
||||
#include <QAction>
|
||||
#include <QVariant>
|
||||
|
||||
@@ -41,11 +41,11 @@ void RicNewSummaryPlotFromCurveFeature::onActionTriggered( bool isChecked )
|
||||
auto curveCopy = curve->copyObject<RimSummaryCurve>();
|
||||
curveCopy->setShowInLegend( true );
|
||||
|
||||
RimSummaryPlot* plot = RicSummaryPlotBuilder::createPlot( { curveCopy } );
|
||||
RimSummaryPlot* plot = RiaSummaryPlotTools::createPlot( { curveCopy } );
|
||||
|
||||
std::vector<RimSummaryPlot*> plots = { plot };
|
||||
|
||||
RicSummaryPlotBuilder::createAndAppendSummaryMultiPlot( plots );
|
||||
RiaSummaryPlotTools::createAndAppendSummaryMultiPlot( plots );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+5
-5
@@ -18,11 +18,11 @@
|
||||
|
||||
#include "RicNewSummaryPlotFromDataVectorFeature.h"
|
||||
|
||||
#include "RimSummaryAddress.h"
|
||||
#include "RimSummaryPlot.h"
|
||||
#include "Summary/RiaSummaryPlotTools.h"
|
||||
#include "Summary/RiaSummaryTools.h"
|
||||
|
||||
#include "RicSummaryPlotBuilder.h"
|
||||
#include "RimSummaryAddress.h"
|
||||
#include "RimSummaryPlot.h"
|
||||
|
||||
#include "RifEclipseSummaryAddress.h"
|
||||
|
||||
@@ -99,8 +99,8 @@ void RicNewSummaryPlotFromDataVectorFeature::onActionTriggered( bool isChecked )
|
||||
}
|
||||
}
|
||||
|
||||
auto newPlot = RicSummaryPlotBuilder::createPlot( eclipseAddresses, selectedCases, selectedEnsembles );
|
||||
RicSummaryPlotBuilder::createAndAppendSingleSummaryMultiPlot( newPlot );
|
||||
auto newPlot = RiaSummaryPlotTools::createPlot( eclipseAddresses, selectedCases, selectedEnsembles );
|
||||
RiaSummaryPlotTools::createAndAppendSingleSummaryMultiPlot( newPlot );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
#include "RicSplitMultiPlotFeature.h"
|
||||
|
||||
#include "RicSummaryPlotBuilder.h"
|
||||
#include "Summary/RiaSummaryPlotTools.h"
|
||||
|
||||
#include "RimEnsembleCurveSet.h"
|
||||
#include "RimSummaryAddress.h"
|
||||
@@ -26,8 +26,6 @@
|
||||
#include "RimSummaryCurve.h"
|
||||
#include "RimSummaryPlot.h"
|
||||
|
||||
#include "RicSummaryPlotBuilder.h"
|
||||
|
||||
#include "cafSelectionManager.h"
|
||||
#include "cvfAssert.h"
|
||||
|
||||
@@ -73,7 +71,7 @@ void RicSplitMultiPlotFeature::onActionTriggered( bool isChecked )
|
||||
objects.push_back( addr );
|
||||
}
|
||||
|
||||
RicSummaryPlotBuilder::createAndAppendSummaryMultiPlot( objects );
|
||||
RiaSummaryPlotTools::createAndAppendSummaryMultiPlot( objects );
|
||||
|
||||
for ( auto object : objects )
|
||||
delete object;
|
||||
|
||||
@@ -1,739 +0,0 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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 <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RicSummaryPlotBuilder.h"
|
||||
|
||||
#include "PlotTemplateCommands/RicSummaryPlotTemplateTools.h"
|
||||
#include "SummaryPlotCommands/RicNewSummaryEnsembleCurveSetFeature.h"
|
||||
#include "SummaryPlotCommands/RicSummaryPlotFeatureImpl.h"
|
||||
|
||||
#include "RiaPreferencesSummary.h"
|
||||
#include "Summary/RiaSummaryAddressAnalyzer.h"
|
||||
#include "Summary/RiaSummaryTools.h"
|
||||
|
||||
#include "RifEclipseSummaryAddress.h"
|
||||
#include "RifReaderEclipseSummary.h"
|
||||
#include "RifSummaryReaderInterface.h"
|
||||
|
||||
#include "RimEnsembleCurveSet.h"
|
||||
#include "RimEnsembleCurveSetCollection.h"
|
||||
#include "RimMainPlotCollection.h"
|
||||
#include "RimMultiPlot.h"
|
||||
#include "RimMultiPlotCollection.h"
|
||||
#include "RimPlot.h"
|
||||
#include "RimSaturationPressurePlot.h"
|
||||
#include "RimSummaryCase.h"
|
||||
#include "RimSummaryCurve.h"
|
||||
#include "RimSummaryCurveAppearanceCalculator.h"
|
||||
#include "RimSummaryEnsemble.h"
|
||||
#include "RimSummaryMultiPlot.h"
|
||||
#include "RimSummaryMultiPlotCollection.h"
|
||||
#include "RimSummaryPlot.h"
|
||||
|
||||
#include "RiuPlotMainWindowTools.h"
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicSummaryPlotBuilder::RicSummaryPlotBuilder()
|
||||
: m_individualPlotPerDataSource( false )
|
||||
, m_graphCurveGrouping( RicSummaryPlotBuilder::RicGraphCurveGrouping::NONE )
|
||||
{
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicSummaryPlotBuilder::setDataSources( const std::vector<RimSummaryCase*>& summaryCases, const std::vector<RimSummaryEnsemble*>& ensembles )
|
||||
{
|
||||
m_summaryCases = summaryCases;
|
||||
m_ensembles = ensembles;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicSummaryPlotBuilder::setAddresses( const std::set<RifEclipseSummaryAddress>& addresses )
|
||||
{
|
||||
m_addresses = addresses;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicSummaryPlotBuilder::setIndividualPlotPerDataSource( bool enable )
|
||||
{
|
||||
m_individualPlotPerDataSource = enable;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicSummaryPlotBuilder::setGrouping( RicGraphCurveGrouping groping )
|
||||
{
|
||||
m_graphCurveGrouping = groping;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RimSummaryPlot*> RicSummaryPlotBuilder::createPlots() const
|
||||
{
|
||||
std::vector<RimSummaryPlot*> plots;
|
||||
|
||||
if ( m_individualPlotPerDataSource )
|
||||
{
|
||||
if ( m_graphCurveGrouping == RicGraphCurveGrouping::SINGLE_CURVES )
|
||||
{
|
||||
for ( const auto& adr : m_addresses )
|
||||
{
|
||||
for ( auto summaryCase : m_summaryCases )
|
||||
{
|
||||
auto plot = createPlot( { adr }, { summaryCase }, {} );
|
||||
plots.push_back( plot );
|
||||
}
|
||||
|
||||
for ( auto ensemble : m_ensembles )
|
||||
{
|
||||
auto plot = createPlot( { adr }, {}, { ensemble } );
|
||||
plots.push_back( plot );
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ( m_graphCurveGrouping == RicGraphCurveGrouping::CURVES_FOR_OBJECT )
|
||||
{
|
||||
RiaSummaryAddressAnalyzer analyzer;
|
||||
analyzer.appendAddresses( m_addresses );
|
||||
|
||||
auto groups = analyzer.addressesGroupedByObject();
|
||||
for ( const auto& group : groups )
|
||||
{
|
||||
std::set<RifEclipseSummaryAddress> addresses;
|
||||
addresses.insert( group.begin(), group.end() );
|
||||
if ( addresses.empty() ) continue;
|
||||
|
||||
for ( auto summaryCase : m_summaryCases )
|
||||
{
|
||||
auto plot = createPlot( addresses, { summaryCase }, {} );
|
||||
plots.push_back( plot );
|
||||
}
|
||||
|
||||
for ( auto ensemble : m_ensembles )
|
||||
{
|
||||
auto plot = createPlot( addresses, {}, { ensemble } );
|
||||
plots.push_back( plot );
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ( m_graphCurveGrouping == RicGraphCurveGrouping::NONE )
|
||||
{
|
||||
for ( auto summaryCase : m_summaryCases )
|
||||
{
|
||||
auto plot = createPlot( m_addresses, { summaryCase }, {} );
|
||||
plots.push_back( plot );
|
||||
}
|
||||
|
||||
for ( auto ensemble : m_ensembles )
|
||||
{
|
||||
auto plot = createPlot( m_addresses, {}, { ensemble } );
|
||||
plots.push_back( plot );
|
||||
}
|
||||
}
|
||||
}
|
||||
else // all data sources in same plot
|
||||
{
|
||||
if ( m_graphCurveGrouping == RicGraphCurveGrouping::SINGLE_CURVES )
|
||||
{
|
||||
for ( const auto& adr : m_addresses )
|
||||
{
|
||||
if ( !m_summaryCases.empty() )
|
||||
{
|
||||
auto plot = createPlot( { adr }, m_summaryCases, {} );
|
||||
plots.push_back( plot );
|
||||
}
|
||||
|
||||
if ( !m_ensembles.empty() )
|
||||
{
|
||||
auto plot = createPlot( { adr }, {}, m_ensembles );
|
||||
plots.push_back( plot );
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ( m_graphCurveGrouping == RicGraphCurveGrouping::CURVES_FOR_OBJECT )
|
||||
{
|
||||
RiaSummaryAddressAnalyzer analyzer;
|
||||
analyzer.appendAddresses( m_addresses );
|
||||
|
||||
auto groups = analyzer.addressesGroupedByObject();
|
||||
for ( const auto& group : groups )
|
||||
{
|
||||
std::set<RifEclipseSummaryAddress> addresses;
|
||||
addresses.insert( group.begin(), group.end() );
|
||||
if ( addresses.empty() ) continue;
|
||||
|
||||
if ( !m_summaryCases.empty() )
|
||||
{
|
||||
auto plot = createPlot( addresses, m_summaryCases, {} );
|
||||
plots.push_back( plot );
|
||||
}
|
||||
|
||||
if ( !m_ensembles.empty() )
|
||||
{
|
||||
auto plot = createPlot( addresses, {}, m_ensembles );
|
||||
plots.push_back( plot );
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ( m_graphCurveGrouping == RicGraphCurveGrouping::NONE )
|
||||
{
|
||||
if ( !m_summaryCases.empty() )
|
||||
{
|
||||
auto plot = createPlot( m_addresses, m_summaryCases, {} );
|
||||
plots.push_back( plot );
|
||||
}
|
||||
|
||||
if ( !m_ensembles.empty() )
|
||||
{
|
||||
auto plot = createPlot( m_addresses, {}, m_ensembles );
|
||||
plots.push_back( plot );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return plots;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::set<RifEclipseSummaryAddress> RicSummaryPlotBuilder::addressesForSource( caf::PdmObject* summarySource )
|
||||
{
|
||||
auto ensemble = dynamic_cast<RimSummaryEnsemble*>( summarySource );
|
||||
if ( ensemble )
|
||||
{
|
||||
return ensemble->ensembleSummaryAddresses();
|
||||
}
|
||||
|
||||
auto sumCase = dynamic_cast<RimSummaryCase*>( summarySource );
|
||||
if ( sumCase )
|
||||
{
|
||||
auto reader = sumCase ? sumCase->summaryReader() : nullptr;
|
||||
if ( reader )
|
||||
{
|
||||
return reader->allResultAddresses();
|
||||
}
|
||||
}
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimEnsembleCurveSet* RicSummaryPlotBuilder::createCurveSet( RimSummaryEnsemble* ensemble, const RifEclipseSummaryAddress& addr )
|
||||
{
|
||||
auto curveSet = new RimEnsembleCurveSet();
|
||||
|
||||
curveSet->setSummaryEnsemble( ensemble );
|
||||
curveSet->setSummaryAddressYAndStatisticsFlag( addr );
|
||||
|
||||
return curveSet;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimSummaryCurve* RicSummaryPlotBuilder::createCurve( RimSummaryCase* summaryCase, const RifEclipseSummaryAddress& addr )
|
||||
{
|
||||
auto curve = new RimSummaryCurve();
|
||||
|
||||
curve->setSummaryCaseY( summaryCase );
|
||||
curve->setSummaryAddressY( addr );
|
||||
|
||||
return curve;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RimPlot*> RicSummaryPlotBuilder::duplicatePlots( const std::vector<RimPlot*>& sourcePlots )
|
||||
{
|
||||
std::vector<RimPlot*> plots;
|
||||
|
||||
for ( auto plot : sourcePlots )
|
||||
{
|
||||
auto copy = plot->copyObject<RimPlot>();
|
||||
{
|
||||
// TODO: Workaround for fixing the PdmPointer in RimEclipseResultDefinition
|
||||
// caf::PdmPointer<RimEclipseCase> m_eclipseCase;
|
||||
// This pdmpointer must be changed to a ptrField
|
||||
|
||||
auto saturationPressurePlotOriginal = dynamic_cast<RimSaturationPressurePlot*>( plot );
|
||||
auto saturationPressurePlotCopy = dynamic_cast<RimSaturationPressurePlot*>( copy );
|
||||
if ( saturationPressurePlotCopy && saturationPressurePlotOriginal )
|
||||
{
|
||||
RimSaturationPressurePlot::fixPointersAfterCopy( saturationPressurePlotOriginal, saturationPressurePlotCopy );
|
||||
}
|
||||
}
|
||||
|
||||
plots.push_back( copy );
|
||||
}
|
||||
|
||||
return plots;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RimSummaryPlot*> RicSummaryPlotBuilder::duplicateSummaryPlots( const std::vector<RimSummaryPlot*>& sourcePlots )
|
||||
{
|
||||
std::vector<RimSummaryPlot*> plots;
|
||||
|
||||
for ( auto plot : sourcePlots )
|
||||
{
|
||||
auto copy = plot->copyObject<RimSummaryPlot>();
|
||||
if ( copy )
|
||||
{
|
||||
plots.push_back( copy );
|
||||
}
|
||||
}
|
||||
|
||||
return plots;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimMultiPlot* RicSummaryPlotBuilder::createAndAppendMultiPlot( const std::vector<RimPlot*>& plots )
|
||||
{
|
||||
RimMultiPlotCollection* plotCollection = RimMainPlotCollection::current()->multiPlotCollection();
|
||||
|
||||
auto* plotWindow = new RimMultiPlot;
|
||||
plotWindow->setMultiPlotTitle( QString( "Multi Plot %1" ).arg( plotCollection->multiPlots().size() + 1 ) );
|
||||
plotWindow->setAsPlotMdiWindow();
|
||||
plotCollection->addMultiPlot( plotWindow );
|
||||
|
||||
appendPlotsToMultiPlot( plotWindow, plots );
|
||||
|
||||
plotCollection->updateAllRequiredEditors();
|
||||
plotWindow->loadDataAndUpdate();
|
||||
|
||||
if ( !plots.empty() )
|
||||
{
|
||||
RiuPlotMainWindowTools::selectAsCurrentItem( plots[0] );
|
||||
}
|
||||
else
|
||||
{
|
||||
RiuPlotMainWindowTools::selectAsCurrentItem( plotWindow );
|
||||
}
|
||||
|
||||
return plotWindow;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimSummaryMultiPlot* RicSummaryPlotBuilder::createAndAppendSummaryMultiPlot( const std::vector<caf::PdmObjectHandle*>& objects )
|
||||
{
|
||||
RimSummaryMultiPlotCollection* plotCollection = RimMainPlotCollection::current()->summaryMultiPlotCollection();
|
||||
|
||||
auto* plotWindow = new RimSummaryMultiPlot;
|
||||
plotWindow->setMultiPlotTitle( QString( "Multi Plot %1" ).arg( plotCollection->multiPlots().size() + 1 ) );
|
||||
plotWindow->setAsPlotMdiWindow();
|
||||
plotCollection->addSummaryMultiPlot( plotWindow );
|
||||
|
||||
plotWindow->handleDroppedObjects( objects );
|
||||
|
||||
plotCollection->updateAllRequiredEditors();
|
||||
plotWindow->loadDataAndUpdate();
|
||||
|
||||
if ( plotWindow->summaryPlots().size() == 1 )
|
||||
{
|
||||
RiuPlotMainWindowTools::selectAsCurrentItem( plotWindow->summaryPlots()[0] );
|
||||
RiuPlotMainWindowTools::setExpanded( plotWindow->summaryPlots()[0] );
|
||||
}
|
||||
else
|
||||
{
|
||||
RiuPlotMainWindowTools::selectAsCurrentItem( plotWindow );
|
||||
RiuPlotMainWindowTools::setExpanded( plotWindow );
|
||||
}
|
||||
|
||||
return plotWindow;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicSummaryPlotBuilder::appendPlotsToMultiPlot( RimMultiPlot* multiPlot, const std::vector<RimPlot*>& plots )
|
||||
{
|
||||
for ( auto plot : plots )
|
||||
{
|
||||
// Remove the current window controller, as this will be managed by the multi plot
|
||||
// This must be done before adding the plot to the multi plot to ensure that the viewer widget is recreated
|
||||
plot->revokeMdiWindowStatus();
|
||||
|
||||
multiPlot->addPlot( plot );
|
||||
|
||||
plot->resolveReferencesRecursively();
|
||||
plot->setShowWindow( true );
|
||||
|
||||
plot->loadDataAndUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimSummaryMultiPlot* RicSummaryPlotBuilder::createAndAppendDefaultSummaryMultiPlot( const std::vector<RimSummaryCase*>& cases,
|
||||
const std::vector<RimSummaryEnsemble*>& ensembles,
|
||||
bool skipCreationOfPlotBasedOnPreferences )
|
||||
{
|
||||
RiaPreferencesSummary* prefs = RiaPreferencesSummary::current();
|
||||
|
||||
if ( skipCreationOfPlotBasedOnPreferences && prefs->defaultSummaryPlotType() == RiaPreferencesSummary::DefaultSummaryPlotType::NONE )
|
||||
return nullptr;
|
||||
|
||||
if ( prefs->defaultSummaryPlotType() == RiaPreferencesSummary::DefaultSummaryPlotType::PLOT_TEMPLATES )
|
||||
{
|
||||
RimSummaryMultiPlot* plotToSelect = nullptr;
|
||||
bool ensembleTemplates = ( !ensembles.empty() );
|
||||
for ( auto& filename : prefs->defaultSummaryPlotTemplates( ensembleTemplates ) )
|
||||
{
|
||||
plotToSelect = RicSummaryPlotTemplateTools::create( filename, cases, ensembles );
|
||||
}
|
||||
|
||||
if ( plotToSelect ) return plotToSelect;
|
||||
|
||||
if ( skipCreationOfPlotBasedOnPreferences )
|
||||
{
|
||||
return plotToSelect;
|
||||
}
|
||||
}
|
||||
|
||||
if ( skipCreationOfPlotBasedOnPreferences && prefs->defaultSummaryCurvesTextFilter().trimmed().isEmpty() ) return nullptr;
|
||||
|
||||
auto* plotCollection = RimMainPlotCollection::current()->summaryMultiPlotCollection();
|
||||
|
||||
auto* summaryMultiPlot = new RimSummaryMultiPlot();
|
||||
summaryMultiPlot->setAsPlotMdiWindow();
|
||||
plotCollection->addSummaryMultiPlot( summaryMultiPlot );
|
||||
|
||||
RimSummaryPlot* plot = new RimSummaryPlot();
|
||||
plot->setAsPlotMdiWindow();
|
||||
plot->enableAutoPlotTitle( true );
|
||||
|
||||
for ( auto sumCase : cases )
|
||||
{
|
||||
RicSummaryPlotFeatureImpl::addDefaultCurvesToPlot( plot, sumCase );
|
||||
}
|
||||
|
||||
for ( auto ensemble : ensembles )
|
||||
{
|
||||
RicNewSummaryEnsembleCurveSetFeature::addDefaultCurveSets( plot, ensemble );
|
||||
}
|
||||
|
||||
plot->applyDefaultCurveAppearances();
|
||||
plot->loadDataAndUpdate();
|
||||
|
||||
plotCollection->updateConnectedEditors();
|
||||
|
||||
appendPlotsToSummaryMultiPlot( summaryMultiPlot, { plot } );
|
||||
|
||||
summaryMultiPlot->setDefaultRangeAggregationSteppingDimension();
|
||||
|
||||
plotCollection->updateAllRequiredEditors();
|
||||
summaryMultiPlot->loadDataAndUpdate();
|
||||
summaryMultiPlot->updateAllRequiredEditors();
|
||||
|
||||
RiuPlotMainWindowTools::selectAsCurrentItem( plot );
|
||||
if ( !plot->curveSets().empty() )
|
||||
{
|
||||
RiuPlotMainWindowTools::setExpanded( plot->curveSets().front() );
|
||||
}
|
||||
else if ( !plot->summaryCurves().empty() )
|
||||
{
|
||||
RiuPlotMainWindowTools::setExpanded( plot->summaryCurves().front() );
|
||||
}
|
||||
|
||||
return summaryMultiPlot;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimSummaryMultiPlot* RicSummaryPlotBuilder::createAndAppendSingleSummaryMultiPlotNoAutoSettings( RimSummaryPlot* plot )
|
||||
{
|
||||
auto* plotCollection = RimMainPlotCollection::current()->summaryMultiPlotCollection();
|
||||
|
||||
auto* summaryMultiPlot = new RimSummaryMultiPlot();
|
||||
summaryMultiPlot->setColumnCount( RiaDefines::ColumnCount::COLUMNS_1 );
|
||||
summaryMultiPlot->setRowCount( RiaDefines::RowCount::ROWS_1 );
|
||||
summaryMultiPlot->setAsPlotMdiWindow();
|
||||
|
||||
if ( !plot->autoPlotTitle() )
|
||||
{
|
||||
// Move settings from the single summary plot to the multi plot, and disable auto titles
|
||||
summaryMultiPlot->setAutoPlotTitle( false );
|
||||
summaryMultiPlot->setAutoSubPlotTitle( false );
|
||||
summaryMultiPlot->setMultiPlotTitleVisible( true );
|
||||
summaryMultiPlot->setMultiPlotTitle( plot->description() );
|
||||
|
||||
plot->setPlotTitleVisible( false );
|
||||
plot->setDescription( "" );
|
||||
}
|
||||
|
||||
plotCollection->addSummaryMultiPlot( summaryMultiPlot );
|
||||
|
||||
appendPlotsToSummaryMultiPlot( summaryMultiPlot, { plot } );
|
||||
|
||||
plotCollection->updateAllRequiredEditors();
|
||||
summaryMultiPlot->loadDataAndUpdate();
|
||||
summaryMultiPlot->updateAllRequiredEditors();
|
||||
|
||||
RiuPlotMainWindowTools::selectAsCurrentItem( plot );
|
||||
|
||||
return summaryMultiPlot;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimSummaryMultiPlot* RicSummaryPlotBuilder::createAndAppendSummaryMultiPlot( const std::vector<RimSummaryPlot*>& plots )
|
||||
{
|
||||
auto* plotCollection = RimMainPlotCollection::current()->summaryMultiPlotCollection();
|
||||
|
||||
auto* summaryMultiPlot = new RimSummaryMultiPlot();
|
||||
summaryMultiPlot->setAsPlotMdiWindow();
|
||||
plotCollection->addSummaryMultiPlot( summaryMultiPlot );
|
||||
|
||||
appendPlotsToSummaryMultiPlot( summaryMultiPlot, plots );
|
||||
|
||||
summaryMultiPlot->setDefaultRangeAggregationSteppingDimension();
|
||||
|
||||
plotCollection->updateAllRequiredEditors();
|
||||
summaryMultiPlot->loadDataAndUpdate();
|
||||
summaryMultiPlot->updateAllRequiredEditors();
|
||||
summaryMultiPlot->zoomAll();
|
||||
|
||||
if ( !plots.empty() )
|
||||
{
|
||||
auto* plot = plots.front();
|
||||
if ( !plot->curveSets().empty() )
|
||||
{
|
||||
RiuPlotMainWindowTools::selectAsCurrentItem( plot->curveSets().front() );
|
||||
}
|
||||
else if ( !plot->summaryCurves().empty() )
|
||||
{
|
||||
RiuPlotMainWindowTools::selectAsCurrentItem( plot->summaryCurves().front() );
|
||||
}
|
||||
else
|
||||
{
|
||||
RiuPlotMainWindowTools::selectAsCurrentItem( plot );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
RiuPlotMainWindowTools::selectAsCurrentItem( summaryMultiPlot );
|
||||
}
|
||||
|
||||
return summaryMultiPlot;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimSummaryMultiPlot* RicSummaryPlotBuilder::createAndAppendSingleSummaryMultiPlot( RimSummaryPlot* plot )
|
||||
{
|
||||
std::vector<RimSummaryPlot*> plots{ plot };
|
||||
|
||||
return createAndAppendSummaryMultiPlot( plots );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicSummaryPlotBuilder::appendPlotsToSummaryMultiPlot( RimSummaryMultiPlot* multiPlot, const std::vector<RimSummaryPlot*>& plots )
|
||||
{
|
||||
multiPlot->startBatchAddOperation();
|
||||
for ( auto plot : plots )
|
||||
{
|
||||
plot->revokeMdiWindowStatus();
|
||||
|
||||
multiPlot->addPlot( plot );
|
||||
|
||||
plot->resolveReferencesRecursively();
|
||||
plot->setShowWindow( true );
|
||||
}
|
||||
multiPlot->endBatchAddOperation();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimSummaryPlot* RicSummaryPlotBuilder::createPlot( const std::vector<RimSummaryCurve*>& summaryCurves )
|
||||
{
|
||||
auto* plot = new RimSummaryPlot();
|
||||
plot->enableAutoPlotTitle( true );
|
||||
|
||||
for ( auto& curve : summaryCurves )
|
||||
{
|
||||
plot->addCurveNoUpdate( curve );
|
||||
}
|
||||
|
||||
plot->applyDefaultCurveAppearances();
|
||||
|
||||
return plot;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimSummaryPlot* RicSummaryPlotBuilder::createPlot( const std::set<RifEclipseSummaryAddress>& addresses,
|
||||
const std::vector<RimSummaryCase*>& summaryCases,
|
||||
const std::vector<RimSummaryEnsemble*>& ensembles )
|
||||
{
|
||||
auto* plot = new RimSummaryPlot();
|
||||
plot->enableAutoPlotTitle( true );
|
||||
|
||||
appendCurvesToPlot( plot, addresses, summaryCases, ensembles );
|
||||
|
||||
plot->applyDefaultCurveAppearances();
|
||||
|
||||
return plot;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimSummaryPlot* RicSummaryPlotBuilder::createCrossPlot( const std::vector<RiaSummaryCurveAddress>& addresses,
|
||||
const std::vector<RimSummaryCase*>& summaryCases,
|
||||
const std::vector<RimSummaryEnsemble*>& ensembles )
|
||||
{
|
||||
auto* summaryPlot = new RimSummaryPlot();
|
||||
summaryPlot->enableAutoPlotTitle( true );
|
||||
|
||||
for ( const auto& addr : addresses )
|
||||
{
|
||||
for ( const auto ensemble : ensembles )
|
||||
{
|
||||
if ( !ensemble ) continue;
|
||||
|
||||
auto curveSet = addNewEnsembleCurve( summaryPlot, addr, ensemble );
|
||||
curveSet->findOrAssignBottomAxisX( RiuPlotAxis::defaultBottomForSummaryVectors() );
|
||||
}
|
||||
|
||||
for ( const auto summaryCase : summaryCases )
|
||||
{
|
||||
if ( !summaryCase ) continue;
|
||||
|
||||
addNewSummaryCurve( summaryPlot, addr, summaryCase );
|
||||
}
|
||||
}
|
||||
|
||||
summaryPlot->applyDefaultCurveAppearances();
|
||||
summaryPlot->loadDataAndUpdate();
|
||||
summaryPlot->zoomAll();
|
||||
|
||||
return summaryPlot;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicSummaryPlotBuilder::appendCurvesToPlot( RimSummaryPlot* summaryPlot,
|
||||
const std::set<RifEclipseSummaryAddress>& addresses,
|
||||
const std::vector<RimSummaryCase*>& summaryCases,
|
||||
const std::vector<RimSummaryEnsemble*>& ensembles )
|
||||
{
|
||||
for ( const auto& addr : addresses )
|
||||
{
|
||||
for ( const auto ensemble : ensembles )
|
||||
{
|
||||
auto curveSet = createCurveSet( ensemble, addr );
|
||||
summaryPlot->ensembleCurveSetCollection()->addCurveSet( curveSet );
|
||||
curveSet->setLeftOrRightAxisY( RiuPlotAxis::defaultLeft() );
|
||||
}
|
||||
|
||||
for ( const auto summaryCase : summaryCases )
|
||||
{
|
||||
auto curve = createCurve( summaryCase, addr );
|
||||
summaryPlot->addCurveNoUpdate( curve );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimEnsembleCurveSet* RicSummaryPlotBuilder::addNewEnsembleCurve( RimSummaryPlot* summaryPlot,
|
||||
const RiaSummaryCurveAddress& curveAddress,
|
||||
RimSummaryEnsemble* ensemble )
|
||||
{
|
||||
auto* curveSet = new RimEnsembleCurveSet();
|
||||
|
||||
curveSet->setSummaryEnsemble( ensemble );
|
||||
curveSet->setCurveAddress( curveAddress );
|
||||
|
||||
cvf::Color3f curveColor =
|
||||
RimSummaryCurveAppearanceCalculator::computeTintedCurveColorForAddress( curveSet->summaryAddressY(),
|
||||
static_cast<int>(
|
||||
summaryPlot->ensembleCurveSetCollection()->curveSetCount() ) );
|
||||
|
||||
auto adr = curveSet->summaryAddressY();
|
||||
if ( adr.isHistoryVector() ) curveColor = RiaPreferencesSummary::current()->historyCurveContrastColor();
|
||||
|
||||
curveSet->setColor( curveColor );
|
||||
|
||||
summaryPlot->ensembleCurveSetCollection()->addCurveSet( curveSet );
|
||||
|
||||
curveSet->setLeftOrRightAxisY( RiuPlotAxis::defaultLeft() );
|
||||
curveSet->setBottomOrTopAxisX( RiuPlotAxis::defaultBottomForSummaryVectors() );
|
||||
|
||||
summaryPlot->curvesChanged.send();
|
||||
|
||||
return curveSet;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimSummaryCurve* RicSummaryPlotBuilder::addNewSummaryCurve( RimSummaryPlot* summaryPlot,
|
||||
const RiaSummaryCurveAddress& curveAddress,
|
||||
RimSummaryCase* summaryCase )
|
||||
{
|
||||
auto curve = new RimSummaryCurve();
|
||||
|
||||
curve->setSummaryCaseY( summaryCase );
|
||||
curve->setSummaryAddressY( curveAddress.summaryAddressY() );
|
||||
|
||||
curve->setSummaryCaseX( summaryCase );
|
||||
curve->setSummaryAddressX( curveAddress.summaryAddressX() );
|
||||
if ( curveAddress.summaryAddressX().category() != SummaryCategory::SUMMARY_TIME )
|
||||
{
|
||||
curve->setAxisTypeX( RiaDefines::HorizontalAxisType::SUMMARY_VECTOR );
|
||||
}
|
||||
|
||||
summaryPlot->addCurveNoUpdate( curve );
|
||||
|
||||
if ( curveAddress.summaryAddressX().category() != SummaryCategory::SUMMARY_TIME )
|
||||
{
|
||||
summaryPlot->findOrAssignPlotAxisX( curve );
|
||||
}
|
||||
|
||||
return curve;
|
||||
}
|
||||
@@ -41,7 +41,7 @@ class PdmObjectHandle;
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
class RicSummaryPlotBuilder
|
||||
class RiaSummaryPlotBuilder
|
||||
{
|
||||
public:
|
||||
enum class RicGraphCurveGrouping
|
||||
@@ -52,7 +52,7 @@ public:
|
||||
};
|
||||
|
||||
public:
|
||||
RicSummaryPlotBuilder();
|
||||
RiaSummaryPlotBuilder();
|
||||
|
||||
void setDataSources( const std::vector<RimSummaryCase*>& summaryCases, const std::vector<RimSummaryEnsemble*>& ensembles );
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
set(SOURCE_GROUP_HEADER_FILES
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicSelectPlotTemplateUi.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicSummaryPlotTemplateTools.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicReloadPlotTemplatesFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicCreatePlotFromTemplateByShortcutFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicSaveMultiPlotTemplateFeature.h
|
||||
@@ -15,7 +14,6 @@ set(SOURCE_GROUP_HEADER_FILES
|
||||
|
||||
set(SOURCE_GROUP_SOURCE_FILES
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicSelectPlotTemplateUi.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicSummaryPlotTemplateTools.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicReloadPlotTemplatesFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicCreatePlotFromTemplateByShortcutFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicSaveMultiPlotTemplateFeature.cpp
|
||||
|
||||
+1
-1
@@ -18,8 +18,8 @@
|
||||
|
||||
#include "RicCreateMultiPlotFromSelectionFeature.h"
|
||||
|
||||
#include "RicSummaryPlotTemplateTools.h"
|
||||
#include "RimSummaryMultiPlot.h"
|
||||
#include "Summary/RiaSummaryPlotTemplateTools.h"
|
||||
|
||||
#include "RiuPlotMainWindowTools.h"
|
||||
|
||||
|
||||
+1
-1
@@ -24,7 +24,7 @@
|
||||
#include "RiaPreferences.h"
|
||||
|
||||
#include "RicSelectCaseOrEnsembleUi.h"
|
||||
#include "RicSummaryPlotTemplateTools.h"
|
||||
#include "Summary/RiaSummaryPlotTemplateTools.h"
|
||||
|
||||
#include "RimSummaryCase.h"
|
||||
#include "RimSummaryEnsemble.h"
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@
|
||||
#include "RiaGuiApplication.h"
|
||||
#include "RiaPreferences.h"
|
||||
|
||||
#include "RicSummaryPlotTemplateTools.h"
|
||||
#include "Summary/RiaSummaryPlotTemplateTools.h"
|
||||
|
||||
#include "RimSummaryMultiPlot.h"
|
||||
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@
|
||||
|
||||
#include "RicReloadPlotTemplatesFeature.h"
|
||||
#include "RicSaveMultiPlotTemplateFeatureSettings.h"
|
||||
#include "RicSummaryPlotTemplateTools.h"
|
||||
#include "Summary/RiaSummaryPlotTemplateTools.h"
|
||||
|
||||
#include "RiaGuiApplication.h"
|
||||
#include "RiaLogging.h"
|
||||
|
||||
@@ -1,690 +0,0 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2019- 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 <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RicSummaryPlotTemplateTools.h"
|
||||
|
||||
#include "RiaGuiApplication.h"
|
||||
#include "RiaLogging.h"
|
||||
#include "RiaPreferences.h"
|
||||
#include "Summary/RiaSummaryAddressAnalyzer.h"
|
||||
#include "Summary/RiaSummaryTools.h"
|
||||
|
||||
#include "PlotBuilderCommands/RicSummaryPlotBuilder.h"
|
||||
#include "RicSelectPlotTemplateUi.h"
|
||||
|
||||
#include "RifSummaryReaderInterface.h"
|
||||
|
||||
#include "PlotTemplates/RimPlotTemplateFileItem.h"
|
||||
#include "RimDialogData.h"
|
||||
#include "RimEnsembleCurveSet.h"
|
||||
#include "RimEnsembleCurveSetCollection.h"
|
||||
#include "RimMainPlotCollection.h"
|
||||
#include "RimSummaryAddressCollection.h"
|
||||
#include "RimSummaryCase.h"
|
||||
#include "RimSummaryCurve.h"
|
||||
#include "RimSummaryEnsemble.h"
|
||||
#include "RimSummaryMultiPlot.h"
|
||||
#include "RimSummaryMultiPlotCollection.h"
|
||||
#include "RimSummaryPlot.h"
|
||||
|
||||
#include "RiuPlotMainWindow.h"
|
||||
|
||||
#include "cafPdmUiPropertyViewDialog.h"
|
||||
#include "cafSelectionManager.h"
|
||||
|
||||
#include <QFile>
|
||||
#include <QRegularExpression>
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimSummaryMultiPlot* RicSummaryPlotTemplateTools::createMultiPlotFromTemplateFile( const QString& fileName )
|
||||
{
|
||||
QFile importFile( fileName );
|
||||
if ( !importFile.open( QIODevice::ReadOnly | QIODevice::Text ) )
|
||||
{
|
||||
RiaLogging::error( QString( "Create Plot from Template : Could not open the file: %1" ).arg( fileName ) );
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
QTextStream stream( &importFile );
|
||||
|
||||
QString objectAsText = stream.readAll();
|
||||
|
||||
caf::PdmObjectHandle* obj =
|
||||
caf::PdmXmlObjectHandle::readUnknownObjectFromXmlString( objectAsText, caf::PdmDefaultObjectFactory::instance(), true );
|
||||
|
||||
return dynamic_cast<RimSummaryMultiPlot*>( obj );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimSummaryMultiPlot* RicSummaryPlotTemplateTools::create( const QString& fileName )
|
||||
{
|
||||
auto sumCases = RicSummaryPlotTemplateTools::selectedSummaryCases();
|
||||
auto sumEnsembles = RicSummaryPlotTemplateTools::selectedSummaryEnsembles();
|
||||
|
||||
auto summaryAddressCollections = RicSummaryPlotTemplateTools::selectedSummaryAddressCollections();
|
||||
|
||||
std::vector<QString> wellNames;
|
||||
std::vector<QString> groupNames;
|
||||
std::vector<QString> regions;
|
||||
std::set<RimSummaryCase*> caseSet;
|
||||
std::set<RimSummaryEnsemble*> caseCollectionSet;
|
||||
|
||||
if ( summaryAddressCollections.empty() )
|
||||
{
|
||||
RiaSummaryAddressAnalyzer analyzer;
|
||||
|
||||
if ( !sumCases.empty() )
|
||||
{
|
||||
auto firstCase = sumCases.front();
|
||||
|
||||
analyzer.appendAddresses( firstCase->summaryReader()->allResultAddresses() );
|
||||
}
|
||||
else if ( !sumEnsembles.empty() )
|
||||
{
|
||||
auto caseCollection = sumEnsembles.front();
|
||||
|
||||
auto firstCase = caseCollection->firstSummaryCase();
|
||||
if ( firstCase != nullptr )
|
||||
{
|
||||
analyzer.appendAddresses( firstCase->summaryReader()->allResultAddresses() );
|
||||
}
|
||||
}
|
||||
|
||||
if ( !analyzer.wellNames().empty() ) wellNames.push_back( QString::fromStdString( *( analyzer.wellNames().begin() ) ) );
|
||||
if ( !analyzer.groupNames().empty() ) groupNames.push_back( QString::fromStdString( *( analyzer.groupNames().begin() ) ) );
|
||||
if ( !analyzer.regionNumbers().empty() ) regions.push_back( QString::number( *( analyzer.regionNumbers().begin() ) ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
for ( auto a : summaryAddressCollections )
|
||||
{
|
||||
if ( a->contentType() == RimSummaryAddressCollection::CollectionContentType::WELL )
|
||||
{
|
||||
wellNames.push_back( a->name() );
|
||||
}
|
||||
else if ( a->contentType() == RimSummaryAddressCollection::CollectionContentType::GROUP )
|
||||
{
|
||||
groupNames.push_back( a->name() );
|
||||
}
|
||||
else if ( a->contentType() == RimSummaryAddressCollection::CollectionContentType::REGION )
|
||||
{
|
||||
regions.push_back( a->name() );
|
||||
}
|
||||
|
||||
auto sumCase = RiaSummaryTools::summaryCaseById( a->caseId() );
|
||||
if ( sumCase ) caseSet.insert( sumCase );
|
||||
|
||||
auto ensemble = RiaSummaryTools::ensembleById( a->ensembleId() );
|
||||
if ( ensemble ) caseCollectionSet.insert( ensemble );
|
||||
}
|
||||
}
|
||||
|
||||
for ( auto sumCase : caseSet )
|
||||
{
|
||||
sumCases.push_back( sumCase );
|
||||
}
|
||||
|
||||
for ( auto sumCaseCollection : caseCollectionSet )
|
||||
{
|
||||
sumEnsembles.push_back( sumCaseCollection );
|
||||
}
|
||||
|
||||
auto collections = RimMainPlotCollection::current()->summaryMultiPlotCollection();
|
||||
|
||||
auto newSummaryPlot = RicSummaryPlotTemplateTools::createMultiPlotFromTemplateFile( fileName );
|
||||
if ( !newSummaryPlot ) return nullptr;
|
||||
|
||||
collections->addSummaryMultiPlot( newSummaryPlot );
|
||||
newSummaryPlot->resolveReferencesRecursively();
|
||||
|
||||
RicSummaryPlotTemplateTools::setValuesForPlaceholders( newSummaryPlot, sumCases, sumEnsembles, wellNames, groupNames, regions );
|
||||
newSummaryPlot->initAfterReadRecursively();
|
||||
newSummaryPlot->loadDataAndUpdate();
|
||||
|
||||
collections->updateConnectedEditors();
|
||||
|
||||
return newSummaryPlot;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimSummaryMultiPlot* RicSummaryPlotTemplateTools::create( const QString& fileName,
|
||||
const std::vector<RimSummaryCase*>& sumCases,
|
||||
const std::vector<RimSummaryEnsemble*>& ensembles )
|
||||
{
|
||||
std::vector<QString> wellNames;
|
||||
std::vector<QString> groupNames;
|
||||
std::vector<QString> regions;
|
||||
|
||||
RiaSummaryAddressAnalyzer analyzer;
|
||||
|
||||
if ( !sumCases.empty() )
|
||||
{
|
||||
auto firstCase = sumCases.front();
|
||||
|
||||
analyzer.appendAddresses( firstCase->summaryReader()->allResultAddresses() );
|
||||
}
|
||||
else if ( !ensembles.empty() )
|
||||
{
|
||||
auto caseCollection = ensembles.front();
|
||||
|
||||
auto firstCase = caseCollection->firstSummaryCase();
|
||||
if ( firstCase != nullptr )
|
||||
{
|
||||
analyzer.appendAddresses( firstCase->summaryReader()->allResultAddresses() );
|
||||
}
|
||||
}
|
||||
|
||||
if ( !analyzer.wellNames().empty() ) wellNames.push_back( QString::fromStdString( *( analyzer.wellNames().begin() ) ) );
|
||||
if ( !analyzer.groupNames().empty() ) groupNames.push_back( QString::fromStdString( *( analyzer.groupNames().begin() ) ) );
|
||||
if ( !analyzer.regionNumbers().empty() ) regions.push_back( QString::number( *( analyzer.regionNumbers().begin() ) ) );
|
||||
|
||||
auto collections = RimMainPlotCollection::current()->summaryMultiPlotCollection();
|
||||
|
||||
auto newSummaryPlot = RicSummaryPlotTemplateTools::createMultiPlotFromTemplateFile( fileName );
|
||||
if ( !newSummaryPlot ) return nullptr;
|
||||
|
||||
collections->addSummaryMultiPlot( newSummaryPlot );
|
||||
newSummaryPlot->resolveReferencesRecursively();
|
||||
|
||||
RicSummaryPlotTemplateTools::setValuesForPlaceholders( newSummaryPlot, sumCases, ensembles, wellNames, groupNames, regions );
|
||||
newSummaryPlot->initAfterReadRecursively();
|
||||
newSummaryPlot->loadDataAndUpdate();
|
||||
collections->updateConnectedEditors();
|
||||
|
||||
return newSummaryPlot;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicSummaryPlotTemplateTools::setValuesForPlaceholders( RimSummaryMultiPlot* summaryMultiPlot,
|
||||
const std::vector<RimSummaryCase*>& selectedSummaryCases,
|
||||
const std::vector<RimSummaryEnsemble*>& selectedEnsembles,
|
||||
const std::vector<QString>& wellNames,
|
||||
const std::vector<QString>& groupNames,
|
||||
const std::vector<QString>& regions )
|
||||
|
||||
{
|
||||
auto plots = summaryMultiPlot->plots();
|
||||
for ( auto p : plots )
|
||||
{
|
||||
auto summaryPlot = dynamic_cast<RimSummaryPlot*>( p );
|
||||
if ( summaryPlot ) setValuesForPlaceholders( summaryPlot, selectedSummaryCases, selectedEnsembles, wellNames, groupNames, regions );
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicSummaryPlotTemplateTools::setValuesForPlaceholders( RimSummaryPlot* summaryPlot,
|
||||
const std::vector<RimSummaryCase*>& selectedSummaryCases,
|
||||
const std::vector<RimSummaryEnsemble*>& selectedEnsembles,
|
||||
const std::vector<QString>& wellNames,
|
||||
const std::vector<QString>& groupNames,
|
||||
const std::vector<QString>& regions )
|
||||
{
|
||||
{
|
||||
// Replace single summary curves data sources
|
||||
|
||||
auto summaryCurves = summaryPlot->allCurves();
|
||||
for ( const auto& curve : summaryCurves )
|
||||
{
|
||||
auto summaryCaseHandle = curve->findField( RicSummaryPlotTemplateTools::summaryCaseFieldKeyword() );
|
||||
if ( summaryCaseHandle )
|
||||
{
|
||||
bool conversionOk = false;
|
||||
const QString placeholderString = RicSummaryPlotTemplateTools::placeholderTextForSummaryCase();
|
||||
|
||||
auto referenceString = summaryCaseHandle->xmlCapability()->referenceString();
|
||||
int indexValue = RicSummaryPlotTemplateTools::findValueForKeyword( placeholderString, referenceString, &conversionOk );
|
||||
|
||||
if ( conversionOk && indexValue >= 0 && indexValue < static_cast<int>( selectedSummaryCases.size() ) )
|
||||
{
|
||||
auto summaryCaseY = selectedSummaryCases[static_cast<int>( indexValue )];
|
||||
curve->setSummaryCaseY( summaryCaseY );
|
||||
}
|
||||
}
|
||||
|
||||
auto summaryCaseXHandle = curve->findField( RicSummaryPlotTemplateTools::summaryCaseXFieldKeyword() );
|
||||
if ( summaryCaseXHandle )
|
||||
{
|
||||
bool conversionOk = false;
|
||||
const QString placeholderString = RicSummaryPlotTemplateTools::placeholderTextForSummaryCaseX();
|
||||
|
||||
auto referenceString = summaryCaseXHandle->xmlCapability()->referenceString();
|
||||
int indexValue = RicSummaryPlotTemplateTools::findValueForKeyword( placeholderString, referenceString, &conversionOk );
|
||||
|
||||
if ( conversionOk && indexValue >= 0 && indexValue < static_cast<int>( selectedSummaryCases.size() ) )
|
||||
{
|
||||
auto summaryCase = selectedSummaryCases[static_cast<int>( indexValue )];
|
||||
curve->setSummaryCaseX( summaryCase );
|
||||
}
|
||||
}
|
||||
|
||||
// Replace placeholders with object names from selection
|
||||
auto curveAdr = curve->summaryAddressY();
|
||||
setPlaceholderWellName( &curveAdr, wellNames );
|
||||
setPlaceholderGroupName( &curveAdr, groupNames );
|
||||
setPlaceholderRegion( &curveAdr, regions );
|
||||
curve->setSummaryAddressY( curveAdr );
|
||||
|
||||
if ( curve->axisTypeX() == RiaDefines::HorizontalAxisType::SUMMARY_VECTOR )
|
||||
{
|
||||
auto curveAdr = curve->summaryAddressX();
|
||||
setPlaceholderWellName( &curveAdr, wellNames );
|
||||
setPlaceholderGroupName( &curveAdr, groupNames );
|
||||
setPlaceholderRegion( &curveAdr, regions );
|
||||
curve->setSummaryAddressX( curveAdr );
|
||||
}
|
||||
}
|
||||
|
||||
for ( const auto& curveSet : summaryPlot->curveSets() )
|
||||
{
|
||||
const QString summaryGroupFieldKeyword = RicSummaryPlotTemplateTools::summaryGroupFieldKeyword();
|
||||
|
||||
auto fieldHandle = curveSet->findField( summaryGroupFieldKeyword );
|
||||
if ( fieldHandle )
|
||||
{
|
||||
bool conversionOk = false;
|
||||
const QString placeholderString = RicSummaryPlotTemplateTools::placeholderTextForSummaryGroup();
|
||||
|
||||
auto referenceString = fieldHandle->xmlCapability()->referenceString();
|
||||
int indexValue = RicSummaryPlotTemplateTools::findValueForKeyword( placeholderString, referenceString, &conversionOk );
|
||||
|
||||
if ( conversionOk && indexValue >= 0 && indexValue < static_cast<int>( selectedEnsembles.size() ) )
|
||||
{
|
||||
auto ensembleCase = selectedEnsembles[static_cast<int>( indexValue )];
|
||||
curveSet->setSummaryEnsemble( ensembleCase );
|
||||
}
|
||||
}
|
||||
|
||||
// Replace placeholders with object names from selection
|
||||
auto adr = curveSet->curveAddress();
|
||||
auto curveAdrY = adr.summaryAddressY();
|
||||
setPlaceholderWellName( &curveAdrY, wellNames );
|
||||
setPlaceholderGroupName( &curveAdrY, groupNames );
|
||||
setPlaceholderRegion( &curveAdrY, regions );
|
||||
auto curveAdrX = adr.summaryAddressX();
|
||||
setPlaceholderWellName( &curveAdrX, wellNames );
|
||||
setPlaceholderGroupName( &curveAdrX, groupNames );
|
||||
setPlaceholderRegion( &curveAdrX, regions );
|
||||
curveSet->setCurveAddress( RiaSummaryCurveAddress( curveAdrX, curveAdrY ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RicSummaryPlotTemplateTools::htmlTextFromPlotAndSelection( const RimSummaryPlot* templatePlot,
|
||||
const std::set<RifEclipseSummaryAddress>& selectedSummaryAddresses,
|
||||
const std::vector<caf::PdmObject*>& selectedSources )
|
||||
{
|
||||
QString text;
|
||||
|
||||
RiaSummaryAddressAnalyzer selectionAnalyzer;
|
||||
|
||||
selectionAnalyzer.appendAddresses( selectedSummaryAddresses );
|
||||
|
||||
if ( templatePlot )
|
||||
{
|
||||
std::set<QString> templateSources;
|
||||
RiaSummaryAddressAnalyzer templateAnalyzer;
|
||||
|
||||
{
|
||||
std::set<RifEclipseSummaryAddress> templateAddresses;
|
||||
|
||||
for ( const auto& curve : templatePlot->summaryCurves() )
|
||||
{
|
||||
auto adr = curve->summaryAddressY();
|
||||
templateAddresses.insert( adr );
|
||||
|
||||
auto fieldHandle = curve->findField( "SummaryCase" );
|
||||
if ( fieldHandle )
|
||||
{
|
||||
auto test = fieldHandle->xmlCapability()->referenceString();
|
||||
templateSources.insert( test );
|
||||
}
|
||||
}
|
||||
|
||||
templateAnalyzer.appendAddresses( templateAddresses );
|
||||
}
|
||||
|
||||
text += "<b> Requirements </b><br>";
|
||||
|
||||
if ( !templateSources.empty() )
|
||||
{
|
||||
QString itemText = "Source Cases";
|
||||
size_t requiredCount = templateSources.size();
|
||||
size_t selectedCount = selectedSources.size();
|
||||
text += htmlTextFromCount( itemText, requiredCount, selectedCount );
|
||||
}
|
||||
|
||||
if ( !templateAnalyzer.wellNames().empty() )
|
||||
{
|
||||
QString itemText = "Wells";
|
||||
size_t requiredCount = templateAnalyzer.wellNames().size();
|
||||
size_t selectedCount = selectionAnalyzer.wellNames().size();
|
||||
text += htmlTextFromCount( itemText, requiredCount, selectedCount );
|
||||
}
|
||||
|
||||
if ( !templateAnalyzer.groupNames().empty() )
|
||||
{
|
||||
QString itemText = "Groups";
|
||||
size_t requiredCount = templateAnalyzer.groupNames().size();
|
||||
size_t selectedCount = selectionAnalyzer.groupNames().size();
|
||||
text += htmlTextFromCount( itemText, requiredCount, selectedCount );
|
||||
}
|
||||
|
||||
if ( !templateAnalyzer.regionNumbers().empty() )
|
||||
{
|
||||
QString itemText = "Regions";
|
||||
size_t requiredCount = templateAnalyzer.regionNumbers().size();
|
||||
size_t selectedCount = selectionAnalyzer.regionNumbers().size();
|
||||
text += htmlTextFromCount( itemText, requiredCount, selectedCount );
|
||||
}
|
||||
}
|
||||
|
||||
return text;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RicSummaryPlotTemplateTools::htmlTextFromCount( const QString& itemText, size_t requiredItemCount, size_t selectionCount )
|
||||
{
|
||||
QString text;
|
||||
|
||||
QString colorString = "green";
|
||||
|
||||
if ( selectionCount < requiredItemCount )
|
||||
colorString = "red";
|
||||
else if ( selectionCount > requiredItemCount )
|
||||
colorString = "orange";
|
||||
|
||||
text += QString( "<b><font color='%1'>" ).arg( colorString );
|
||||
text += QString( "%1 : %2 selected (%3 required)\n" ).arg( itemText ).arg( selectionCount ).arg( requiredItemCount );
|
||||
text += "</font></b>";
|
||||
|
||||
text += "<br>";
|
||||
|
||||
return text;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RicSummaryPlotTemplateTools::selectPlotTemplatePath()
|
||||
{
|
||||
RiuPlotMainWindow* plotwindow = RiaGuiApplication::instance()->mainPlotWindow();
|
||||
RicSelectPlotTemplateUi ui;
|
||||
|
||||
caf::PdmUiPropertyViewDialog propertyDialog( plotwindow, &ui, "Select Plot Template", "" );
|
||||
propertyDialog.resize( QSize( 400, 600 ) );
|
||||
|
||||
if ( propertyDialog.exec() == QDialog::Accepted && !ui.selectedPlotTemplates().empty() )
|
||||
{
|
||||
QString fileName = ui.selectedPlotTemplates().front()->absoluteFilePath();
|
||||
|
||||
RiaPreferences::current()->setLastUsedPlotTemplatePath( fileName );
|
||||
RiaPreferences::current()->writePreferencesToApplicationStore();
|
||||
|
||||
return fileName;
|
||||
}
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<QString> RicSummaryPlotTemplateTools::selectDefaultPlotTemplates( std::vector<QString> currentSelection )
|
||||
{
|
||||
RiuPlotMainWindow* plotwindow = RiaGuiApplication::instance()->mainPlotWindow();
|
||||
RicSelectPlotTemplateUi ui;
|
||||
ui.setMultiSelectMode( true );
|
||||
ui.setInitialSelection( currentSelection );
|
||||
|
||||
caf::PdmUiPropertyViewDialog propertyDialog( plotwindow, &ui, "Select Default Plot Templates", "" );
|
||||
propertyDialog.resize( QSize( 500, 600 ) );
|
||||
|
||||
std::vector<QString> selection;
|
||||
|
||||
if ( propertyDialog.exec() == QDialog::Accepted && !ui.selectedPlotTemplates().empty() )
|
||||
{
|
||||
for ( auto item : ui.selectedPlotTemplates() )
|
||||
{
|
||||
selection.push_back( item->absoluteFilePath() );
|
||||
}
|
||||
}
|
||||
|
||||
return selection;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RimSummaryCase*> RicSummaryPlotTemplateTools::selectedSummaryCases()
|
||||
{
|
||||
std::vector<RimSummaryCase*> objects;
|
||||
caf::SelectionManager::instance()->objectsByType( &objects );
|
||||
|
||||
return objects;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RimSummaryEnsemble*> RicSummaryPlotTemplateTools::selectedSummaryEnsembles()
|
||||
{
|
||||
std::vector<RimSummaryEnsemble*> objects;
|
||||
caf::SelectionManager::instance()->objectsByType( &objects );
|
||||
|
||||
return objects;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RimSummaryAddressCollection*> RicSummaryPlotTemplateTools::selectedSummaryAddressCollections()
|
||||
{
|
||||
std::vector<RimSummaryAddressCollection*> objects;
|
||||
caf::SelectionManager::instance()->objectsByType( &objects );
|
||||
|
||||
return objects;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RicSummaryPlotTemplateTools::summaryCaseFieldKeyword()
|
||||
{
|
||||
return "SummaryCase";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RicSummaryPlotTemplateTools::summaryCaseXFieldKeyword()
|
||||
{
|
||||
return "SummaryCaseX";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RicSummaryPlotTemplateTools::summaryGroupFieldKeyword()
|
||||
{
|
||||
return "SummaryGroup";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RicSummaryPlotTemplateTools::placeholderTextForSummaryCase()
|
||||
{
|
||||
return "__CASE_NAME__";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RicSummaryPlotTemplateTools::placeholderTextForSummaryCaseX()
|
||||
{
|
||||
return "__CASE_NAME_X__";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RicSummaryPlotTemplateTools::placeholderTextForSummaryGroup()
|
||||
{
|
||||
return "__ENSEMBLE_NAME__";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RicSummaryPlotTemplateTools::placeholderTextForWell()
|
||||
{
|
||||
return "__WELL_NAME__";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RicSummaryPlotTemplateTools::placeholderTextForGroup()
|
||||
{
|
||||
return "__GROUP__";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RifEclipseSummaryAddress RicSummaryPlotTemplateTools::firstAddressByQuantity( const RifEclipseSummaryAddress& sourceAddress,
|
||||
const std::set<RifEclipseSummaryAddress>& allAddresses )
|
||||
{
|
||||
for ( const auto& a : allAddresses )
|
||||
{
|
||||
if ( sourceAddress.vectorName() == a.vectorName() )
|
||||
{
|
||||
return a;
|
||||
}
|
||||
}
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
int RicSummaryPlotTemplateTools::findValueForKeyword( const QString& keyword, const QString& valueString, bool* ok )
|
||||
{
|
||||
// Example string : "CASE_NAME 1"
|
||||
// Will match the string specified by keyword, and return the value captured by the regexp
|
||||
|
||||
QString regexpString = QString( "%1 (\\d++)" ).arg( keyword );
|
||||
QRegularExpression rx( regexpString );
|
||||
|
||||
auto match = rx.match( valueString );
|
||||
if ( match.hasMatch() )
|
||||
{
|
||||
QString integerAsText = match.captured( 1 );
|
||||
|
||||
if ( !integerAsText.isEmpty() )
|
||||
{
|
||||
int integerValue = integerAsText.toInt();
|
||||
|
||||
if ( ok )
|
||||
{
|
||||
*ok = true;
|
||||
}
|
||||
return integerValue;
|
||||
}
|
||||
}
|
||||
|
||||
if ( ok )
|
||||
{
|
||||
*ok = false;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicSummaryPlotTemplateTools::setPlaceholderWellName( RifEclipseSummaryAddress* summaryAddress, const std::vector<QString>& wellNames )
|
||||
{
|
||||
if ( wellNames.empty() ) return;
|
||||
|
||||
auto sourceWellName = QString::fromStdString( summaryAddress->wellName() );
|
||||
bool conversionOk = false;
|
||||
const QString placeholderString = RicSummaryPlotTemplateTools::placeholderTextForWell();
|
||||
|
||||
int indexValue = RicSummaryPlotTemplateTools::findValueForKeyword( placeholderString, sourceWellName, &conversionOk );
|
||||
if ( conversionOk && indexValue >= 0 && indexValue < static_cast<int>( wellNames.size() ) )
|
||||
{
|
||||
summaryAddress->setWellName( wellNames[indexValue].toStdString() );
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicSummaryPlotTemplateTools::setPlaceholderGroupName( RifEclipseSummaryAddress* summaryAddress, const std::vector<QString>& groupNames )
|
||||
{
|
||||
if ( groupNames.empty() ) return;
|
||||
|
||||
auto sourceGroupName = QString::fromStdString( summaryAddress->groupName() );
|
||||
bool conversionOk = false;
|
||||
const QString placeholderString = RicSummaryPlotTemplateTools::placeholderTextForGroup();
|
||||
|
||||
int indexValue = RicSummaryPlotTemplateTools::findValueForKeyword( placeholderString, sourceGroupName, &conversionOk );
|
||||
if ( conversionOk && indexValue >= 0 && indexValue < static_cast<int>( groupNames.size() ) )
|
||||
{
|
||||
summaryAddress->setGroupName( groupNames[indexValue].toStdString() );
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicSummaryPlotTemplateTools::setPlaceholderRegion( RifEclipseSummaryAddress* summaryAddress, const std::vector<QString>& regions )
|
||||
{
|
||||
CAF_ASSERT( summaryAddress );
|
||||
if ( regions.empty() ) return;
|
||||
|
||||
int indexValue = summaryAddress->regionNumber();
|
||||
if ( indexValue < -1 )
|
||||
{
|
||||
indexValue = -( indexValue - 2 );
|
||||
|
||||
bool conversionOk = false;
|
||||
if ( conversionOk && indexValue >= 0 && indexValue < static_cast<int>( regions.size() ) )
|
||||
{
|
||||
summaryAddress->setRegion( regions[indexValue].toInt() );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,99 +0,0 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2019- 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 <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QString>
|
||||
|
||||
#include <set>
|
||||
#include <vector>
|
||||
|
||||
namespace caf
|
||||
{
|
||||
class PdmObject;
|
||||
}
|
||||
|
||||
class RimSummaryPlot;
|
||||
class RimSummaryCase;
|
||||
class RimSummaryEnsemble;
|
||||
class RifEclipseSummaryAddress;
|
||||
class RimSummaryMultiPlot;
|
||||
class RimSummaryAddressCollection;
|
||||
class RimPlotTemplateFileItem;
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
class RicSummaryPlotTemplateTools
|
||||
{
|
||||
public:
|
||||
static RimSummaryMultiPlot* create( const QString& fileName );
|
||||
|
||||
static RimSummaryMultiPlot*
|
||||
create( const QString& fileName, const std::vector<RimSummaryCase*>& cases, const std::vector<RimSummaryEnsemble*>& ensembles );
|
||||
|
||||
static QString selectPlotTemplatePath();
|
||||
static std::vector<QString> selectDefaultPlotTemplates( std::vector<QString> currentSelection );
|
||||
|
||||
static QString summaryCaseFieldKeyword();
|
||||
static QString summaryCaseXFieldKeyword();
|
||||
static QString summaryGroupFieldKeyword();
|
||||
|
||||
static QString placeholderTextForSummaryCase();
|
||||
static QString placeholderTextForSummaryCaseX();
|
||||
static QString placeholderTextForSummaryGroup();
|
||||
static QString placeholderTextForWell();
|
||||
static QString placeholderTextForGroup();
|
||||
|
||||
private:
|
||||
static RimSummaryMultiPlot* createMultiPlotFromTemplateFile( const QString& fileName );
|
||||
|
||||
static std::vector<RimSummaryCase*> selectedSummaryCases();
|
||||
static std::vector<RimSummaryEnsemble*> selectedSummaryEnsembles();
|
||||
static std::vector<RimSummaryAddressCollection*> selectedSummaryAddressCollections();
|
||||
|
||||
static QString htmlTextFromPlotAndSelection( const RimSummaryPlot* templatePlot,
|
||||
|
||||
const std::set<RifEclipseSummaryAddress>& selectedSummaryAddresses,
|
||||
const std::vector<caf::PdmObject*>& selectedSources );
|
||||
|
||||
static QString htmlTextFromCount( const QString& itemText, size_t requiredItemCount, size_t selectionCount );
|
||||
|
||||
static void setValuesForPlaceholders( RimSummaryMultiPlot* summaryMultiPlot,
|
||||
const std::vector<RimSummaryCase*>& selectedSummaryCases,
|
||||
const std::vector<RimSummaryEnsemble*>& selectedEnsembles,
|
||||
const std::vector<QString>& wellNames,
|
||||
const std::vector<QString>& groupNames,
|
||||
const std::vector<QString>& regions );
|
||||
|
||||
static void setValuesForPlaceholders( RimSummaryPlot* summaryPlot,
|
||||
const std::vector<RimSummaryCase*>& selectedSummaryCases,
|
||||
const std::vector<RimSummaryEnsemble*>& selectedEnsembles,
|
||||
const std::vector<QString>& wellNames,
|
||||
const std::vector<QString>& groupNames,
|
||||
const std::vector<QString>& regions );
|
||||
|
||||
static RifEclipseSummaryAddress firstAddressByQuantity( const RifEclipseSummaryAddress& sourceAddress,
|
||||
const std::set<RifEclipseSummaryAddress>& allAddresses );
|
||||
|
||||
static int findValueForKeyword( const QString& keyword, const QString& valueString, bool* ok );
|
||||
|
||||
static void setPlaceholderWellName( RifEclipseSummaryAddress* summaryAddress, const std::vector<QString>& wellNames );
|
||||
static void setPlaceholderGroupName( RifEclipseSummaryAddress* summaryAddress, const std::vector<QString>& groupNames );
|
||||
static void setPlaceholderRegion( RifEclipseSummaryAddress* summaryAddress, const std::vector<QString>& regions );
|
||||
};
|
||||
@@ -24,6 +24,7 @@
|
||||
#include "RiaPreferences.h"
|
||||
#include "RiaTextStringTools.h"
|
||||
#include "Summary/RiaSummaryDefines.h"
|
||||
#include "Summary/RiaSummaryPlotTools.h"
|
||||
#include "Summary/RiaSummaryTools.h"
|
||||
|
||||
#include "RicCreateSummaryCaseCollectionFeature.h"
|
||||
@@ -43,7 +44,6 @@
|
||||
#include "RiuMainWindow.h"
|
||||
#include "RiuPlotMainWindow.h"
|
||||
|
||||
#include "PlotBuilderCommands/RicSummaryPlotBuilder.h"
|
||||
#include "SummaryPlotCommands/RicNewSummaryEnsembleCurveSetFeature.h"
|
||||
|
||||
#include <QAction>
|
||||
@@ -128,7 +128,7 @@ void RicImportEnsembleFeature::importSingleEnsemble( const QStringList&
|
||||
summaryCase->updateAutoShortName();
|
||||
}
|
||||
|
||||
RicSummaryPlotBuilder::createAndAppendDefaultSummaryMultiPlot( {}, { ensemble } );
|
||||
RiaSummaryPlotTools::createAndAppendDefaultSummaryMultiPlot( {}, { ensemble } );
|
||||
}
|
||||
|
||||
std::vector<RimCase*> allCases = RiaApplication::instance()->project()->allGridCases();
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#include "RicImportSummaryCasesFeature.h"
|
||||
|
||||
#include "Summary/RiaSummaryDefines.h"
|
||||
#include "Summary/RiaSummaryPlotTools.h"
|
||||
#include "SummaryPlotCommands/RicNewSummaryCurveFeature.h"
|
||||
|
||||
#include "RiaGuiApplication.h"
|
||||
@@ -43,7 +44,6 @@
|
||||
#include "RiuPlotMainWindow.h"
|
||||
#include "RiuPlotMainWindowTools.h"
|
||||
|
||||
#include "PlotBuilderCommands/RicSummaryPlotBuilder.h"
|
||||
#include "SummaryPlotCommands/RicNewSummaryEnsembleCurveSetFeature.h"
|
||||
#include "SummaryPlotCommands/RicSummaryPlotFeatureImpl.h"
|
||||
|
||||
@@ -83,7 +83,7 @@ void RicImportSummaryCasesFeature::onActionTriggered( bool isChecked )
|
||||
{
|
||||
for ( auto sumcase : cases )
|
||||
{
|
||||
RicSummaryPlotBuilder::createAndAppendDefaultSummaryMultiPlot( { sumcase }, {} );
|
||||
RiaSummaryPlotTools::createAndAppendDefaultSummaryMultiPlot( { sumcase }, {} );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -133,7 +133,7 @@ std::pair<bool, std::vector<RimSummaryCase*>> RicImportSummaryCasesFeature::crea
|
||||
RimSummaryMultiPlot* plotToSelect = nullptr;
|
||||
for ( auto sumCase : cases )
|
||||
{
|
||||
plotToSelect = RicSummaryPlotBuilder::createAndAppendDefaultSummaryMultiPlot( { sumCase }, {} );
|
||||
plotToSelect = RiaSummaryPlotTools::createAndAppendDefaultSummaryMultiPlot( { sumCase }, {} );
|
||||
}
|
||||
|
||||
if ( plotToSelect )
|
||||
|
||||
@@ -18,10 +18,9 @@
|
||||
|
||||
#include "RicCreateCrossPlotFeature.h"
|
||||
|
||||
#include "PlotBuilderCommands/RicSummaryPlotBuilder.h"
|
||||
|
||||
#include "RiaPreferencesSummary.h"
|
||||
#include "Summary/RiaSummaryCurveAddress.h"
|
||||
#include "Summary/RiaSummaryPlotTools.h"
|
||||
|
||||
#include "RifEclipseSummaryAddress.h"
|
||||
|
||||
@@ -112,9 +111,9 @@ void RicCreateCrossPlotFeature::onSubMenuActionTriggered( bool isChecked )
|
||||
auto selectedCases = caf::firstAncestorOfTypeFromSelectedObject<RimSummaryCase>();
|
||||
auto selectedEnsembles = caf::firstAncestorOfTypeFromSelectedObject<RimSummaryEnsemble>();
|
||||
|
||||
auto newPlot = RicSummaryPlotBuilder::createCrossPlot( { curveAddress }, { selectedCases }, { selectedEnsembles } );
|
||||
auto newPlot = RiaSummaryPlotTools::createCrossPlot( { curveAddress }, { selectedCases }, { selectedEnsembles } );
|
||||
|
||||
RicSummaryPlotBuilder::createAndAppendSingleSummaryMultiPlot( newPlot );
|
||||
RiaSummaryPlotTools::createAndAppendSingleSummaryMultiPlot( newPlot );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -18,9 +18,9 @@
|
||||
|
||||
#include "RicNewDefaultSummaryPlotFeature.h"
|
||||
|
||||
#include "Summary/RiaSummaryPlotTools.h"
|
||||
#include "Summary/RiaSummaryTools.h"
|
||||
|
||||
#include "PlotBuilderCommands/RicSummaryPlotBuilder.h"
|
||||
#include "RicEditSummaryPlotFeature.h"
|
||||
#include "RicNewSummaryCurveFeature.h"
|
||||
#include "RicNewSummaryEnsembleCurveSetFeature.h"
|
||||
@@ -85,7 +85,7 @@ RimSummaryPlot* RicNewDefaultSummaryPlotFeature::createFromSummaryCases( const s
|
||||
newPlot->applyDefaultCurveAppearances();
|
||||
newPlot->loadDataAndUpdate();
|
||||
|
||||
RicSummaryPlotBuilder::createAndAppendSingleSummaryMultiPlot( newPlot );
|
||||
RiaSummaryPlotTools::createAndAppendSingleSummaryMultiPlot( newPlot );
|
||||
|
||||
return newPlot;
|
||||
}
|
||||
@@ -131,7 +131,7 @@ void RicNewDefaultSummaryPlotFeature::onActionTriggered( bool isChecked )
|
||||
{
|
||||
RimSummaryPlot* plot = new RimSummaryPlot();
|
||||
plot->enableAutoPlotTitle( true );
|
||||
RicSummaryPlotBuilder::appendPlotsToSummaryMultiPlot( multiPlot, { plot } );
|
||||
RiaSummaryPlotTools::appendPlotsToSummaryMultiPlot( multiPlot, { plot } );
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -19,11 +19,11 @@
|
||||
#include "RicNewGridTimeHistoryCurveFeature.h"
|
||||
|
||||
#include "RiaGuiApplication.h"
|
||||
#include "Summary/RiaSummaryPlotTools.h"
|
||||
#include "Summary/RiaSummaryTools.h"
|
||||
|
||||
#include "RigFemResultAddress.h"
|
||||
|
||||
#include "PlotBuilderCommands/RicSummaryPlotBuilder.h"
|
||||
#include "RicNewSummaryCurveFeature.h"
|
||||
#include "RicSelectSummaryPlotUI.h"
|
||||
#include "RicWellLogTools.h"
|
||||
@@ -117,7 +117,7 @@ RimSummaryPlot* RicNewGridTimeHistoryCurveFeature::userSelectedSummaryPlot()
|
||||
{
|
||||
RimSummaryPlot* plot = new RimSummaryPlot();
|
||||
plot->setUiName( featureUi.newPlotName() );
|
||||
RicSummaryPlotBuilder::createAndAppendSingleSummaryMultiPlot( plot );
|
||||
RiaSummaryPlotTools::createAndAppendSingleSummaryMultiPlot( plot );
|
||||
plot->loadDataAndUpdate();
|
||||
|
||||
summaryPlot = plot;
|
||||
|
||||
+2
-2
@@ -19,6 +19,7 @@
|
||||
#include "RicNewSummaryCrossPlotCurveFeature.h"
|
||||
|
||||
#include "RiaGuiApplication.h"
|
||||
#include "Summary/RiaSummaryPlotTools.h"
|
||||
#include "Summary/RiaSummaryTools.h"
|
||||
|
||||
#include "RimMainPlotCollection.h"
|
||||
@@ -32,7 +33,6 @@
|
||||
#include "RiuPlotMainWindow.h"
|
||||
#include "RiuPlotMainWindowTools.h"
|
||||
|
||||
#include "PlotBuilderCommands/RicSummaryPlotBuilder.h"
|
||||
#include "WellLogCommands/RicWellLogPlotCurveFeatureImpl.h"
|
||||
|
||||
#include "cafSelectionManager.h"
|
||||
@@ -68,7 +68,7 @@ void RicNewSummaryCrossPlotCurveFeature::onActionTriggered( bool isChecked )
|
||||
}
|
||||
|
||||
RiaSummaryCurveAddress addr( RifEclipseSummaryAddress::fieldAddress( "FOPT" ), RifEclipseSummaryAddress::fieldAddress( "FGOR" ) );
|
||||
auto newCurve = RicSummaryPlotBuilder::addNewSummaryCurve( plot, addr, defaultCase );
|
||||
auto newCurve = RiaSummaryPlotTools::addNewSummaryCurve( plot, addr, defaultCase );
|
||||
|
||||
newCurve->setColor( curveColor );
|
||||
newCurve->loadDataAndUpdate( true );
|
||||
|
||||
+2
-2
@@ -22,6 +22,7 @@
|
||||
#include "RiaGuiApplication.h"
|
||||
#include "RiaPreferencesSummary.h"
|
||||
#include "RiaTextStringTools.h"
|
||||
#include "Summary/RiaSummaryPlotTools.h"
|
||||
#include "Summary/RiaSummaryTools.h"
|
||||
|
||||
#include "RimEnsembleCurveFilter.h"
|
||||
@@ -42,7 +43,6 @@
|
||||
|
||||
#include "RiuPlotMainWindow.h"
|
||||
|
||||
#include "PlotBuilderCommands/RicSummaryPlotBuilder.h"
|
||||
#include "WellLogCommands/RicWellLogPlotCurveFeatureImpl.h"
|
||||
|
||||
#include "cafSelectionManager.h"
|
||||
@@ -114,7 +114,7 @@ RimSummaryPlot* RicNewSummaryEnsembleCurveSetFeature::createPlotForCurveSetsAndU
|
||||
|
||||
RimSummaryPlot* plot = new RimSummaryPlot();
|
||||
plot->enableAutoPlotTitle( true );
|
||||
RimSummaryMultiPlot* multiPlot = RicSummaryPlotBuilder::createAndAppendSingleSummaryMultiPlot( plot );
|
||||
RimSummaryMultiPlot* multiPlot = RiaSummaryPlotTools::createAndAppendSingleSummaryMultiPlot( plot );
|
||||
|
||||
RimEnsembleCurveSet* firstCurveSetCreated = nullptr;
|
||||
for ( RimSummaryEnsemble* ensemble : ensembles )
|
||||
|
||||
+2
-2
@@ -19,8 +19,8 @@
|
||||
#include "RicPasteAsciiDataToSummaryPlotFeature.h"
|
||||
|
||||
#include "OperationsUsingObjReferences/RicPasteFeatureImpl.h"
|
||||
#include "PlotBuilderCommands/RicSummaryPlotBuilder.h"
|
||||
#include "RicPasteAsciiDataToSummaryPlotFeatureUi.h"
|
||||
#include "Summary/RiaSummaryPlotTools.h"
|
||||
|
||||
#include "RiaLogging.h"
|
||||
|
||||
@@ -91,7 +91,7 @@ void RicPasteAsciiDataToSummaryPlotFeature::onActionTriggered( bool isChecked )
|
||||
summaryPlot = new RimSummaryPlot();
|
||||
summaryPlot->enableAutoPlotTitle( true );
|
||||
|
||||
RicSummaryPlotBuilder::createAndAppendSingleSummaryMultiPlot( summaryPlot );
|
||||
RiaSummaryPlotTools::createAndAppendSingleSummaryMultiPlot( summaryPlot );
|
||||
}
|
||||
|
||||
caf::PdmSettings::writeFieldsToApplicationStore( &pasteOptions, pasteOptions.contextString() );
|
||||
|
||||
@@ -18,12 +18,12 @@
|
||||
|
||||
#include "RicPasteSummaryMultiPlotFeature.h"
|
||||
|
||||
#include "Summary/RiaSummaryTools.h"
|
||||
|
||||
#include "OperationsUsingObjReferences/RicPasteFeatureImpl.h"
|
||||
#include "PlotBuilderCommands/RicSummaryPlotBuilder.h"
|
||||
|
||||
#include "RimSummaryMultiPlot.h"
|
||||
#include "RimSummaryMultiPlotCollection.h"
|
||||
#include "Summary/RiaSummaryTools.h"
|
||||
|
||||
#include "cafPdmDefaultObjectFactory.h"
|
||||
#include "cafPdmObjectGroup.h"
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
#include "RicPasteSummaryPlotFeature.h"
|
||||
|
||||
#include "OperationsUsingObjReferences/RicPasteFeatureImpl.h"
|
||||
#include "PlotBuilderCommands/RicSummaryPlotBuilder.h"
|
||||
#include "Summary/RiaSummaryPlotTools.h"
|
||||
|
||||
#include "RimMultiPlot.h"
|
||||
#include "RimSummaryPlot.h"
|
||||
@@ -45,8 +45,8 @@ void RicPasteSummaryPlotFeature::copyPlotAndAddToCollection( RimSummaryPlot* sou
|
||||
auto multiPlot = caf::firstAncestorOfTypeFromSelectedObject<RimMultiPlot>();
|
||||
if ( multiPlot )
|
||||
{
|
||||
auto plots = RicSummaryPlotBuilder::duplicatePlots( { sourcePlot } );
|
||||
RicSummaryPlotBuilder::appendPlotsToMultiPlot( multiPlot, plots );
|
||||
auto plots = RiaSummaryPlotTools::duplicatePlots( { sourcePlot } );
|
||||
RiaSummaryPlotTools::appendPlotsToMultiPlot( multiPlot, plots );
|
||||
|
||||
multiPlot->loadDataAndUpdate();
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#include "RiaCurveSetDefinition.h"
|
||||
#include "RiaGuiApplication.h"
|
||||
#include "Summary/RiaSummaryCurveDefinition.h"
|
||||
#include "Summary/RiaSummaryPlotTools.h"
|
||||
|
||||
#include "RiuSummaryCurveDefinitionKeywords.h"
|
||||
|
||||
@@ -50,8 +51,6 @@
|
||||
#include "RiuSummaryVectorSelectionUi.h"
|
||||
#include "RiuTools.h"
|
||||
|
||||
#include "PlotBuilderCommands/RicSummaryPlotBuilder.h"
|
||||
|
||||
#include "cafPdmUiComboBoxEditor.h"
|
||||
#include "cafPdmUiPushButtonEditor.h"
|
||||
|
||||
@@ -843,7 +842,7 @@ void RicSummaryPlotEditorUi::createNewPlot()
|
||||
if ( !m_plotContainer )
|
||||
{
|
||||
std::vector<RimSummaryPlot*> plots;
|
||||
m_plotContainer = RicSummaryPlotBuilder::createAndAppendSummaryMultiPlot( plots );
|
||||
m_plotContainer = RiaSummaryPlotTools::createAndAppendSummaryMultiPlot( plots );
|
||||
}
|
||||
|
||||
if ( m_plotContainer )
|
||||
|
||||
@@ -27,9 +27,9 @@
|
||||
#include "RiaLogging.h"
|
||||
#include "RiaPreferencesSummary.h"
|
||||
#include "RiaTextStringTools.h"
|
||||
#include "Summary/RiaSummaryPlotTools.h"
|
||||
#include "Summary/RiaSummaryStringTools.h"
|
||||
|
||||
#include "PlotBuilderCommands/RicSummaryPlotBuilder.h"
|
||||
#include "RicCreateSummaryCaseCollectionFeature.h"
|
||||
#include "RicImportGeneralDataFeature.h"
|
||||
#include "RicImportSummaryCasesFeature.h"
|
||||
@@ -342,7 +342,7 @@ void RicSummaryPlotFeatureImpl::createSummaryPlotsFromArgumentLine( const QStrin
|
||||
newPlot->setNormalizationEnabled( isNormalizedY );
|
||||
newPlot->loadDataAndUpdate();
|
||||
|
||||
RicSummaryPlotBuilder::createAndAppendSingleSummaryMultiPlot( newPlot );
|
||||
RiaSummaryPlotTools::createAndAppendSingleSummaryMultiPlot( newPlot );
|
||||
}
|
||||
else // Multiple plots, one for each separate summary address, put them all in a summary multiplot
|
||||
{
|
||||
@@ -362,7 +362,7 @@ void RicSummaryPlotFeatureImpl::createSummaryPlotsFromArgumentLine( const QStrin
|
||||
summaryPlot->loadDataAndUpdate();
|
||||
}
|
||||
|
||||
RicSummaryPlotBuilder::createAndAppendSummaryMultiPlot( summaryPlots );
|
||||
RiaSummaryPlotTools::createAndAppendSummaryMultiPlot( summaryPlots );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -430,7 +430,7 @@ void RicSummaryPlotFeatureImpl::createSummaryPlotsFromArgumentLine( const QStrin
|
||||
newPlot->loadDataAndUpdate();
|
||||
lastPlotCreated = newPlot;
|
||||
|
||||
RicSummaryPlotBuilder::createAndAppendSingleSummaryMultiPlot( newPlot );
|
||||
RiaSummaryPlotTools::createAndAppendSingleSummaryMultiPlot( newPlot );
|
||||
}
|
||||
}
|
||||
else // Multiplot
|
||||
@@ -484,7 +484,7 @@ void RicSummaryPlotFeatureImpl::createSummaryPlotsFromArgumentLine( const QStrin
|
||||
newPlot->loadDataAndUpdate();
|
||||
lastPlotCreated = newPlot;
|
||||
|
||||
RicSummaryPlotBuilder::createAndAppendSingleSummaryMultiPlot( newPlot );
|
||||
RiaSummaryPlotTools::createAndAppendSingleSummaryMultiPlot( newPlot );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,8 +20,6 @@
|
||||
|
||||
#include "RiaDefines.h"
|
||||
|
||||
#include "PlotBuilderCommands/RicSummaryPlotBuilder.h"
|
||||
|
||||
#include "Cloud/RimCloudDataSourceCollection.h"
|
||||
#include "Sumo/RimSummarySumoDataSource.h"
|
||||
|
||||
|
||||
Reference in new issue
Block a user