mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-25 14:40:26 -05:00
Allow append curves and plots when a subitem of multi plot is selected
This commit is contained in:
1 parent
ba7b0c62db
commit
9ac0b887ed
8 files changed
+48
-44
No files matched your search
@@ -41,6 +41,7 @@
|
||||
#include "RimSummaryMultiPlotCollection.h"
|
||||
#include "RimSummaryPlot.h"
|
||||
|
||||
#include "RiuDockWidgetTools.h"
|
||||
#include "RiuPlotMainWindowTools.h"
|
||||
|
||||
namespace RiaSummaryPlotTools
|
||||
@@ -565,4 +566,27 @@ RimSummaryCurve* addNewSummaryCurve( RimSummaryPlot* summaryPlot, const RiaSumma
|
||||
|
||||
return curve;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::set<RimSummaryMultiPlot*> selectedSummaryMultiPlots()
|
||||
{
|
||||
std::set<RimSummaryMultiPlot*> plots;
|
||||
|
||||
auto selectedTreeViewItems = RiuDockWidgetTools::selectedItemsInTreeView( RiuDockWidgetTools::plotMainWindowPlotsTreeName() );
|
||||
for ( auto item : selectedTreeViewItems )
|
||||
{
|
||||
if ( auto object = dynamic_cast<caf::PdmObjectHandle*>( item ) )
|
||||
{
|
||||
if ( auto summaryMultiPlot = object->firstAncestorOrThisOfType<RimSummaryMultiPlot>() )
|
||||
{
|
||||
plots.insert( summaryMultiPlot );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return plots;
|
||||
}
|
||||
|
||||
} // namespace RiaSummaryPlotTools
|
||||
@@ -85,4 +85,6 @@ RimEnsembleCurveSet*
|
||||
|
||||
RimSummaryCurve* addNewSummaryCurve( RimSummaryPlot* summaryPlot, const RiaSummaryCurveAddress& curveAddress, RimSummaryCase* summaryCase );
|
||||
|
||||
std::set<RimSummaryMultiPlot*> selectedSummaryMultiPlots();
|
||||
|
||||
}; // namespace RiaSummaryPlotTools
|
||||
+4
-8
@@ -18,13 +18,13 @@
|
||||
|
||||
#include "RicAppendSummaryCurvesForObjectsFeature.h"
|
||||
|
||||
#include "Summary/RiaSummaryPlotTools.h"
|
||||
|
||||
#include "RicAppendSummaryPlotsForObjectsFeature.h"
|
||||
|
||||
#include "RimSummaryMultiPlot.h"
|
||||
#include "RimSummaryPlot.h"
|
||||
|
||||
#include "RiuDockWidgetTools.h"
|
||||
|
||||
#include <QAction>
|
||||
|
||||
CAF_CMD_SOURCE_INIT( RicAppendSummaryCurvesForObjectsFeature, "RicAppendSummaryCurvesForObjectsFeature" );
|
||||
@@ -55,13 +55,9 @@ void RicAppendSummaryCurvesForObjectsFeature::onActionTriggered( bool isChecked
|
||||
pdmObjects.push_back( summaryAdrCollection );
|
||||
}
|
||||
|
||||
auto selectedTreeViewItems = RiuDockWidgetTools::selectedItemsInTreeView( RiuDockWidgetTools::plotMainWindowPlotsTreeName() );
|
||||
|
||||
for ( auto item : selectedTreeViewItems )
|
||||
auto selectedMultiPlots = RiaSummaryPlotTools::selectedSummaryMultiPlots();
|
||||
for ( auto summaryMultiPlot : selectedMultiPlots )
|
||||
{
|
||||
auto summaryMultiPlot = dynamic_cast<RimSummaryMultiPlot*>( item );
|
||||
if ( !summaryMultiPlot ) continue;
|
||||
|
||||
if ( !RicAppendSummaryPlotsForObjectsFeature::isSelectionCompatibleWithPlot( sumAddressCollections, summaryMultiPlot ) ) continue;
|
||||
|
||||
for ( auto plot : summaryMultiPlot->summaryPlots() )
|
||||
|
||||
+4
-7
@@ -18,12 +18,12 @@
|
||||
|
||||
#include "RicAppendSummaryCurvesForSummaryAddressesFeature.h"
|
||||
|
||||
#include "Summary/RiaSummaryPlotTools.h"
|
||||
|
||||
#include "RimSummaryAddress.h"
|
||||
#include "RimSummaryMultiPlot.h"
|
||||
#include "RimSummaryPlot.h"
|
||||
|
||||
#include "RiuDockWidgetTools.h"
|
||||
|
||||
#include "cafSelectionManager.h"
|
||||
|
||||
#include <QAction>
|
||||
@@ -46,12 +46,9 @@ void RicAppendSummaryCurvesForSummaryAddressesFeature::onActionTriggered( bool i
|
||||
auto addresses = selectedAddresses();
|
||||
if ( addresses.empty() ) return;
|
||||
|
||||
auto selectedTreeViewItems = RiuDockWidgetTools::selectedItemsInTreeView( RiuDockWidgetTools::plotMainWindowPlotsTreeName() );
|
||||
for ( auto item : selectedTreeViewItems )
|
||||
auto selectedMultiPlots = RiaSummaryPlotTools::selectedSummaryMultiPlots();
|
||||
for ( auto summaryMultiPlot : selectedMultiPlots )
|
||||
{
|
||||
auto summaryMultiPlot = dynamic_cast<RimSummaryMultiPlot*>( item );
|
||||
if ( !summaryMultiPlot ) continue;
|
||||
|
||||
for ( auto plot : summaryMultiPlot->summaryPlots() )
|
||||
{
|
||||
plot->handleDroppedObjects( addresses );
|
||||
|
||||
+4
-7
@@ -18,13 +18,13 @@
|
||||
|
||||
#include "RicAppendSummaryCurvesForSummaryCasesFeature.h"
|
||||
|
||||
#include "Summary/RiaSummaryPlotTools.h"
|
||||
|
||||
#include "RimSummaryCase.h"
|
||||
#include "RimSummaryEnsemble.h"
|
||||
#include "RimSummaryMultiPlot.h"
|
||||
#include "RimSummaryPlot.h"
|
||||
|
||||
#include "RiuDockWidgetTools.h"
|
||||
|
||||
#include "cafSelectionManager.h"
|
||||
|
||||
#include <QAction>
|
||||
@@ -47,12 +47,9 @@ void RicAppendSummaryCurvesForSummaryCasesFeature::onActionTriggered( bool isChe
|
||||
auto objectsForDrop = dragDropObjects();
|
||||
if ( objectsForDrop.empty() ) return;
|
||||
|
||||
auto selectedTreeViewItems = RiuDockWidgetTools::selectedItemsInTreeView( RiuDockWidgetTools::plotMainWindowPlotsTreeName() );
|
||||
for ( auto item : selectedTreeViewItems )
|
||||
auto selectedMultiPlots = RiaSummaryPlotTools::selectedSummaryMultiPlots();
|
||||
for ( auto summaryMultiPlot : selectedMultiPlots )
|
||||
{
|
||||
auto summaryMultiPlot = dynamic_cast<RimSummaryMultiPlot*>( item );
|
||||
if ( !summaryMultiPlot ) continue;
|
||||
|
||||
for ( auto plot : summaryMultiPlot->summaryPlots() )
|
||||
{
|
||||
plot->handleDroppedObjects( objectsForDrop );
|
||||
|
||||
+2
-7
@@ -33,8 +33,6 @@
|
||||
#include "RimSummaryMultiPlot.h"
|
||||
#include "RimSummaryPlot.h"
|
||||
|
||||
#include "RiuDockWidgetTools.h"
|
||||
|
||||
#include "cafProgressInfo.h"
|
||||
#include "cafSelectionManager.h"
|
||||
|
||||
@@ -179,12 +177,9 @@ void RicAppendSummaryPlotsForObjectsFeature::onActionTriggered( bool isChecked )
|
||||
auto sumAddressCollections = selectedCollections();
|
||||
if ( sumAddressCollections.empty() ) return;
|
||||
|
||||
auto selectedTreeViewItems = RiuDockWidgetTools::selectedItemsInTreeView( RiuDockWidgetTools::plotMainWindowPlotsTreeName() );
|
||||
for ( auto item : selectedTreeViewItems )
|
||||
auto selectedMultiPlots = RiaSummaryPlotTools::selectedSummaryMultiPlots();
|
||||
for ( auto summaryMultiPlot : selectedMultiPlots )
|
||||
{
|
||||
auto summaryMultiPlot = dynamic_cast<RimSummaryMultiPlot*>( item );
|
||||
if ( !summaryMultiPlot ) continue;
|
||||
|
||||
appendPlots( summaryMultiPlot, sumAddressCollections );
|
||||
}
|
||||
}
|
||||
|
||||
+4
-8
@@ -18,12 +18,12 @@
|
||||
|
||||
#include "RicAppendSummaryPlotsForSummaryAddressesFeature.h"
|
||||
|
||||
#include "Summary/RiaSummaryPlotTools.h"
|
||||
|
||||
#include "RimSummaryAddress.h"
|
||||
#include "RimSummaryMultiPlot.h"
|
||||
#include "RimSummaryPlot.h"
|
||||
|
||||
#include "RiuDockWidgetTools.h"
|
||||
|
||||
#include "cafProgressInfo.h"
|
||||
#include "cafSelectionManager.h"
|
||||
|
||||
@@ -70,13 +70,9 @@ void RicAppendSummaryPlotsForSummaryAddressesFeature::onActionTriggered( bool is
|
||||
auto addresses = selectedAddresses();
|
||||
if ( addresses.empty() ) return;
|
||||
|
||||
auto selectedTreeViewItems = RiuDockWidgetTools::selectedItemsInTreeView( RiuDockWidgetTools::plotMainWindowPlotsTreeName() );
|
||||
|
||||
for ( auto item : selectedTreeViewItems )
|
||||
auto selectedMultiPlots = RiaSummaryPlotTools::selectedSummaryMultiPlots();
|
||||
for ( auto summaryMultiPlot : selectedMultiPlots )
|
||||
{
|
||||
auto summaryMultiPlot = dynamic_cast<RimSummaryMultiPlot*>( item );
|
||||
if ( !summaryMultiPlot ) continue;
|
||||
|
||||
appendPlotsForAddresses( summaryMultiPlot, addresses );
|
||||
}
|
||||
}
|
||||
|
||||
+4
-7
@@ -18,14 +18,14 @@
|
||||
|
||||
#include "RicAppendSummaryPlotsForSummaryCasesFeature.h"
|
||||
|
||||
#include "Summary/RiaSummaryPlotTools.h"
|
||||
|
||||
#include "RicAppendSummaryPlotsForObjectsFeature.h"
|
||||
|
||||
#include "RimSummaryCase.h"
|
||||
#include "RimSummaryEnsemble.h"
|
||||
#include "RimSummaryMultiPlot.h"
|
||||
|
||||
#include "RiuDockWidgetTools.h"
|
||||
|
||||
#include "cafSelectionManager.h"
|
||||
|
||||
#include <QAction>
|
||||
@@ -51,12 +51,9 @@ void RicAppendSummaryPlotsForSummaryCasesFeature::onActionTriggered( bool isChec
|
||||
auto cases = selectedCases();
|
||||
auto ensembles = selectedEnsembles();
|
||||
|
||||
auto selectedTreeViewItems = RiuDockWidgetTools::selectedItemsInTreeView( RiuDockWidgetTools::plotMainWindowPlotsTreeName() );
|
||||
for ( auto item : selectedTreeViewItems )
|
||||
auto selectedMultiPlots = RiaSummaryPlotTools::selectedSummaryMultiPlots();
|
||||
for ( auto summaryMultiPlot : selectedMultiPlots )
|
||||
{
|
||||
auto summaryMultiPlot = dynamic_cast<RimSummaryMultiPlot*>( item );
|
||||
if ( !summaryMultiPlot ) continue;
|
||||
|
||||
RicAppendSummaryPlotsForObjectsFeature::appendPlots( summaryMultiPlot, cases, ensembles );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user