mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#8405 Source Stepping on multiple graphs
- add copy paste of plots into multi summary plot - improve data source stepping for multi plot - improve auto generated plot name, graph name and curve name Fixes by clang-format Improve readability
This commit is contained in:
@@ -19,10 +19,14 @@
|
||||
#include "RicPasteSummaryPlotFeature.h"
|
||||
|
||||
#include "OperationsUsingObjReferences/RicPasteFeatureImpl.h"
|
||||
#include "PlotBuilderCommands/RicSummaryPlotBuilder.h"
|
||||
|
||||
#include "RimMultiPlot.h"
|
||||
#include "RimSummaryPlot.h"
|
||||
#include "RimSummaryPlotCollection.h"
|
||||
|
||||
#include "RiuPlotMainWindowTools.h"
|
||||
|
||||
#include "cafPdmDefaultObjectFactory.h"
|
||||
#include "cafPdmDocument.h"
|
||||
#include "cafPdmObjectGroup.h"
|
||||
@@ -39,8 +43,21 @@ CAF_CMD_SOURCE_INIT( RicPasteSummaryPlotFeature, "RicPasteSummaryPlotFeature" );
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicPasteSummaryPlotFeature::copyPlotAndAddToCollection( RimSummaryPlot* sourcePlot )
|
||||
{
|
||||
RimSummaryPlotCollection* plotColl = caf::firstAncestorOfTypeFromSelectedObject<RimSummaryPlotCollection*>();
|
||||
auto multiPlot = caf::firstAncestorOfTypeFromSelectedObject<RimMultiPlot*>();
|
||||
if ( multiPlot )
|
||||
{
|
||||
auto plots = RicSummaryPlotBuilder::duplicatePlots( { sourcePlot } );
|
||||
RicSummaryPlotBuilder::appendPlotsToMultiPlot( multiPlot, plots );
|
||||
|
||||
multiPlot->loadDataAndUpdate();
|
||||
|
||||
// No main window has focus after paste operation, set focus to main plot window
|
||||
RiuPlotMainWindowTools::showPlotMainWindow();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
RimSummaryPlotCollection* plotColl = caf::firstAncestorOfTypeFromSelectedObject<RimSummaryPlotCollection*>();
|
||||
if ( plotColl )
|
||||
{
|
||||
RimSummaryPlot* newSummaryPlot = dynamic_cast<RimSummaryPlot*>(
|
||||
@@ -72,6 +89,9 @@ bool RicPasteSummaryPlotFeature::isCommandEnabled()
|
||||
|
||||
if ( !destinationObject ) return false;
|
||||
|
||||
auto multiPlot = caf::firstAncestorOfTypeFromSelectedObject<RimMultiPlot*>();
|
||||
if ( multiPlot ) return true;
|
||||
|
||||
RimSummaryPlotCollection* plotColl = nullptr;
|
||||
destinationObject->firstAncestorOrThisOfType( plotColl );
|
||||
if ( !plotColl )
|
||||
|
||||
Reference in New Issue
Block a user