Summary Multi Plot: Minor adjustments (#8856)

Remove obsolete single summary template code
Always use maximized state of the QMdiSubWindow when a plot or view is deleted.
Move time axis to top
Set correct text for unused axis
Avoid assert when layout is requested for non existing legend
This commit is contained in:
Magne Sjaastad
2022-04-29 15:31:07 +02:00
committed by GitHub
parent f54399960d
commit 64bed1d611
16 changed files with 138 additions and 570 deletions

View File

@@ -36,8 +36,8 @@ CAF_CMD_SOURCE_INIT( RicNewPlotAxisPropertiesFeature, "RicNewPlotAxisPropertiesF
//--------------------------------------------------------------------------------------------------
bool RicNewPlotAxisPropertiesFeature::isCommandEnabled()
{
std::vector<RimSummaryPlot*> summaryPlots = caf::selectedObjectsByTypeStrict<RimSummaryPlot*>();
return summaryPlots.size() == 1;
auto* summaryPlot = caf::firstAncestorOfTypeFromSelectedObject<RimSummaryPlot*>();
return ( summaryPlot != nullptr );
}
//--------------------------------------------------------------------------------------------------
@@ -45,13 +45,13 @@ bool RicNewPlotAxisPropertiesFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
void RicNewPlotAxisPropertiesFeature::onActionTriggered( bool isChecked )
{
std::vector<RimSummaryPlot*> summaryPlots = caf::selectedObjectsByTypeStrict<RimSummaryPlot*>();
if ( summaryPlots.size() != 1 ) return;
RimSummaryPlot* summaryPlot = summaryPlots[0];
auto* summaryPlot = caf::firstAncestorOfTypeFromSelectedObject<RimSummaryPlot*>();
if ( !summaryPlot ) return;
RimPlotAxisProperties* newPlotAxisProperties =
summaryPlot->addNewAxisProperties( RiaDefines::PlotAxis::PLOT_AXIS_LEFT, "New Axis" );
summaryPlot->plotWidget()->ensureAxisIsCreated( newPlotAxisProperties->plotAxisType() );
newPlotAxisProperties->setNameForUnusedAxis();
summaryPlot->updateConnectedEditors();
RiuPlotMainWindowTools::selectAsCurrentItem( newPlotAxisProperties );