mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Merge pull request #8732 from OPM/summarymultiplot_updates2
Summary Multiplot updates
This commit is contained in:
@@ -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() ) );
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user