Merge pull request #8732 from OPM/summarymultiplot_updates2

Summary Multiplot updates
This commit is contained in:
jonjenssen
2022-03-25 11:39:12 +01:00
committed by GitHub
parent 8feb0c363b
commit 8d3f41ded8
32 changed files with 423 additions and 316 deletions

View File

@@ -327,6 +327,7 @@ void RimSummaryMultiPlot::updatePlotWindowTitle()
populateNameHelper( m_nameHelper.get() );
auto title = m_nameHelper->plotTitle();
if ( title.isEmpty() ) title = "Empty Plot";
setMultiPlotTitle( title );
}
@@ -386,62 +387,6 @@ std::vector<RimSummaryPlot*> RimSummaryMultiPlot::summaryPlots() const
return typedPlots;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimSummaryMultiPlot::insertGraphsIntoPlot( RimSummaryMultiPlot* plot, const std::vector<RimSummaryPlot*>& graphs )
{
auto columnCount = RiuMultiPlotPage::ColumnCount::COLUMNS_2;
auto rowCount = RimMultiPlot::RowCount::ROWS_2;
auto tickmarkCount = RimPlotAxisPropertiesInterface::LegendTickmarkCount::TICKMARK_DEFAULT;
bool showTitleSubGraph = true;
if ( graphs.size() == 1 )
{
showTitleSubGraph = false;
tickmarkCount = RimPlotAxisPropertiesInterface::LegendTickmarkCount::TICKMARK_MANY;
}
else if ( 4 < graphs.size() && graphs.size() <= 6 )
{
columnCount = RiuMultiPlotPage::ColumnCount::COLUMNS_3;
rowCount = RimMultiPlot::RowCount::ROWS_2;
tickmarkCount = RimPlotAxisPropertiesInterface::LegendTickmarkCount::TICKMARK_FEW;
}
else if ( 6 < graphs.size() && graphs.size() <= 12 )
{
columnCount = RiuMultiPlotPage::ColumnCount::COLUMNS_4;
rowCount = RimMultiPlot::RowCount::ROWS_3;
tickmarkCount = RimPlotAxisPropertiesInterface::LegendTickmarkCount::TICKMARK_VERY_FEW;
}
else
{
columnCount = RiuMultiPlotPage::ColumnCount::COLUMNS_4;
rowCount = RimMultiPlot::RowCount::ROWS_4;
tickmarkCount = RimPlotAxisPropertiesInterface::LegendTickmarkCount::TICKMARK_VERY_FEW;
}
plot->setAutoTitlePlot( true );
plot->setAutoTitleGraphs( showTitleSubGraph );
plot->setColumnCount( columnCount );
plot->setRowCount( rowCount );
plot->setShowPlotTitles( showTitleSubGraph );
plot->setTickmarkCount( tickmarkCount );
for ( auto graph : graphs )
{
plot->addPlot( graph );
graph->resolveReferencesRecursively();
graph->revokeMdiWindowStatus();
graph->setShowWindow( true );
graph->loadDataAndUpdate();
}
plot->loadDataAndUpdate();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -570,6 +515,18 @@ void RimSummaryMultiPlot::syncAxisRanges()
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimSummaryMultiPlot::summaryPlotItemInfos( QList<caf::PdmOptionItemInfo>* optionInfos ) const
{
for ( RimSummaryPlot* plot : summaryPlots() )
{
QString displayName = plot->description();
optionInfos->push_back( caf::PdmOptionItemInfo( displayName, plot, false, plot->uiCapability()->uiIconProvider() ) );
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------