mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Convert cross plots into summary plots
This commit is contained in:
parent
5469f73a2d
commit
e9b95ae740
@ -20,6 +20,7 @@
|
||||
#include "RimMainPlotCollection.h"
|
||||
|
||||
#include "RiaPlotCollectionScheduler.h"
|
||||
#include "RiaSummaryDefines.h"
|
||||
|
||||
#include "PlotBuilderCommands/RicSummaryPlotBuilder.h"
|
||||
|
||||
@ -42,6 +43,8 @@
|
||||
#include "RimStimPlanModelPlotCollection.h"
|
||||
#include "RimSummaryAddress.h"
|
||||
#include "RimSummaryCrossPlotCollection.h"
|
||||
#include "RimSummaryCurve.h"
|
||||
#include "RimSummaryDataSourceStepping.h"
|
||||
#include "RimSummaryMultiPlot.h"
|
||||
#include "RimSummaryMultiPlotCollection.h"
|
||||
#include "RimSummaryPlotCollection.h"
|
||||
@ -176,17 +179,51 @@ RimMainPlotCollection* RimMainPlotCollection::current()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimMainPlotCollection::initAfterRead()
|
||||
{
|
||||
std::vector<RimSummaryPlot*> plotsToMove;
|
||||
for ( auto singlePlot : m_summaryPlotCollection_OBSOLETE()->plots() )
|
||||
{
|
||||
plotsToMove.push_back( singlePlot );
|
||||
std::vector<RimSummaryPlot*> plotsToMove;
|
||||
for ( auto singlePlot : m_summaryPlotCollection_OBSOLETE()->plots() )
|
||||
{
|
||||
plotsToMove.push_back( singlePlot );
|
||||
}
|
||||
|
||||
for ( auto singlePlot : plotsToMove )
|
||||
{
|
||||
m_summaryPlotCollection_OBSOLETE()->removePlot( singlePlot );
|
||||
|
||||
RicSummaryPlotBuilder::createAndAppendSingleSummaryMultiPlotNoAutoSettings( singlePlot );
|
||||
}
|
||||
}
|
||||
|
||||
for ( auto singlePlot : plotsToMove )
|
||||
// Move cross plots into summary plot collection
|
||||
auto crossPlots = m_summaryCrossPlotCollection_OBSOLETE->plots();
|
||||
if ( !crossPlots.empty() )
|
||||
{
|
||||
m_summaryPlotCollection_OBSOLETE()->removePlot( singlePlot );
|
||||
auto* summaryMultiPlot = new RimSummaryMultiPlot;
|
||||
summaryMultiPlot->setMultiPlotTitle( QString( "Multi Plot %1" ).arg( m_summaryMultiPlotCollection->multiPlots().size() + 1 ) );
|
||||
summaryMultiPlot->setAsPlotMdiWindow();
|
||||
m_summaryMultiPlotCollection->addSummaryMultiPlot( summaryMultiPlot );
|
||||
|
||||
RicSummaryPlotBuilder::createAndAppendSingleSummaryMultiPlotNoAutoSettings( singlePlot );
|
||||
for ( auto crossPlot : crossPlots )
|
||||
{
|
||||
m_summaryCrossPlotCollection_OBSOLETE->removePlot( crossPlot );
|
||||
summaryMultiPlot->addPlot( crossPlot );
|
||||
|
||||
// We want to convert RimSummaryCrossPlot into a RimSummaryPlot. The cross plot is derived from RimSummaryPlot, but we need to
|
||||
// create a new RimSummaryPlot to be able to store the PDM object as a RimSummaryPlot instead of RimSummaryCrossPlot
|
||||
auto summaryPlot = new RimSummaryPlot;
|
||||
summaryMultiPlot->addPlot( summaryPlot );
|
||||
|
||||
for ( auto curve : crossPlot->allCurves( RimSummaryDataSourceStepping::Axis::Y_AXIS ) )
|
||||
{
|
||||
crossPlot->removeCurve( curve );
|
||||
|
||||
if ( curve->summaryCaseX() != nullptr ) curve->setAxisTypeX( RiaDefines::HorizontalAxisType::SUMMARY_VECTOR );
|
||||
|
||||
summaryPlot->insertCurve( curve, size_t( 999 ) );
|
||||
}
|
||||
|
||||
delete crossPlot;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1422,11 +1422,6 @@ void RimProject::defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrdering, Q
|
||||
uiTreeOrdering.add( m_mainPlotCollection->correlationPlotCollection() );
|
||||
}
|
||||
|
||||
if ( m_mainPlotCollection->summaryCrossPlotCollection() )
|
||||
{
|
||||
uiTreeOrdering.add( m_mainPlotCollection->summaryCrossPlotCollection() );
|
||||
}
|
||||
|
||||
if ( m_mainPlotCollection->summaryTableCollection() )
|
||||
{
|
||||
uiTreeOrdering.add( m_mainPlotCollection->summaryTableCollection() );
|
||||
|
Loading…
Reference in New Issue
Block a user