mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Add copy/paste of Summary Multi Plot (#8942)
* Guard use of back() on empty vector * Add "Show Data Sources" to ensemble realizations * Update summary plot as summary curve collection is not visible in tree view * Set selection manager root in RiaApplication * Always close both main windows if present * Add copy/paste of summary multi plot * Add test for RiuMainWindow::instance() before use * Remove duplicated code * Multiple Tree Views : Use getTreeViewWithItem() to find correct tree view * Minor UI adjustments
This commit is contained in:
@@ -112,6 +112,23 @@ bool RimSummaryCase::isObservedData() const
|
||||
return m_isObservedData;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimSummaryCase::showRealizationDataSources() const
|
||||
{
|
||||
return m_showSubNodesInTree();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryCase::setShowRealizationDataSource( bool enable )
|
||||
{
|
||||
m_showSubNodesInTree = enable;
|
||||
updateConnectedEditors();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -78,6 +78,9 @@ public:
|
||||
|
||||
bool isObservedData() const;
|
||||
|
||||
bool showRealizationDataSources() const;
|
||||
void setShowRealizationDataSource( bool enable );
|
||||
|
||||
void setCaseRealizationParameters( const std::shared_ptr<RigCaseRealizationParameters>& crlParameters );
|
||||
std::shared_ptr<RigCaseRealizationParameters> caseRealizationParameters() const;
|
||||
bool hasCaseRealizationParameters() const;
|
||||
|
||||
@@ -105,21 +105,7 @@ size_t RimSummaryMultiPlotCollection::plotCount() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryMultiPlotCollection::onDuplicatePlot( const caf::SignalEmitter* emitter, RimSummaryMultiPlot* plotToDuplicate )
|
||||
{
|
||||
if ( !plotToDuplicate ) return;
|
||||
|
||||
auto plotCopy = dynamic_cast<RimSummaryMultiPlot*>(
|
||||
plotToDuplicate->copyByXmlSerialization( caf::PdmDefaultObjectFactory::instance() ) );
|
||||
|
||||
addSummaryMultiPlot( plotCopy );
|
||||
|
||||
plotCopy->resolveReferencesRecursively();
|
||||
plotCopy->initAfterReadRecursively();
|
||||
plotCopy->updateAllRequiredEditors();
|
||||
plotCopy->loadDataAndUpdate();
|
||||
|
||||
updateConnectedEditors();
|
||||
|
||||
RiuPlotMainWindowTools::selectAsCurrentItem( plotCopy, true );
|
||||
duplicatePlot( plotToDuplicate );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -160,6 +146,28 @@ void RimSummaryMultiPlotCollection::summaryPlotItemInfos( QList<caf::PdmOptionIt
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryMultiPlotCollection::duplicatePlot( RimSummaryMultiPlot* plotToDuplicate )
|
||||
{
|
||||
if ( !plotToDuplicate ) return;
|
||||
|
||||
auto plotCopy = dynamic_cast<RimSummaryMultiPlot*>(
|
||||
plotToDuplicate->copyByXmlSerialization( caf::PdmDefaultObjectFactory::instance() ) );
|
||||
|
||||
addSummaryMultiPlot( plotCopy );
|
||||
|
||||
plotCopy->resolveReferencesRecursively();
|
||||
plotCopy->initAfterReadRecursively();
|
||||
plotCopy->updateAllRequiredEditors();
|
||||
plotCopy->loadDataAndUpdate();
|
||||
|
||||
updateConnectedEditors();
|
||||
|
||||
RiuPlotMainWindowTools::selectAsCurrentItem( plotCopy, true );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -46,8 +46,8 @@ public:
|
||||
std::vector<RimSummaryMultiPlot*> multiPlots() const;
|
||||
|
||||
void addSummaryMultiPlot( RimSummaryMultiPlot* plot );
|
||||
|
||||
void summaryPlotItemInfos( QList<caf::PdmOptionItemInfo>* optionInfos ) const;
|
||||
void duplicatePlot( RimSummaryMultiPlot* plotToDuplicate );
|
||||
|
||||
void updateSummaryNameHasChanged();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user