mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Deprecate single summary plots and plot collections. (#8777)
* Deprecate single summary plots and plot collections. Replace functionality using summary multi plots. Clean up some code. Fix crash when trying to normalize an empty curve
This commit is contained in:
@@ -20,10 +20,6 @@
|
||||
|
||||
#include "cafCmdFeature.h"
|
||||
|
||||
class RimSummaryPlotCollection;
|
||||
class RimSummaryCase;
|
||||
class RimSummaryPlot;
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
|
||||
#include "RicPasteSummaryPlotFeature.h"
|
||||
|
||||
#include "RimSummaryMultiPlot.h"
|
||||
#include "RimSummaryPlot.h"
|
||||
#include "RimSummaryPlotCollection.h"
|
||||
|
||||
#include "cafSelectionManagerTools.h"
|
||||
#include "cvfAssert.h"
|
||||
@@ -37,15 +37,15 @@ CAF_CMD_SOURCE_INIT( RicDuplicateSummaryPlotFeature, "RicDuplicateSummaryPlotFea
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicDuplicateSummaryPlotFeature::isCommandEnabled()
|
||||
{
|
||||
RimSummaryPlotCollection* sumPlotColl = nullptr;
|
||||
RimSummaryMultiPlot* multiPlot = nullptr;
|
||||
|
||||
caf::PdmObject* selObj = dynamic_cast<caf::PdmObject*>( caf::SelectionManager::instance()->selectedItem() );
|
||||
if ( selObj )
|
||||
{
|
||||
sumPlotColl = RiaSummaryTools::parentSummaryPlotCollection( selObj );
|
||||
multiPlot = RiaSummaryTools::parentSummaryMultiPlot( selObj );
|
||||
}
|
||||
|
||||
if ( sumPlotColl ) return true;
|
||||
if ( multiPlot ) return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -20,10 +20,6 @@
|
||||
|
||||
#include "cafCmdFeature.h"
|
||||
|
||||
class RimSummaryPlotCollection;
|
||||
class RimSummaryCase;
|
||||
class RimSummaryPlot;
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
|
||||
@@ -20,10 +20,6 @@
|
||||
|
||||
#include "cafCmdFeature.h"
|
||||
|
||||
class RimSummaryPlot;
|
||||
class RimSummaryPlotCollection;
|
||||
class RimSummaryCase;
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
|
||||
@@ -39,7 +39,6 @@
|
||||
#include "RimSummaryCaseMainCollection.h"
|
||||
#include "RimSummaryMultiPlot.h"
|
||||
#include "RimSummaryPlot.h"
|
||||
#include "RimSummaryPlotCollection.h"
|
||||
|
||||
#include "RiuPlotMainWindow.h"
|
||||
#include "RiuPlotMainWindowTools.h"
|
||||
@@ -68,48 +67,15 @@ void extractPlotObjectsFromSelection( std::vector<RimSummaryCase*>* se
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
RimSummaryPlotCollection* sumPlotColl =
|
||||
caf::SelectionManager::instance()->selectedItemAncestorOfType<RimSummaryPlotCollection>();
|
||||
|
||||
if ( sumPlotColl )
|
||||
{
|
||||
RimSummaryCase* firstIndividualSummaryCase = nullptr;
|
||||
RimSummaryCaseCollection* firstEnsemble = nullptr;
|
||||
|
||||
auto sumCaseVector = RimProject::current()->allSummaryCases();
|
||||
for ( RimSummaryCase* summaryCase : sumCaseVector )
|
||||
{
|
||||
RimSummaryCaseCollection* parentEnsemble = nullptr;
|
||||
summaryCase->firstAncestorOrThisOfType( parentEnsemble );
|
||||
if ( !parentEnsemble && !firstIndividualSummaryCase )
|
||||
{
|
||||
firstIndividualSummaryCase = summaryCase;
|
||||
break;
|
||||
}
|
||||
else if ( parentEnsemble && !firstEnsemble )
|
||||
{
|
||||
firstEnsemble = parentEnsemble;
|
||||
}
|
||||
}
|
||||
if ( firstIndividualSummaryCase )
|
||||
{
|
||||
selectedIndividualSummaryCases->push_back( firstIndividualSummaryCase );
|
||||
}
|
||||
else if ( firstEnsemble )
|
||||
{
|
||||
selectedEnsembles->push_back( firstEnsemble );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimSummaryPlot* RicNewDefaultSummaryPlotFeature::createFromSummaryCases( RimSummaryPlotCollection* plotCollection,
|
||||
const std::vector<RimSummaryCase*>& summaryCases )
|
||||
RimSummaryPlot* RicNewDefaultSummaryPlotFeature::createFromSummaryCases( const std::vector<RimSummaryCase*>& summaryCases )
|
||||
{
|
||||
RimSummaryPlot* newPlot = plotCollection->createSummaryPlotWithAutoTitle();
|
||||
RimSummaryPlot* newPlot = new RimSummaryPlot();
|
||||
newPlot->enableAutoPlotTitle( true );
|
||||
|
||||
for ( RimSummaryCase* sumCase : summaryCases )
|
||||
{
|
||||
@@ -119,10 +85,8 @@ RimSummaryPlot* RicNewDefaultSummaryPlotFeature::createFromSummaryCases( RimSumm
|
||||
newPlot->applyDefaultCurveAppearances();
|
||||
newPlot->loadDataAndUpdate();
|
||||
|
||||
plotCollection->updateConnectedEditors();
|
||||
RicSummaryPlotBuilder::createAndAppendSingleSummaryMultiPlot( newPlot );
|
||||
|
||||
RiuPlotMainWindowTools::setExpanded( newPlot );
|
||||
RiuPlotMainWindowTools::selectAsCurrentItem( newPlot );
|
||||
return newPlot;
|
||||
}
|
||||
|
||||
@@ -154,6 +118,8 @@ bool RicNewDefaultSummaryPlotFeature::isCommandEnabled()
|
||||
if ( customObjFuncCollection || curveFilter ) return false;
|
||||
|
||||
return !( selectedIndividualSummaryCases.empty() && selectedEnsembles.empty() );
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -177,8 +143,7 @@ void RicNewDefaultSummaryPlotFeature::onActionTriggered( bool isChecked )
|
||||
|
||||
if ( !selectedIndividualSummaryCases.empty() )
|
||||
{
|
||||
RimSummaryPlotCollection* sumPlotColl = RimProject::current()->mainPlotCollection()->summaryPlotCollection();
|
||||
createFromSummaryCases( sumPlotColl, selectedIndividualSummaryCases );
|
||||
createFromSummaryCases( selectedIndividualSummaryCases );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
|
||||
#include "cafCmdFeature.h"
|
||||
|
||||
class RimSummaryPlotCollection;
|
||||
class RimSummaryCase;
|
||||
class RimSummaryPlot;
|
||||
|
||||
@@ -34,8 +33,7 @@ class RicNewDefaultSummaryPlotFeature : public caf::CmdFeature
|
||||
CAF_CMD_HEADER_INIT;
|
||||
|
||||
public:
|
||||
static RimSummaryPlot* createFromSummaryCases( RimSummaryPlotCollection* plotCollection,
|
||||
const std::vector<RimSummaryCase*>& summaryCases );
|
||||
static RimSummaryPlot* createFromSummaryCases( const std::vector<RimSummaryCase*>& summaryCases );
|
||||
|
||||
protected:
|
||||
bool isCommandEnabled() override;
|
||||
|
||||
@@ -20,10 +20,6 @@
|
||||
|
||||
#include "cafCmdFeature.h"
|
||||
|
||||
class RimSummaryPlotCollection;
|
||||
class RimSummaryCase;
|
||||
class RimSummaryPlot;
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
|
||||
@@ -20,10 +20,6 @@
|
||||
|
||||
#include "cafCmdFeature.h"
|
||||
|
||||
class RimSummaryPlotCollection;
|
||||
class RimSummaryCase;
|
||||
class RimSummaryPlot;
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
|
||||
#include "RigFemResultAddress.h"
|
||||
|
||||
#include "PlotBuilderCommands/RicSummaryPlotBuilder.h"
|
||||
#include "RicNewSummaryCurveFeature.h"
|
||||
#include "RicSelectSummaryPlotUI.h"
|
||||
#include "RicWellLogTools.h"
|
||||
@@ -35,8 +36,9 @@
|
||||
#include "RimGeoMechView.h"
|
||||
#include "RimGridTimeHistoryCurve.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimSummaryMultiPlot.h"
|
||||
#include "RimSummaryMultiPlotCollection.h"
|
||||
#include "RimSummaryPlot.h"
|
||||
#include "RimSummaryPlotCollection.h"
|
||||
|
||||
#include "Riu3dSelectionManager.h"
|
||||
#include "RiuPlotMainWindowTools.h"
|
||||
@@ -86,7 +88,7 @@ RimSummaryPlot* RicNewGridTimeHistoryCurveFeature::userSelectedSummaryPlot()
|
||||
|
||||
const QString lastUsedSummaryPlotKey( "lastUsedSummaryPlotKey" );
|
||||
|
||||
RimSummaryPlotCollection* summaryPlotColl = RiaSummaryTools::summaryPlotCollection();
|
||||
RimSummaryMultiPlotCollection* summaryPlotColl = RiaSummaryTools::summaryMultiPlotCollection();
|
||||
|
||||
RimSummaryPlot* defaultSelectedPlot = nullptr;
|
||||
{
|
||||
@@ -97,16 +99,6 @@ RimSummaryPlot* RicNewGridTimeHistoryCurveFeature::userSelectedSummaryPlot()
|
||||
{
|
||||
defaultSelectedPlot = lastUsedPlot;
|
||||
}
|
||||
|
||||
if ( !defaultSelectedPlot )
|
||||
{
|
||||
defaultSelectedPlot = dynamic_cast<RimSummaryPlot*>( app->activePlotWindow() );
|
||||
}
|
||||
|
||||
if ( !defaultSelectedPlot && !summaryPlotColl->plots().empty() )
|
||||
{
|
||||
defaultSelectedPlot = summaryPlotColl->plots().front();
|
||||
}
|
||||
}
|
||||
|
||||
RicSelectSummaryPlotUI featureUi;
|
||||
@@ -126,10 +118,9 @@ RimSummaryPlot* RicNewGridTimeHistoryCurveFeature::userSelectedSummaryPlot()
|
||||
RimSummaryPlot* summaryPlot = nullptr;
|
||||
if ( featureUi.isCreateNewPlotChecked() )
|
||||
{
|
||||
RimSummaryPlot* plot = summaryPlotColl->createNamedSummaryPlot( featureUi.newPlotName() );
|
||||
|
||||
summaryPlotColl->updateConnectedEditors();
|
||||
|
||||
RimSummaryPlot* plot = new RimSummaryPlot();
|
||||
plot->setUiName( featureUi.newPlotName() );
|
||||
RicSummaryPlotBuilder::createAndAppendSingleSummaryMultiPlot( plot );
|
||||
plot->loadDataAndUpdate();
|
||||
|
||||
summaryPlot = plot;
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
#include "RimSummaryCrossPlot.h"
|
||||
#include "RimSummaryCrossPlotCollection.h"
|
||||
#include "RimSummaryCurve.h"
|
||||
#include "RimSummaryPlotCollection.h"
|
||||
|
||||
#include "RiuPlotMainWindow.h"
|
||||
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
#include "RimSummaryCurve.h"
|
||||
#include "RimSummaryCurveCollection.h"
|
||||
#include "RimSummaryPlot.h"
|
||||
#include "RimSummaryPlotCollection.h"
|
||||
|
||||
#include "RiuPlotMainWindow.h"
|
||||
|
||||
|
||||
@@ -23,9 +23,6 @@
|
||||
#include <vector>
|
||||
|
||||
class RimSummaryPlot;
|
||||
class RimSummaryCase;
|
||||
class RimSummaryCurve;
|
||||
class RimSummaryPlotCollection;
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
|
||||
@@ -21,9 +21,9 @@
|
||||
#include "RiaColorTables.h"
|
||||
#include "RiaGuiApplication.h"
|
||||
#include "RiaPreferencesSummary.h"
|
||||
#include "RiaSummaryTools.h"
|
||||
#include "RiaTextStringTools.h"
|
||||
|
||||
#include "RiaSummaryTools.h"
|
||||
#include "RimEnsembleCurveFilter.h"
|
||||
#include "RimEnsembleCurveFilterCollection.h"
|
||||
#include "RimEnsembleCurveSet.h"
|
||||
@@ -34,11 +34,13 @@
|
||||
#include "RimProject.h"
|
||||
#include "RimSummaryCaseMainCollection.h"
|
||||
#include "RimSummaryCurve.h"
|
||||
#include "RimSummaryMultiPlot.h"
|
||||
#include "RimSummaryMultiPlotCollection.h"
|
||||
#include "RimSummaryPlot.h"
|
||||
#include "RimSummaryPlotCollection.h"
|
||||
|
||||
#include "RiuPlotMainWindow.h"
|
||||
|
||||
#include "PlotBuilderCommands/RicSummaryPlotBuilder.h"
|
||||
#include "WellLogCommands/RicWellLogPlotCurveFeatureImpl.h"
|
||||
|
||||
#include "cafSelectionManager.h"
|
||||
@@ -109,8 +111,9 @@ RimSummaryPlot*
|
||||
|
||||
if ( prefs->defaultSummaryCurvesTextFilter().isEmpty() ) return nullptr;
|
||||
|
||||
RimSummaryPlotCollection* summaryPlotCollection = proj->mainPlotCollection->summaryPlotCollection();
|
||||
RimSummaryPlot* plot = summaryPlotCollection->createSummaryPlotWithAutoTitle();
|
||||
RimSummaryPlot* plot = new RimSummaryPlot();
|
||||
plot->enableAutoPlotTitle( true );
|
||||
RimSummaryMultiPlot* multiPlot = RicSummaryPlotBuilder::createAndAppendSingleSummaryMultiPlot( plot );
|
||||
|
||||
RimEnsembleCurveSet* firstCurveSetCreated = nullptr;
|
||||
for ( RimSummaryCaseCollection* ensemble : ensembles )
|
||||
@@ -121,7 +124,7 @@ RimSummaryPlot*
|
||||
}
|
||||
|
||||
plot->loadDataAndUpdate();
|
||||
summaryPlotCollection->updateConnectedEditors();
|
||||
multiPlot->updateConnectedEditors();
|
||||
|
||||
RiuPlotMainWindow* mainPlotWindow = app->getOrCreateAndShowMainPlotWindow();
|
||||
if ( mainPlotWindow )
|
||||
|
||||
@@ -35,7 +35,6 @@
|
||||
#include "RimSummaryCaseCollection.h"
|
||||
#include "RimSummaryCaseMainCollection.h"
|
||||
#include "RimSummaryPlot.h"
|
||||
#include "RimSummaryPlotCollection.h"
|
||||
|
||||
#include "RiuPlotMainWindow.h"
|
||||
|
||||
@@ -51,13 +50,13 @@ CAF_CMD_SOURCE_INIT( RicOpenSummaryPlotEditorFeature, "RicOpenSummaryPlotEditorF
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicOpenSummaryPlotEditorFeature::isCommandEnabled()
|
||||
{
|
||||
RimSummaryPlotCollection* sumPlotColl = nullptr;
|
||||
RimSummaryMultiPlot* multiPlot = nullptr;
|
||||
RimCustomObjectiveFunctionCollection* customObjFuncCollection = nullptr;
|
||||
|
||||
caf::PdmObject* selObj = dynamic_cast<caf::PdmObject*>( caf::SelectionManager::instance()->selectedItem() );
|
||||
if ( selObj )
|
||||
{
|
||||
sumPlotColl = RiaSummaryTools::parentSummaryPlotCollection( selObj );
|
||||
multiPlot = RiaSummaryTools::parentSummaryMultiPlot( selObj );
|
||||
selObj->firstAncestorOrThisOfType( customObjFuncCollection );
|
||||
}
|
||||
|
||||
@@ -66,7 +65,7 @@ bool RicOpenSummaryPlotEditorFeature::isCommandEnabled()
|
||||
auto legendConfig = dynamic_cast<RimRegularLegendConfig*>( selObj );
|
||||
|
||||
if ( ensembleFilter || ensembleFilterColl || legendConfig || customObjFuncCollection ) return false;
|
||||
if ( sumPlotColl ) return true;
|
||||
if ( multiPlot ) return true;
|
||||
|
||||
// Multiple case selections
|
||||
std::vector<caf::PdmUiItem*> selectedItems = caf::selectedObjectsByTypeStrict<caf::PdmUiItem*>();
|
||||
|
||||
@@ -19,14 +19,15 @@
|
||||
#include "RicPasteAsciiDataToSummaryPlotFeature.h"
|
||||
|
||||
#include "OperationsUsingObjReferences/RicPasteFeatureImpl.h"
|
||||
#include "PlotBuilderCommands/RicSummaryPlotBuilder.h"
|
||||
#include "RicPasteAsciiDataToSummaryPlotFeatureUi.h"
|
||||
|
||||
#include "RiaLogging.h"
|
||||
|
||||
#include "RimAsciiDataCurve.h"
|
||||
#include "RimSummaryCurveAppearanceCalculator.h"
|
||||
#include "RimSummaryMultiPlot.h"
|
||||
#include "RimSummaryPlot.h"
|
||||
#include "RimSummaryPlotCollection.h"
|
||||
|
||||
#include "cafPdmDefaultObjectFactory.h"
|
||||
#include "cafPdmDocument.h"
|
||||
@@ -55,9 +56,9 @@ bool RicPasteAsciiDataToSummaryPlotFeature::isCommandEnabled()
|
||||
|
||||
if ( !destinationObject ) return false;
|
||||
|
||||
RimSummaryPlotCollection* summaryPlotCollection = nullptr;
|
||||
destinationObject->firstAncestorOrThisOfType( summaryPlotCollection );
|
||||
if ( !summaryPlotCollection )
|
||||
RimSummaryMultiPlot* multiPlot = nullptr;
|
||||
destinationObject->firstAncestorOrThisOfType( multiPlot );
|
||||
if ( !multiPlot )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -79,7 +80,7 @@ void RicPasteAsciiDataToSummaryPlotFeature::onActionTriggered( bool isChecked )
|
||||
|
||||
RicPasteAsciiDataToSummaryPlotFeatureUi pasteOptions;
|
||||
caf::PdmSettings::readFieldsFromApplicationStore( &pasteOptions, pasteOptions.contextString() );
|
||||
if ( !summaryPlot ) pasteOptions.createNewPlot();
|
||||
if ( !summaryPlot ) pasteOptions.setCreateNewPlot();
|
||||
pasteOptions.setUiModePasteText( text );
|
||||
|
||||
caf::PdmUiPropertyViewDialog propertyDialog( nullptr, &pasteOptions, "Set Paste Options", "" );
|
||||
@@ -91,14 +92,10 @@ void RicPasteAsciiDataToSummaryPlotFeature::onActionTriggered( bool isChecked )
|
||||
{
|
||||
if ( !summaryPlot )
|
||||
{
|
||||
RimSummaryPlotCollection* summaryPlotCollection = nullptr;
|
||||
destinationObject->firstAncestorOrThisOfType( summaryPlotCollection );
|
||||
if ( !summaryPlotCollection )
|
||||
{
|
||||
return;
|
||||
}
|
||||
summaryPlot = createSummaryPlotAndAddToPlotCollection( summaryPlotCollection );
|
||||
summaryPlotCollection->updateConnectedEditors();
|
||||
summaryPlot = new RimSummaryPlot();
|
||||
summaryPlot->enableAutoPlotTitle( true );
|
||||
|
||||
RicSummaryPlotBuilder::createAndAppendSingleSummaryMultiPlot( summaryPlot );
|
||||
}
|
||||
|
||||
caf::PdmSettings::writeFieldsToApplicationStore( &pasteOptions, pasteOptions.contextString() );
|
||||
@@ -249,14 +246,3 @@ RicPasteAsciiDataToSummaryPlotFeature::CurveType
|
||||
}
|
||||
return CURVE_UNKNOWN;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimSummaryPlot*
|
||||
RicPasteAsciiDataToSummaryPlotFeature::createSummaryPlotAndAddToPlotCollection( RimSummaryPlotCollection* plotCollection )
|
||||
{
|
||||
QString name = QString( "Summary Plot %1" ).arg( plotCollection->plots().size() + 1 );
|
||||
|
||||
return plotCollection->createNamedSummaryPlot( name );
|
||||
}
|
||||
|
||||
@@ -26,7 +26,6 @@
|
||||
class RimSummaryCurve;
|
||||
class RimAsciiDataCurve;
|
||||
class RicPasteAsciiDataToSummaryPlotFeatureUi;
|
||||
class RimSummaryPlotCollection;
|
||||
class RimSummaryPlot;
|
||||
|
||||
//==================================================================================================
|
||||
@@ -58,6 +57,4 @@ private:
|
||||
const RicPasteAsciiDataToSummaryPlotFeatureUi& settings );
|
||||
|
||||
static CurveType guessCurveType( const QString& curveName );
|
||||
|
||||
static RimSummaryPlot* createSummaryPlotAndAddToPlotCollection( RimSummaryPlotCollection* plotCollection );
|
||||
};
|
||||
|
||||
@@ -316,7 +316,7 @@ const AsciiDataParseOptions RicPasteAsciiDataToSummaryPlotFeatureUi::parseOption
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicPasteAsciiDataToSummaryPlotFeatureUi::createNewPlot()
|
||||
void RicPasteAsciiDataToSummaryPlotFeatureUi::setCreateNewPlot()
|
||||
{
|
||||
m_createNewPlot = true;
|
||||
}
|
||||
@@ -558,4 +558,4 @@ void RicPasteAsciiDataToSummaryPlotFeatureUi::updatePreviewTextAndDateFormat()
|
||||
QString RicPasteAsciiDataToSummaryPlotFeatureUi::contextString() const
|
||||
{
|
||||
return QString( "AsciiDataToSummarySettings" );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -129,7 +129,7 @@ public:
|
||||
|
||||
UiMode uiModeImport() const;
|
||||
const AsciiDataParseOptions parseOptions() const;
|
||||
void createNewPlot();
|
||||
void setCreateNewPlot();
|
||||
|
||||
QString contextString() const;
|
||||
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
|
||||
#include "RimMultiPlot.h"
|
||||
#include "RimSummaryPlot.h"
|
||||
#include "RimSummaryPlotCollection.h"
|
||||
|
||||
#include "RiuPlotMainWindowTools.h"
|
||||
|
||||
@@ -56,27 +55,6 @@ void RicPasteSummaryPlotFeature::copyPlotAndAddToCollection( RimSummaryPlot* sou
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
RimSummaryPlotCollection* plotColl = caf::firstAncestorOfTypeFromSelectedObject<RimSummaryPlotCollection*>();
|
||||
if ( plotColl )
|
||||
{
|
||||
RimSummaryPlot* newSummaryPlot = dynamic_cast<RimSummaryPlot*>(
|
||||
sourcePlot->xmlCapability()->copyByXmlSerialization( caf::PdmDefaultObjectFactory::instance() ) );
|
||||
CVF_ASSERT( newSummaryPlot );
|
||||
|
||||
plotColl->addPlot( newSummaryPlot );
|
||||
|
||||
// Resolve references after object has been inserted into the data model
|
||||
newSummaryPlot->resolveReferencesRecursively();
|
||||
newSummaryPlot->initAfterReadRecursively();
|
||||
|
||||
QString nameOfCopy = QString( "Copy of " ) + newSummaryPlot->description();
|
||||
newSummaryPlot->setDescription( nameOfCopy );
|
||||
|
||||
plotColl->updateConnectedEditors();
|
||||
|
||||
newSummaryPlot->loadDataAndUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -90,14 +68,7 @@ bool RicPasteSummaryPlotFeature::isCommandEnabled()
|
||||
if ( !destinationObject ) return false;
|
||||
|
||||
auto multiPlot = caf::firstAncestorOfTypeFromSelectedObject<RimMultiPlot*>();
|
||||
if ( multiPlot ) return true;
|
||||
|
||||
RimSummaryPlotCollection* plotColl = nullptr;
|
||||
destinationObject->firstAncestorOrThisOfType( plotColl );
|
||||
if ( !plotColl )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if ( !multiPlot ) return false;
|
||||
|
||||
return RicPasteSummaryPlotFeature::summaryPlots().size() > 0;
|
||||
}
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
#include "RimEclipseView.h"
|
||||
#include "RimMainPlotCollection.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimSummaryMultiPlotCollection.h"
|
||||
#include "RimSummaryPlot.h"
|
||||
#include "RimSummaryPlotCollection.h"
|
||||
|
||||
CAF_PDM_SOURCE_INIT( RicSelectSummaryPlotUI, "RicSelectSummaryPlotUI" );
|
||||
|
||||
@@ -91,7 +91,7 @@ QList<caf::PdmOptionItemInfo>
|
||||
|
||||
if ( fieldNeedingOptions == &m_selectedSummaryPlot )
|
||||
{
|
||||
RimSummaryPlotCollection* summaryPlotColl = RiaSummaryTools::summaryPlotCollection();
|
||||
RimSummaryMultiPlotCollection* summaryPlotColl = RiaSummaryTools::summaryMultiPlotCollection();
|
||||
|
||||
summaryPlotColl->summaryPlotItemInfos( &options );
|
||||
}
|
||||
@@ -104,7 +104,7 @@ QList<caf::PdmOptionItemInfo>
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicSelectSummaryPlotUI::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering )
|
||||
{
|
||||
if ( RiaSummaryTools::summaryPlotCollection()->plots().empty() )
|
||||
if ( RiaSummaryTools::summaryMultiPlotCollection()->multiPlots().empty() )
|
||||
{
|
||||
m_createNewPlot = true;
|
||||
}
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
#include "cafPdmPtrField.h"
|
||||
|
||||
class RimSummaryPlot;
|
||||
class RimSummaryPlotCollection;
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
#include "RiaGuiApplication.h"
|
||||
#include "RiaSummaryCurveDefinition.h"
|
||||
|
||||
#include "RicSelectSummaryPlotUI.h"
|
||||
#include "RiuSummaryCurveDefinitionKeywords.h"
|
||||
|
||||
#include "RimDerivedEnsembleCaseCollection.h"
|
||||
@@ -44,7 +43,6 @@
|
||||
#include "RimSummaryCurveCollection.h"
|
||||
#include "RimSummaryMultiPlot.h"
|
||||
#include "RimSummaryPlot.h"
|
||||
#include "RimSummaryPlotCollection.h"
|
||||
|
||||
#include "RiuPlotMainWindow.h"
|
||||
#include "RiuPlotMainWindowTools.h"
|
||||
@@ -276,16 +274,6 @@ QList<caf::PdmOptionItemInfo>
|
||||
{
|
||||
m_plotContainer->summaryPlotItemInfos( &options );
|
||||
}
|
||||
else
|
||||
{
|
||||
RimProject* proj = RimProject::current();
|
||||
|
||||
RimSummaryPlotCollection* summaryPlotColl = proj->mainPlotCollection()->summaryPlotCollection();
|
||||
if ( summaryPlotColl )
|
||||
{
|
||||
summaryPlotColl->summaryPlotItemInfos( &options );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return options;
|
||||
@@ -853,8 +841,6 @@ void RicSummaryPlotEditorUi::createNewPlot()
|
||||
|
||||
RimSummaryPlot* newSummaryPlot = nullptr;
|
||||
|
||||
RimSummaryPlotCollection* summaryPlotColl = proj->mainPlotCollection()->summaryPlotCollection();
|
||||
|
||||
if ( m_plotContainer )
|
||||
{
|
||||
newSummaryPlot = new RimSummaryPlot();
|
||||
@@ -862,10 +848,6 @@ void RicSummaryPlotEditorUi::createNewPlot()
|
||||
newSummaryPlot->enableAutoPlotTitle( true );
|
||||
m_plotContainer->addPlot( newSummaryPlot );
|
||||
}
|
||||
else if ( summaryPlotColl )
|
||||
{
|
||||
newSummaryPlot = summaryPlotColl->createSummaryPlotWithAutoTitle();
|
||||
}
|
||||
|
||||
if ( newSummaryPlot )
|
||||
{
|
||||
@@ -875,10 +857,6 @@ void RicSummaryPlotEditorUi::createNewPlot()
|
||||
{
|
||||
m_plotContainer->updateConnectedEditors();
|
||||
}
|
||||
else if ( summaryPlotColl )
|
||||
{
|
||||
summaryPlotColl->updateConnectedEditors();
|
||||
}
|
||||
|
||||
m_targetPlot = newSummaryPlot;
|
||||
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
#include "RiaSummaryStringTools.h"
|
||||
#include "RiaTextStringTools.h"
|
||||
|
||||
#include "PlotBuilderCommands/RicSummaryPlotBuilder.h"
|
||||
#include "RicCreateSummaryCaseCollectionFeature.h"
|
||||
#include "RicImportGeneralDataFeature.h"
|
||||
#include "RicImportSummaryCasesFeature.h"
|
||||
@@ -53,7 +54,6 @@
|
||||
#include "RimSummaryCurve.h"
|
||||
#include "RimSummaryMultiPlotCollection.h"
|
||||
#include "RimSummaryPlot.h"
|
||||
#include "RimSummaryPlotCollection.h"
|
||||
|
||||
#include "RiuMainWindow.h"
|
||||
#include "RiuPlotMainWindow.h"
|
||||
@@ -297,8 +297,6 @@ void RicSummaryPlotFeatureImpl::createSummaryPlotsFromArgumentLine( const QStrin
|
||||
|
||||
RimSummaryPlot* lastPlotCreated = nullptr;
|
||||
|
||||
RimSummaryPlotCollection* sumPlotColl = RimProject::current()->mainPlotCollection()->summaryPlotCollection();
|
||||
|
||||
RiaSummaryStringTools::splitAddressFiltersInGridAndSummary( summaryCasesToUse[0],
|
||||
allCurveAddressFilters,
|
||||
&summaryAddressFilters,
|
||||
@@ -318,8 +316,7 @@ void RicSummaryPlotFeatureImpl::createSummaryPlotsFromArgumentLine( const QStrin
|
||||
RimSummaryPlot* newPlot = nullptr;
|
||||
if ( ensemble )
|
||||
{
|
||||
newPlot = createSummaryPlotForEnsemble( sumPlotColl,
|
||||
summaryCasesToUse,
|
||||
newPlot = createSummaryPlotForEnsemble( summaryCasesToUse,
|
||||
ensemble,
|
||||
summaryAddressFilters,
|
||||
addHistoryCurves,
|
||||
@@ -328,8 +325,7 @@ void RicSummaryPlotFeatureImpl::createSummaryPlotsFromArgumentLine( const QStrin
|
||||
}
|
||||
else
|
||||
{
|
||||
newPlot =
|
||||
createSummaryPlotForCases( sumPlotColl, summaryCasesToUse, summaryAddressFilters, addHistoryCurves );
|
||||
newPlot = createSummaryPlotForCases( summaryCasesToUse, summaryAddressFilters, addHistoryCurves );
|
||||
}
|
||||
|
||||
lastPlotCreated = newPlot;
|
||||
@@ -337,12 +333,13 @@ void RicSummaryPlotFeatureImpl::createSummaryPlotsFromArgumentLine( const QStrin
|
||||
newPlot->setLegendsVisible( !hideLegend );
|
||||
newPlot->setNormalizationEnabled( isNormalizedY );
|
||||
newPlot->loadDataAndUpdate();
|
||||
|
||||
RicSummaryPlotBuilder::createAndAppendSingleSummaryMultiPlot( newPlot );
|
||||
}
|
||||
else // Multiplot, one for each separate summary address
|
||||
else // Multiple plots, one for each separate summary address, put them all in a summary multiplot
|
||||
{
|
||||
std::vector<RimSummaryPlot*> summaryPlots =
|
||||
createMultipleSummaryPlotsFromAddresses( sumPlotColl,
|
||||
summaryCasesToUse,
|
||||
createMultipleSummaryPlotsFromAddresses( summaryCasesToUse,
|
||||
ensemble,
|
||||
summaryAddressFilters,
|
||||
addHistoryCurves,
|
||||
@@ -357,6 +354,8 @@ void RicSummaryPlotFeatureImpl::createSummaryPlotsFromArgumentLine( const QStrin
|
||||
summaryPlot->setNormalizationEnabled( isNormalizedY );
|
||||
summaryPlot->loadDataAndUpdate();
|
||||
}
|
||||
|
||||
RicSummaryPlotBuilder::createAndAppendSummaryMultiPlot( summaryPlots );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -412,7 +411,9 @@ void RicSummaryPlotFeatureImpl::createSummaryPlotsFromArgumentLine( const QStrin
|
||||
|
||||
if ( createdCurves.size() )
|
||||
{
|
||||
RimSummaryPlot* newPlot = sumPlotColl->createSummaryPlotWithAutoTitle();
|
||||
RimSummaryPlot* newPlot = new RimSummaryPlot();
|
||||
newPlot->enableAutoPlotTitle( true );
|
||||
|
||||
for ( auto curve : createdCurves )
|
||||
{
|
||||
newPlot->addGridTimeHistoryCurve( curve );
|
||||
@@ -422,6 +423,8 @@ void RicSummaryPlotFeatureImpl::createSummaryPlotsFromArgumentLine( const QStrin
|
||||
newPlot->setNormalizationEnabled( isNormalizedY );
|
||||
newPlot->loadDataAndUpdate();
|
||||
lastPlotCreated = newPlot;
|
||||
|
||||
RicSummaryPlotBuilder::createAndAppendSingleSummaryMultiPlot( newPlot );
|
||||
}
|
||||
}
|
||||
else // Multiplot
|
||||
@@ -465,7 +468,8 @@ void RicSummaryPlotFeatureImpl::createSummaryPlotsFromArgumentLine( const QStrin
|
||||
|
||||
if ( createdCurves.size() )
|
||||
{
|
||||
RimSummaryPlot* newPlot = sumPlotColl->createSummaryPlotWithAutoTitle();
|
||||
RimSummaryPlot* newPlot = new RimSummaryPlot();
|
||||
newPlot->enableAutoPlotTitle( true );
|
||||
for ( auto newCurve : createdCurves )
|
||||
{
|
||||
newPlot->addGridTimeHistoryCurve( newCurve );
|
||||
@@ -474,6 +478,8 @@ void RicSummaryPlotFeatureImpl::createSummaryPlotsFromArgumentLine( const QStrin
|
||||
newPlot->setNormalizationEnabled( isNormalizedY );
|
||||
newPlot->loadDataAndUpdate();
|
||||
lastPlotCreated = newPlot;
|
||||
|
||||
RicSummaryPlotBuilder::createAndAppendSingleSummaryMultiPlot( newPlot );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -482,7 +488,7 @@ void RicSummaryPlotFeatureImpl::createSummaryPlotsFromArgumentLine( const QStrin
|
||||
|
||||
if ( lastPlotCreated )
|
||||
{
|
||||
sumPlotColl->updateConnectedEditors();
|
||||
RimProject::current()->mainPlotCollection()->summaryMultiPlotCollection()->updateConnectedEditors();
|
||||
|
||||
RiuPlotMainWindow* mpw = RiaGuiApplication::instance()->mainPlotWindow();
|
||||
// Needed to avoid unnecessary activation of sub windows (plots)
|
||||
@@ -503,15 +509,15 @@ void RicSummaryPlotFeatureImpl::createSummaryPlotsFromArgumentLine( const QStrin
|
||||
}
|
||||
}
|
||||
|
||||
RimSummaryPlot* RicSummaryPlotFeatureImpl::createSummaryPlotForEnsemble( RimSummaryPlotCollection* sumPlotColl,
|
||||
const std::vector<RimSummaryCase*>& summaryCasesToUse,
|
||||
RimSummaryPlot* RicSummaryPlotFeatureImpl::createSummaryPlotForEnsemble( const std::vector<RimSummaryCase*>& summaryCasesToUse,
|
||||
RimSummaryCaseCollection* ensemble,
|
||||
QStringList summaryAddressFilters,
|
||||
bool addHistoryCurves,
|
||||
EnsembleColoringType ensembleColoringStyle,
|
||||
QString ensembleColoringParameter )
|
||||
{
|
||||
RimSummaryPlot* newPlot = sumPlotColl->createSummaryPlotWithAutoTitle();
|
||||
RimSummaryPlot* newPlot = new RimSummaryPlot();
|
||||
newPlot->enableAutoPlotTitle( true );
|
||||
|
||||
if ( ensemble )
|
||||
{
|
||||
@@ -567,12 +573,12 @@ RimEnsembleCurveSet* RicSummaryPlotFeatureImpl::createCurveSet( RimSummaryCaseCo
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimSummaryPlot* RicSummaryPlotFeatureImpl::createSummaryPlotForCases( RimSummaryPlotCollection* sumPlotColl,
|
||||
const std::vector<RimSummaryCase*>& summaryCasesToUse,
|
||||
RimSummaryPlot* RicSummaryPlotFeatureImpl::createSummaryPlotForCases( const std::vector<RimSummaryCase*>& summaryCasesToUse,
|
||||
QStringList summaryAddressFilters,
|
||||
bool addHistoryCurves /*= false */ )
|
||||
{
|
||||
RimSummaryPlot* newPlot = sumPlotColl->createSummaryPlotWithAutoTitle();
|
||||
RimSummaryPlot* newPlot = new RimSummaryPlot();
|
||||
newPlot->enableAutoPlotTitle( true );
|
||||
|
||||
for ( RimSummaryCase* sumCase : summaryCasesToUse )
|
||||
{
|
||||
@@ -588,7 +594,6 @@ RimSummaryPlot* RicSummaryPlotFeatureImpl::createSummaryPlotForCases( RimSummary
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RimSummaryPlot*> RicSummaryPlotFeatureImpl::createMultipleSummaryPlotsFromAddresses(
|
||||
RimSummaryPlotCollection* sumPlotColl,
|
||||
const std::vector<RimSummaryCase*>& summaryCasesToUse,
|
||||
RimSummaryCaseCollection* ensemble,
|
||||
QStringList summaryAddressFilters,
|
||||
@@ -631,7 +636,8 @@ std::vector<RimSummaryPlot*> RicSummaryPlotFeatureImpl::createMultipleSummaryPlo
|
||||
|
||||
if ( createdCurves.size() || createdEnsembleCurveSets.size() )
|
||||
{
|
||||
RimSummaryPlot* newPlot = sumPlotColl->createSummaryPlotWithAutoTitle();
|
||||
RimSummaryPlot* newPlot = new RimSummaryPlot();
|
||||
newPlot->enableAutoPlotTitle( true );
|
||||
|
||||
for ( auto curve : createdCurves )
|
||||
{
|
||||
|
||||
@@ -33,7 +33,6 @@ class RimSummaryCurve;
|
||||
class RimSummaryPlot;
|
||||
class RimSummaryCase;
|
||||
class RimSummaryCaseCollection;
|
||||
class RimSummaryPlotCollection;
|
||||
class RimEnsembleCurveSet;
|
||||
|
||||
class QStringList;
|
||||
@@ -50,28 +49,24 @@ public:
|
||||
};
|
||||
|
||||
static std::vector<RimSummaryCurve*> addDefaultCurvesToPlot( RimSummaryPlot* plot, RimSummaryCase* summaryCase );
|
||||
static void ensureAtLeastOnePlot( RimSummaryPlotCollection* summaryPlotCollection, RimSummaryCase* summaryCase );
|
||||
static caf::PdmObject* createDefaultSummaryPlot( RimSummaryCase* summaryCase );
|
||||
static caf::PdmObject* createDefaultSummaryPlot( RimSummaryCase* summaryCase );
|
||||
|
||||
static void createSummaryPlotsFromArgumentLine( const QStringList& arguments );
|
||||
|
||||
static RimSummaryPlot*
|
||||
createSummaryPlotForEnsemble( RimSummaryPlotCollection* sumPlotColl,
|
||||
const std::vector<RimSummaryCase*>& summaryCasesToUse,
|
||||
createSummaryPlotForEnsemble( const std::vector<RimSummaryCase*>& summaryCasesToUse,
|
||||
RimSummaryCaseCollection* ensemble,
|
||||
QStringList summaryAddressFilters,
|
||||
bool addHistoryCurves = false,
|
||||
EnsembleColoringType ensembleColoringStyle = EnsembleColoringType::NONE,
|
||||
QString ensembleColoringParameter = "" );
|
||||
|
||||
static RimSummaryPlot* createSummaryPlotForCases( RimSummaryPlotCollection* sumPlotColl,
|
||||
const std::vector<RimSummaryCase*>& summaryCasesToUse,
|
||||
static RimSummaryPlot* createSummaryPlotForCases( const std::vector<RimSummaryCase*>& summaryCasesToUse,
|
||||
QStringList summaryAddressFilters,
|
||||
bool addHistoryCurves = false );
|
||||
|
||||
static std::vector<RimSummaryPlot*>
|
||||
createMultipleSummaryPlotsFromAddresses( RimSummaryPlotCollection* sumPlotColl,
|
||||
const std::vector<RimSummaryCase*>& summaryCasesToUse,
|
||||
createMultipleSummaryPlotsFromAddresses( const std::vector<RimSummaryCase*>& summaryCasesToUse,
|
||||
RimSummaryCaseCollection* ensemble,
|
||||
QStringList summaryAddressFilters,
|
||||
bool addHistoryCurves = false,
|
||||
|
||||
Reference in New Issue
Block a user