From d74807d669b782b49b3a29b88b29c1e36c694602 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacob=20St=C3=B8ren?= Date: Tue, 27 Feb 2018 15:21:14 +0100 Subject: [PATCH] #2535 Use the MainWindowTools class instead of MainWindow directly (part 1) --- ...NewFishbonesSubsAtMeasuredDepthFeature.cpp | 4 ++-- ...forationIntervalAtMeasuredDepthFeature.cpp | 4 ++-- .../RicNewPerforationIntervalFeature.cpp | 4 ++-- .../RicNewAzimuthDipIntersectionFeature.cpp | 4 ++-- .../RicNewPolylineIntersectionFeature.cpp | 4 ++-- .../RicEclipseCaseNewGroupExec.cpp | 7 ++++--- ...ddStoredFlowCharacteristicsPlotFeature.cpp | 12 +++++------ .../RicAddStoredWellAllocationPlotFeature.cpp | 10 +++------- .../RicPlotProductionRateFeature.cpp | 1 - .../RicShowFlowCharacteristicsPlotFeature.cpp | 6 +++--- .../RicShowWellAllocationPlotFeature.cpp | 6 +++--- .../RicNewEllipseFractureTemplateFeature.cpp | 4 ++-- .../RicAppendIntersectionBoxFeature.cpp | 4 ++-- .../RicCreateSummaryCaseCollectionFeature.cpp | 5 +++-- .../RicGeoMechPropertyFilterFeatureImpl.cpp | 6 +++--- .../Commands/RicRangeFilterInsertExec.cpp | 4 ++-- .../Commands/RicRangeFilterNewExec.cpp | 4 ++-- ApplicationCode/Commands/RicWellLogTools.cpp | 14 ++++++------- .../RicNewGridTimeHistoryCurveFeature.cpp | 5 +++-- .../RicSummaryCurveCreator.cpp | 9 +++++---- .../ViewLink/RicSetMasterViewFeature.cpp | 6 +++--- .../ViewLink/RicShowLinkOptionsFeature.cpp | 4 ++-- .../RicAddWellLogToPlotFeature.cpp | 8 +++++--- .../WellLogCommands/RicNewRftPlotFeature.cpp | 11 ++++------ .../RimFishboneWellPathCollection.cpp | 4 ++-- .../Completions/RimPerforationCollection.cpp | 4 ++-- .../ProjectDataModel/RimGridView.cpp | 4 ++-- .../Summary/RimObservedDataCollection.cpp | 20 +++++++------------ .../Summary/RimSummaryPlot.cpp | 12 +++++------ 29 files changed, 90 insertions(+), 100 deletions(-) diff --git a/ApplicationCode/Commands/CompletionCommands/RicNewFishbonesSubsAtMeasuredDepthFeature.cpp b/ApplicationCode/Commands/CompletionCommands/RicNewFishbonesSubsAtMeasuredDepthFeature.cpp index cd7fcc8dbe..b651e70431 100644 --- a/ApplicationCode/Commands/CompletionCommands/RicNewFishbonesSubsAtMeasuredDepthFeature.cpp +++ b/ApplicationCode/Commands/CompletionCommands/RicNewFishbonesSubsAtMeasuredDepthFeature.cpp @@ -26,7 +26,7 @@ #include "RimProject.h" #include "RimWellPath.h" -#include "RiuMainWindow.h" +#include "Riu3DMainWindowTools.h" #include "RiuSelectionManager.h" #include "cafSelectionManager.h" @@ -58,7 +58,7 @@ void RicNewFishbonesSubsAtMeasuredDepthFeature::onActionTriggered(bool isChecked RicNewFishbonesSubsFeature::askUserToSetUsefulScaling(wellPath->fishbonesCollection()); wellPath->updateConnectedEditors(); - RiuMainWindow::instance()->selectAsCurrentItem(obj); + Riu3DMainWindowTools::selectAsCurrentItem(obj); RimProject* proj; wellPath->firstAncestorOrThisOfTypeAsserted(proj); diff --git a/ApplicationCode/Commands/CompletionCommands/RicNewPerforationIntervalAtMeasuredDepthFeature.cpp b/ApplicationCode/Commands/CompletionCommands/RicNewPerforationIntervalAtMeasuredDepthFeature.cpp index 95a85c979f..bf1fc79aa9 100644 --- a/ApplicationCode/Commands/CompletionCommands/RicNewPerforationIntervalAtMeasuredDepthFeature.cpp +++ b/ApplicationCode/Commands/CompletionCommands/RicNewPerforationIntervalAtMeasuredDepthFeature.cpp @@ -27,7 +27,7 @@ #include "RimWellPath.h" #include "RimWellPathCollection.h" -#include "RiuMainWindow.h" +#include "Riu3DMainWindowTools.h" #include "RiuSelectionManager.h" #include "cafSelectionManager.h" @@ -62,7 +62,7 @@ void RicNewPerforationIntervalAtMeasuredDepthFeature::onActionTriggered(bool isC wellPathCollection->uiCapability()->updateConnectedEditors(); wellPathCollection->scheduleRedrawAffectedViews(); - RiuMainWindow::instance()->selectAsCurrentItem(perforationInterval); + Riu3DMainWindowTools::selectAsCurrentItem(perforationInterval); } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/Commands/CompletionCommands/RicNewPerforationIntervalFeature.cpp b/ApplicationCode/Commands/CompletionCommands/RicNewPerforationIntervalFeature.cpp index cc55aaea97..6a66b7a196 100644 --- a/ApplicationCode/Commands/CompletionCommands/RicNewPerforationIntervalFeature.cpp +++ b/ApplicationCode/Commands/CompletionCommands/RicNewPerforationIntervalFeature.cpp @@ -21,7 +21,7 @@ #include "WellPathCommands/RicWellPathsUnitSystemSettingsImpl.h" -#include "RiuMainWindow.h" +#include "Riu3DMainWindowTools.h" #include "RimPerforationInterval.h" #include "RimPerforationCollection.h" @@ -66,7 +66,7 @@ void RicNewPerforationIntervalFeature::onActionTriggered(bool isChecked) wellPathCollection->uiCapability()->updateConnectedEditors(); wellPathCollection->scheduleRedrawAffectedViews(); - RiuMainWindow::instance()->selectAsCurrentItem(perforationInterval); + Riu3DMainWindowTools::selectAsCurrentItem(perforationInterval); } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/Commands/CrossSectionCommands/RicNewAzimuthDipIntersectionFeature.cpp b/ApplicationCode/Commands/CrossSectionCommands/RicNewAzimuthDipIntersectionFeature.cpp index 1a1aedc2c7..946c26fdae 100644 --- a/ApplicationCode/Commands/CrossSectionCommands/RicNewAzimuthDipIntersectionFeature.cpp +++ b/ApplicationCode/Commands/CrossSectionCommands/RicNewAzimuthDipIntersectionFeature.cpp @@ -25,7 +25,7 @@ #include "RimIntersectionCollection.h" #include "RimGridView.h" -#include "RiuMainWindow.h" +#include "Riu3DMainWindowTools.h" #include "RiuSelectionManager.h" #include "RiuViewer.h" @@ -125,7 +125,7 @@ void RicNewAzimuthDipIntersectionFeatureCmd::redo() m_intersectionCollection->appendIntersectionAndUpdate(intersection); RiuSelectionManager::instance()->deleteAllItems(); - RiuMainWindow::instance()->selectAsCurrentItem(intersection); + Riu3DMainWindowTools::selectAsCurrentItem(intersection); } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/Commands/CrossSectionCommands/RicNewPolylineIntersectionFeature.cpp b/ApplicationCode/Commands/CrossSectionCommands/RicNewPolylineIntersectionFeature.cpp index c2bcf150e1..35c6ebfa72 100644 --- a/ApplicationCode/Commands/CrossSectionCommands/RicNewPolylineIntersectionFeature.cpp +++ b/ApplicationCode/Commands/CrossSectionCommands/RicNewPolylineIntersectionFeature.cpp @@ -26,7 +26,7 @@ #include "RimIntersectionCollection.h" #include "RimGridView.h" -#include "RiuMainWindow.h" +#include "Riu3DMainWindowTools.h" #include "RiuSelectionManager.h" #include "RiuViewer.h" @@ -116,7 +116,7 @@ void RicNewPolylineIntersectionFeatureCmd::redo() RiuSelectionManager::instance()->deleteAllItems(); - RiuMainWindow::instance()->selectAsCurrentItem(intersection); + Riu3DMainWindowTools::selectAsCurrentItem(intersection); } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/Commands/EclipseCommands/RicEclipseCaseNewGroupExec.cpp b/ApplicationCode/Commands/EclipseCommands/RicEclipseCaseNewGroupExec.cpp index 6198cd8934..134e5c4fbe 100644 --- a/ApplicationCode/Commands/EclipseCommands/RicEclipseCaseNewGroupExec.cpp +++ b/ApplicationCode/Commands/EclipseCommands/RicEclipseCaseNewGroupExec.cpp @@ -27,7 +27,7 @@ #include "RimOilField.h" #include "RiaApplication.h" -#include "RiuMainWindow.h" +#include "Riu3DMainWindowTools.h" //-------------------------------------------------------------------------------------------------- /// @@ -73,8 +73,9 @@ void RicEclipseCaseNewGroupExec::redo() analysisModels->caseGroups().push_back(createdObject); analysisModels->updateConnectedEditors(); - RiuMainWindow::instance()->selectAsCurrentItem(createdObject); - RiuMainWindow::instance()->setExpanded(createdObject); + + Riu3DMainWindowTools::selectAsCurrentItem(createdObject); + Riu3DMainWindowTools::setExpanded(createdObject); } } diff --git a/ApplicationCode/Commands/FlowCommands/RicAddStoredFlowCharacteristicsPlotFeature.cpp b/ApplicationCode/Commands/FlowCommands/RicAddStoredFlowCharacteristicsPlotFeature.cpp index 92ddc0ae33..69dcb88081 100644 --- a/ApplicationCode/Commands/FlowCommands/RicAddStoredFlowCharacteristicsPlotFeature.cpp +++ b/ApplicationCode/Commands/FlowCommands/RicAddStoredFlowCharacteristicsPlotFeature.cpp @@ -25,7 +25,7 @@ #include "RimProject.h" #include "RimFlowCharacteristicsPlot.h" -#include "RiuMainPlotWindow.h" +#include "RiuPlotMainWindowTools.h" #include "cafSelectionManager.h" @@ -79,12 +79,10 @@ void RicAddStoredFlowCharacteristicsPlotFeature::onActionTriggered(bool isChecke flowPlotColl->updateConnectedEditors(); - RiuMainPlotWindow* mainPlotWindow = RiaApplication::instance()->mainPlotWindow(); - if (mainPlotWindow) - { - mainPlotWindow->selectAsCurrentItem(flowCharacteristicsPlot); - mainPlotWindow->setExpanded(flowCharacteristicsPlot); - } + RiuPlotMainWindowTools::showPlotMainWindow(); + + RiuPlotMainWindowTools::selectAsCurrentItem(flowCharacteristicsPlot); + RiuPlotMainWindowTools::setExpanded(flowCharacteristicsPlot); } } } diff --git a/ApplicationCode/Commands/FlowCommands/RicAddStoredWellAllocationPlotFeature.cpp b/ApplicationCode/Commands/FlowCommands/RicAddStoredWellAllocationPlotFeature.cpp index a04eb49619..5c0beac5d0 100644 --- a/ApplicationCode/Commands/FlowCommands/RicAddStoredWellAllocationPlotFeature.cpp +++ b/ApplicationCode/Commands/FlowCommands/RicAddStoredWellAllocationPlotFeature.cpp @@ -25,7 +25,7 @@ #include "RimProject.h" #include "RimWellAllocationPlot.h" -#include "RiuMainPlotWindow.h" +#include "RiuPlotMainWindowTools.h" #include "cafSelectionManager.h" @@ -79,12 +79,8 @@ void RicAddStoredWellAllocationPlotFeature::onActionTriggered(bool isChecked) flowPlotColl->updateConnectedEditors(); - RiuMainPlotWindow* mainPlotWindow = RiaApplication::instance()->mainPlotWindow(); - if (mainPlotWindow) - { - mainPlotWindow->selectAsCurrentItem(wellAllocationPlot); - mainPlotWindow->setExpanded(wellAllocationPlot); - } + RiuPlotMainWindowTools::selectAsCurrentItem(wellAllocationPlot); + RiuPlotMainWindowTools::setExpanded(wellAllocationPlot); } } } diff --git a/ApplicationCode/Commands/FlowCommands/RicPlotProductionRateFeature.cpp b/ApplicationCode/Commands/FlowCommands/RicPlotProductionRateFeature.cpp index 542033b28a..6b885ba4b8 100644 --- a/ApplicationCode/Commands/FlowCommands/RicPlotProductionRateFeature.cpp +++ b/ApplicationCode/Commands/FlowCommands/RicPlotProductionRateFeature.cpp @@ -41,7 +41,6 @@ #include "RiaSummaryTools.h" #include "RiuMainPlotWindow.h" -#include "RiuMainWindow.h" #include "cafSelectionManager.h" diff --git a/ApplicationCode/Commands/FlowCommands/RicShowFlowCharacteristicsPlotFeature.cpp b/ApplicationCode/Commands/FlowCommands/RicShowFlowCharacteristicsPlotFeature.cpp index c335267fb9..5dd15fc659 100644 --- a/ApplicationCode/Commands/FlowCommands/RicShowFlowCharacteristicsPlotFeature.cpp +++ b/ApplicationCode/Commands/FlowCommands/RicShowFlowCharacteristicsPlotFeature.cpp @@ -32,7 +32,7 @@ #include "RimProject.h" #include "Rim3dView.h" -#include "RiuMainPlotWindow.h" +#include "RiuPlotMainWindowTools.h" #include @@ -91,13 +91,13 @@ void RicShowFlowCharacteristicsPlotFeature::onActionTriggered(bool isChecked) RimFlowPlotCollection* flowPlotColl = RiaApplication::instance()->project()->mainPlotCollection->flowPlotCollection(); if (flowPlotColl) { - RiuMainPlotWindow* plotwindow = RiaApplication::instance()->getOrCreateAndShowMainPlotWindow(); + RiuPlotMainWindowTools::showPlotMainWindow(); flowPlotColl->defaultFlowCharacteristicsPlot()->setFromFlowSolution(eclCase->defaultFlowDiagSolution()); flowPlotColl->defaultFlowCharacteristicsPlot()->updateConnectedEditors(); // Make sure the summary plot window is created and visible - plotwindow->selectAsCurrentItem(flowPlotColl->defaultFlowCharacteristicsPlot()); + RiuPlotMainWindowTools::selectAsCurrentItem(flowPlotColl->defaultFlowCharacteristicsPlot()); } } } diff --git a/ApplicationCode/Commands/FlowCommands/RicShowWellAllocationPlotFeature.cpp b/ApplicationCode/Commands/FlowCommands/RicShowWellAllocationPlotFeature.cpp index ab4f6d8e8b..d24c9c8616 100644 --- a/ApplicationCode/Commands/FlowCommands/RicShowWellAllocationPlotFeature.cpp +++ b/ApplicationCode/Commands/FlowCommands/RicShowWellAllocationPlotFeature.cpp @@ -28,7 +28,7 @@ #include "Rim3dView.h" #include "RimWellAllocationPlot.h" -#include "RiuMainPlotWindow.h" +#include "RiuPlotMainWindowTools.h" #include "cafSelectionManager.h" @@ -110,8 +110,8 @@ void RicShowWellAllocationPlotFeature::onActionTriggered(bool isChecked) flowPlotColl->defaultWellAllocPlot()->updateConnectedEditors(); // Make sure the summary plot window is created and visible - RiuMainPlotWindow* plotwindow = RiaApplication::instance()->getOrCreateAndShowMainPlotWindow(); - plotwindow->selectAsCurrentItem(flowPlotColl->defaultWellAllocPlot()); + RiuPlotMainWindowTools::showPlotMainWindow(); + RiuPlotMainWindowTools::selectAsCurrentItem(flowPlotColl->defaultWellAllocPlot()); } } } diff --git a/ApplicationCode/Commands/FractureCommands/RicNewEllipseFractureTemplateFeature.cpp b/ApplicationCode/Commands/FractureCommands/RicNewEllipseFractureTemplateFeature.cpp index 282c5be805..f7370be3b0 100644 --- a/ApplicationCode/Commands/FractureCommands/RicNewEllipseFractureTemplateFeature.cpp +++ b/ApplicationCode/Commands/FractureCommands/RicNewEllipseFractureTemplateFeature.cpp @@ -26,7 +26,7 @@ #include "RimOilField.h" #include "RimProject.h" -#include "RiuMainWindow.h" +#include "Riu3DMainWindowTools.h" #include "cafSelectionManager.h" @@ -59,7 +59,7 @@ void RicNewEllipseFractureTemplateFeature::selectFractureTemplateAndUpdate(RimFr } } - RiuMainWindow::instance()->selectAsCurrentItem(fractureTemplate); + Riu3DMainWindowTools::selectAsCurrentItem(fractureTemplate); } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/Commands/IntersectionBoxCommands/RicAppendIntersectionBoxFeature.cpp b/ApplicationCode/Commands/IntersectionBoxCommands/RicAppendIntersectionBoxFeature.cpp index ff4034a52f..34898705e6 100644 --- a/ApplicationCode/Commands/IntersectionBoxCommands/RicAppendIntersectionBoxFeature.cpp +++ b/ApplicationCode/Commands/IntersectionBoxCommands/RicAppendIntersectionBoxFeature.cpp @@ -22,7 +22,7 @@ #include "RimIntersectionBox.h" #include "RimIntersectionCollection.h" #include "RimGridView.h" -#include "RiuMainWindow.h" +#include "Riu3DMainWindowTools.h" #include "cafCmdExecCommandManager.h" #include "cafSelectionManager.h" @@ -61,7 +61,7 @@ void RicAppendIntersectionBoxFeature::onActionTriggered(bool isChecked) intersectionBox->setToDefaultSizeBox(); coll->updateConnectedEditors(); - RiuMainWindow::instance()->selectAsCurrentItem(intersectionBox); + Riu3DMainWindowTools::selectAsCurrentItem(intersectionBox); RimGridView* rimView = nullptr; coll->firstAncestorOrThisOfTypeAsserted(rimView); diff --git a/ApplicationCode/Commands/RicCreateSummaryCaseCollectionFeature.cpp b/ApplicationCode/Commands/RicCreateSummaryCaseCollectionFeature.cpp index 62789b362f..16bb885c7f 100644 --- a/ApplicationCode/Commands/RicCreateSummaryCaseCollectionFeature.cpp +++ b/ApplicationCode/Commands/RicCreateSummaryCaseCollectionFeature.cpp @@ -24,7 +24,7 @@ #include "RimSummaryCaseCollection.h" #include "RimSummaryCaseMainCollection.h" -#include "RiuMainPlotWindow.h" +#include "RiuPlotMainWindowTools.h" #include "cafPdmObject.h" #include "cafSelectionManager.h" @@ -71,7 +71,8 @@ void RicCreateSummaryCaseCollectionFeature::onActionTriggered(bool isChecked) summaryCaseMainCollection->addCaseCollection(selection); summaryCaseMainCollection->updateConnectedEditors(); - RiaApplication::instance()->getOrCreateAndShowMainPlotWindow()->selectAsCurrentItem(summaryCaseMainCollection->summaryCaseCollections().back()->allSummaryCases().front()); + RiuPlotMainWindowTools::showPlotMainWindow(); + RiuPlotMainWindowTools::selectAsCurrentItem(summaryCaseMainCollection->summaryCaseCollections().back()->allSummaryCases().front()); } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/Commands/RicGeoMechPropertyFilterFeatureImpl.cpp b/ApplicationCode/Commands/RicGeoMechPropertyFilterFeatureImpl.cpp index 4d99d5ed2b..5e01fee6c9 100644 --- a/ApplicationCode/Commands/RicGeoMechPropertyFilterFeatureImpl.cpp +++ b/ApplicationCode/Commands/RicGeoMechPropertyFilterFeatureImpl.cpp @@ -25,7 +25,7 @@ #include "RimGeoMechView.h" #include "RimGeoMechResultDefinition.h" -#include "RiuMainWindow.h" +#include "Riu3DMainWindowTools.h" #include "cafSelectionManager.h" @@ -66,7 +66,7 @@ void RicGeoMechPropertyFilterFeatureImpl::addPropertyFilter(RimGeoMechPropertyFi propertyFilterCollection->reservoirView()->scheduleCreateDisplayModelAndRedraw(); propertyFilterCollection->updateConnectedEditors(); - RiuMainWindow::instance()->selectAsCurrentItem(propertyFilter); + Riu3DMainWindowTools::selectAsCurrentItem(propertyFilter); } @@ -83,7 +83,7 @@ void RicGeoMechPropertyFilterFeatureImpl::insertPropertyFilter(RimGeoMechPropert propertyFilterCollection->reservoirView()->scheduleCreateDisplayModelAndRedraw(); propertyFilterCollection->updateConnectedEditors(); - RiuMainWindow::instance()->selectAsCurrentItem(propertyFilter); + Riu3DMainWindowTools::selectAsCurrentItem(propertyFilter); } diff --git a/ApplicationCode/Commands/RicRangeFilterInsertExec.cpp b/ApplicationCode/Commands/RicRangeFilterInsertExec.cpp index 3d2245351b..c811959d32 100644 --- a/ApplicationCode/Commands/RicRangeFilterInsertExec.cpp +++ b/ApplicationCode/Commands/RicRangeFilterInsertExec.cpp @@ -22,7 +22,7 @@ #include "RimCellRangeFilter.h" #include "RimCellRangeFilterCollection.h" #include "Rim3dView.h" -#include "RiuMainWindow.h" +#include "Riu3DMainWindowTools.h" //-------------------------------------------------------------------------------------------------- @@ -69,7 +69,7 @@ void RicRangeFilterInsertExec::redo() m_cellRangeFilterCollection->updateConnectedEditors(); - RiuMainWindow::instance()->selectAsCurrentItem(rangeFilter); + Riu3DMainWindowTools::selectAsCurrentItem(rangeFilter); } } diff --git a/ApplicationCode/Commands/RicRangeFilterNewExec.cpp b/ApplicationCode/Commands/RicRangeFilterNewExec.cpp index 773ad07d29..c116de9ec4 100644 --- a/ApplicationCode/Commands/RicRangeFilterNewExec.cpp +++ b/ApplicationCode/Commands/RicRangeFilterNewExec.cpp @@ -25,7 +25,7 @@ #include "RimCellRangeFilterCollection.h" #include "RimGridView.h" -#include "RiuMainWindow.h" +#include "Riu3DMainWindowTools.h" //-------------------------------------------------------------------------------------------------- @@ -75,7 +75,7 @@ void RicRangeFilterNewExec::redo() m_cellRangeFilterCollection->updateConnectedEditors(); - RiuMainWindow::instance()->selectAsCurrentItem(rangeFilter); + Riu3DMainWindowTools::selectAsCurrentItem(rangeFilter); RimGridView* view = nullptr; m_cellRangeFilterCollection->firstAncestorOrThisOfTypeAsserted(view); diff --git a/ApplicationCode/Commands/RicWellLogTools.cpp b/ApplicationCode/Commands/RicWellLogTools.cpp index 25e1675df3..ca9b7c91d0 100644 --- a/ApplicationCode/Commands/RicWellLogTools.cpp +++ b/ApplicationCode/Commands/RicWellLogTools.cpp @@ -35,7 +35,7 @@ #include "RifReaderEclipseRft.h" -#include "RiuMainPlotWindow.h" +#include "RiuPlotMainWindowTools.h" #include "RiuSelectionManager.h" #include "WellLogCommands/RicWellLogPlotCurveFeatureImpl.h" @@ -206,11 +206,11 @@ RimWellLogExtractionCurve* RicWellLogTools::addExtractionCurve(RimWellLogTrack* plotTrack->updateConnectedEditors(); // Make sure the summary plot window is created and visible - RiuMainPlotWindow* plotwindow = RiaApplication::instance()->getOrCreateAndShowMainPlotWindow(); + RiuPlotMainWindowTools::showPlotMainWindow(); RiaApplication::instance()->project()->updateConnectedEditors(); - plotwindow->selectAsCurrentItem(curve); + RiuPlotMainWindowTools::selectAsCurrentItem(curve); return curve; } @@ -254,11 +254,11 @@ RimWellLogRftCurve* RicWellLogTools::addRftCurve(RimWellLogTrack* plotTrack, con plotTrack->setFormationTrajectoryType(RimWellLogTrack::SIMULATION_WELL); plotTrack->updateConnectedEditors(); - RiuMainPlotWindow* plotwindow = RiaApplication::instance()->getOrCreateAndShowMainPlotWindow(); + RiuPlotMainWindowTools::showPlotMainWindow(); RiaApplication::instance()->project()->updateConnectedEditors(); - plotwindow->selectAsCurrentItem(curve); + RiuPlotMainWindowTools::selectAsCurrentItem(curve); return curve; } @@ -279,8 +279,8 @@ RimWellLogFileCurve* RicWellLogTools::addFileCurve(RimWellLogTrack* plotTrack) plotTrack->updateConnectedEditors(); - RiuMainPlotWindow* plotwindow = RiaApplication::instance()->getOrCreateAndShowMainPlotWindow(); - plotwindow->selectAsCurrentItem(curve); + RiuPlotMainWindowTools::showPlotMainWindow(); + RiuPlotMainWindowTools::selectAsCurrentItem(curve); return curve; } diff --git a/ApplicationCode/Commands/SummaryPlotCommands/RicNewGridTimeHistoryCurveFeature.cpp b/ApplicationCode/Commands/SummaryPlotCommands/RicNewGridTimeHistoryCurveFeature.cpp index 6994f24945..32ea6a52a3 100644 --- a/ApplicationCode/Commands/SummaryPlotCommands/RicNewGridTimeHistoryCurveFeature.cpp +++ b/ApplicationCode/Commands/SummaryPlotCommands/RicNewGridTimeHistoryCurveFeature.cpp @@ -36,7 +36,7 @@ #include "RimSummaryPlot.h" #include "RimSummaryPlotCollection.h" -#include "RiuMainPlotWindow.h" +#include "RiuPlotMainWindowTools.h" #include "RiuSelectionManager.h" #include "cafPdmReferenceHelper.h" @@ -71,7 +71,8 @@ void RicNewGridTimeHistoryCurveFeature::createCurveFromSelectionItem(const RiuSe plot->updateConnectedEditors(); - RiaApplication::instance()->getOrCreateAndShowMainPlotWindow()->selectAsCurrentItem(newCurve); + RiuPlotMainWindowTools::showPlotMainWindow(); + RiuPlotMainWindowTools::selectAsCurrentItem(newCurve); } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/Commands/SummaryPlotCommands/RicSummaryCurveCreator.cpp b/ApplicationCode/Commands/SummaryPlotCommands/RicSummaryCurveCreator.cpp index 9c3f3131b8..b1c9f20586 100644 --- a/ApplicationCode/Commands/SummaryPlotCommands/RicSummaryCurveCreator.cpp +++ b/ApplicationCode/Commands/SummaryPlotCommands/RicSummaryCurveCreator.cpp @@ -41,7 +41,7 @@ #include "RimSummaryPlotCollection.h" #include "RimSummaryCalculationCollection.h" -#include "RiuMainPlotWindow.h" +#include "RiuPlotMainWindowTools.h" #include "RiuSummaryCurveDefSelection.h" #include "RiuSummaryQwtPlot.h" #include "RiuTools.h" @@ -193,9 +193,10 @@ void RicSummaryCurveCreator::fieldChangedByUi(const caf::PdmFieldHandle* changed if (changedField == &m_okButtonField) { m_closeButtonField = true; - RiuMainPlotWindow* mainPlotWindow = RiaApplication::instance()->getOrCreateAndShowMainPlotWindow(); - mainPlotWindow->selectAsCurrentItem(m_targetPlot); - mainPlotWindow->setExpanded(m_targetPlot); + + RiuPlotMainWindowTools::showPlotMainWindow(); + RiuPlotMainWindowTools::selectAsCurrentItem(m_targetPlot); + RiuPlotMainWindowTools::setExpanded(m_targetPlot); } m_applyButtonField = false; diff --git a/ApplicationCode/Commands/ViewLink/RicSetMasterViewFeature.cpp b/ApplicationCode/Commands/ViewLink/RicSetMasterViewFeature.cpp index fd1c608383..1bed9c55c6 100644 --- a/ApplicationCode/Commands/ViewLink/RicSetMasterViewFeature.cpp +++ b/ApplicationCode/Commands/ViewLink/RicSetMasterViewFeature.cpp @@ -27,7 +27,7 @@ #include "RimViewLinker.h" #include "RimViewLinkerCollection.h" -#include "RiuMainWindow.h" +#include "Riu3DMainWindowTools.h" #include #include @@ -81,8 +81,8 @@ void RicSetMasterViewFeature::onActionTriggered(bool isChecked) proj->updateConnectedEditors(); // Set managed view collection to selected and expanded in project tree - RiuMainWindow::instance()->selectAsCurrentItem(viewLinker); - RiuMainWindow::instance()->setExpanded(viewLinker); + Riu3DMainWindowTools::selectAsCurrentItem(viewLinker); + Riu3DMainWindowTools::setExpanded(viewLinker); } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/Commands/ViewLink/RicShowLinkOptionsFeature.cpp b/ApplicationCode/Commands/ViewLink/RicShowLinkOptionsFeature.cpp index 4982b889d0..eea54abb91 100644 --- a/ApplicationCode/Commands/ViewLink/RicShowLinkOptionsFeature.cpp +++ b/ApplicationCode/Commands/ViewLink/RicShowLinkOptionsFeature.cpp @@ -24,7 +24,7 @@ #include "Rim3dView.h" #include "RimViewController.h" #include "RimViewLinker.h" -#include "RiuMainWindow.h" +#include "Riu3DMainWindowTools.h" #include "cafSelectionManager.h" @@ -61,7 +61,7 @@ void RicShowLinkOptionsFeature::onActionTriggered(bool isChecked) RimViewController* viewController = activeView->viewController(); - RiuMainWindow::instance()->selectAsCurrentItem(viewController); + Riu3DMainWindowTools::selectAsCurrentItem(viewController); } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/Commands/WellLogCommands/RicAddWellLogToPlotFeature.cpp b/ApplicationCode/Commands/WellLogCommands/RicAddWellLogToPlotFeature.cpp index c0ffe2aae4..6523e0ea54 100644 --- a/ApplicationCode/Commands/WellLogCommands/RicAddWellLogToPlotFeature.cpp +++ b/ApplicationCode/Commands/WellLogCommands/RicAddWellLogToPlotFeature.cpp @@ -32,7 +32,7 @@ #include "RimWellLogTrack.h" #include "RimWellPath.h" #include "RimWellPathCollection.h" -#include "RiuMainPlotWindow.h" +#include "RiuPlotMainWindowTools.h" #include "RigWellLogFile.h" @@ -109,8 +109,10 @@ void RicAddWellLogToPlotFeature::onActionTriggered(bool isChecked) plotTrack->viewer()->replot(); RiaApplication::instance()->project()->updateConnectedEditors(); - RiaApplication::instance()->getOrCreateAndShowMainPlotWindow()->selectAsCurrentItem(plot); - RiaApplication::instance()->getOrCreateAndShowMainPlotWindow()->setExpanded(plotTrack); + + RiuPlotMainWindowTools::showPlotMainWindow(); + RiuPlotMainWindowTools::selectAsCurrentItem(plot); + RiuPlotMainWindowTools::setExpanded(plotTrack); } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/Commands/WellLogCommands/RicNewRftPlotFeature.cpp b/ApplicationCode/Commands/WellLogCommands/RicNewRftPlotFeature.cpp index 11471315d5..3b964787eb 100644 --- a/ApplicationCode/Commands/WellLogCommands/RicNewRftPlotFeature.cpp +++ b/ApplicationCode/Commands/WellLogCommands/RicNewRftPlotFeature.cpp @@ -29,7 +29,7 @@ #include "RimWellPath.h" #include "RimWellRftPlot.h" -#include "RiuMainPlotWindow.h" +#include "RiuPlotMainWindowTools.h" #include "cafSelectionManagerTools.h" @@ -84,12 +84,9 @@ void RicNewRftPlotFeature::onActionTriggered(bool isChecked) rftPlot->loadDataAndUpdate(); rftPlotColl->updateConnectedEditors(); - RiuMainPlotWindow* mainPlotWindow = RiaApplication::instance()->getOrCreateAndShowMainPlotWindow(); - if (mainPlotWindow) - { - mainPlotWindow->setExpanded(plotTrack); - mainPlotWindow->selectAsCurrentItem(rftPlot); - } + RiuPlotMainWindowTools::showPlotMainWindow(); + RiuPlotMainWindowTools::setExpanded(plotTrack); + RiuPlotMainWindowTools::selectAsCurrentItem(rftPlot); } } diff --git a/ApplicationCode/ProjectDataModel/Completions/RimFishboneWellPathCollection.cpp b/ApplicationCode/ProjectDataModel/Completions/RimFishboneWellPathCollection.cpp index 093e007ee8..59507d5ff0 100644 --- a/ApplicationCode/ProjectDataModel/Completions/RimFishboneWellPathCollection.cpp +++ b/ApplicationCode/ProjectDataModel/Completions/RimFishboneWellPathCollection.cpp @@ -28,7 +28,7 @@ #include "RifWellPathImporter.h" -#include "RiuMainWindow.h" +#include "Riu3DMainWindowTools.h" CAF_PDM_SOURCE_INIT(RimFishboneWellPathCollection, "WellPathCompletionCollection"); @@ -133,7 +133,7 @@ void RimFishboneWellPathCollection::appendCompletion(RimFishboneWellPath* comple m_wellPaths.push_back(completion); updateConnectedEditors(); - RiuMainWindow::instance()->selectAsCurrentItem(completion); + Riu3DMainWindowTools::selectAsCurrentItem(completion); uiCapability()->setUiHidden(!m_wellPaths.empty()); diff --git a/ApplicationCode/ProjectDataModel/Completions/RimPerforationCollection.cpp b/ApplicationCode/ProjectDataModel/Completions/RimPerforationCollection.cpp index 59339ad035..f67766a70d 100644 --- a/ApplicationCode/ProjectDataModel/Completions/RimPerforationCollection.cpp +++ b/ApplicationCode/ProjectDataModel/Completions/RimPerforationCollection.cpp @@ -27,7 +27,7 @@ #include "RifWellPathImporter.h" -#include "RiuMainWindow.h" +#include "Riu3DMainWindowTools.h" CAF_PDM_SOURCE_INIT(RimPerforationCollection, "PerforationCollection"); @@ -81,7 +81,7 @@ void RimPerforationCollection::appendPerforation(RimPerforationInterval* perfora perforation->setUnitSystemSpecificDefaults(); updateConnectedEditors(); - RiuMainWindow::instance()->selectAsCurrentItem(perforation); + Riu3DMainWindowTools::selectAsCurrentItem(perforation); RimProject* proj; this->firstAncestorOrThisOfTypeAsserted(proj); diff --git a/ApplicationCode/ProjectDataModel/RimGridView.cpp b/ApplicationCode/ProjectDataModel/RimGridView.cpp index 815c564309..1ffa00080c 100644 --- a/ApplicationCode/ProjectDataModel/RimGridView.cpp +++ b/ApplicationCode/ProjectDataModel/RimGridView.cpp @@ -30,7 +30,7 @@ #include "RimViewLinker.h" #include "RimViewLinkerCollection.h" -#include "RiuMainWindow.h" +#include "Riu3DMainWindowTools.h" #include "cvfModel.h" #include "cvfScene.h" @@ -331,7 +331,7 @@ void RimGridView::fieldChangedByUi(const caf::PdmFieldHandle* changedField, cons //-------------------------------------------------------------------------------------------------- void RimGridView::selectOverlayInfoConfig() { - RiuMainWindow::instance()->selectAsCurrentItem(m_overlayInfoConfig); + Riu3DMainWindowTools::selectAsCurrentItem(m_overlayInfoConfig); } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/ProjectDataModel/Summary/RimObservedDataCollection.cpp b/ApplicationCode/ProjectDataModel/Summary/RimObservedDataCollection.cpp index 46ea1b73e3..f6ac04f011 100644 --- a/ApplicationCode/ProjectDataModel/Summary/RimObservedDataCollection.cpp +++ b/ApplicationCode/ProjectDataModel/Summary/RimObservedDataCollection.cpp @@ -31,7 +31,7 @@ #include "RimObservedEclipseUserData.h" #include "RimSummaryObservedDataFile.h" -#include "RiuMainPlotWindow.h" +#include "RiuPlotMainWindowTools.h" #include "cafUtils.h" #include "cafPdmSettings.h" @@ -130,12 +130,9 @@ RimObservedData* RimObservedDataCollection::createAndAddRsmObservedDataFromFile( errorText->append(observedData->errorMessagesFromReader()); } - RiuMainPlotWindow* mainPlotWindow = RiaApplication::instance()->getOrCreateAndShowMainPlotWindow(); - if (mainPlotWindow) - { - mainPlotWindow->selectAsCurrentItem(observedData); - mainPlotWindow->setExpanded(observedData); - } + RiuPlotMainWindowTools::showPlotMainWindow(); + RiuPlotMainWindowTools::selectAsCurrentItem(observedData); + RiuPlotMainWindowTools::setExpanded(observedData); this->updateConnectedEditors(); caf::PdmUiObjectEditorHandle::updateUiAllObjectEditors(); @@ -192,12 +189,9 @@ RimObservedData* RimObservedDataCollection::createAndAddCvsObservedDataFromFile( return nullptr; } - RiuMainPlotWindow* mainPlotWindow = RiaApplication::instance()->getOrCreateAndShowMainPlotWindow(); - if (mainPlotWindow) - { - mainPlotWindow->selectAsCurrentItem(userData); - mainPlotWindow->setExpanded(userData); - } + RiuPlotMainWindowTools::showPlotMainWindow(); + RiuPlotMainWindowTools::selectAsCurrentItem(userData); + RiuPlotMainWindowTools::setExpanded(userData); this->updateConnectedEditors(); caf::PdmUiObjectEditorHandle::updateUiAllObjectEditors(); diff --git a/ApplicationCode/ProjectDataModel/Summary/RimSummaryPlot.cpp b/ApplicationCode/ProjectDataModel/Summary/RimSummaryPlot.cpp index d614a88911..c7ac11d455 100644 --- a/ApplicationCode/ProjectDataModel/Summary/RimSummaryPlot.cpp +++ b/ApplicationCode/ProjectDataModel/Summary/RimSummaryPlot.cpp @@ -34,7 +34,7 @@ #include "RimSummaryPlotNameHelper.h" #include "RimSummaryTimeAxisProperties.h" -#include "RiuMainPlotWindow.h" +#include "RiuPlotMainWindowTools.h" #include "RiuSummaryQwtPlot.h" #include "cvfBase.h" @@ -176,24 +176,24 @@ RimSummaryTimeAxisProperties* RimSummaryPlot::timeAxisProperties() //-------------------------------------------------------------------------------------------------- void RimSummaryPlot::selectAxisInPropertyEditor(int axis) { - RiuMainPlotWindow* plotwindow = RiaApplication::instance()->getOrCreateAndShowMainPlotWindow(); + RiuPlotMainWindowTools::showPlotMainWindow(); if (axis == QwtPlot::yLeft) { - plotwindow->selectAsCurrentItem(m_leftYAxisProperties); + RiuPlotMainWindowTools::selectAsCurrentItem(m_leftYAxisProperties); } else if (axis == QwtPlot::yRight) { - plotwindow->selectAsCurrentItem(m_rightYAxisProperties); + RiuPlotMainWindowTools::selectAsCurrentItem(m_rightYAxisProperties); } else if (axis == QwtPlot::xBottom) { if (m_isCrossPlot) { - plotwindow->selectAsCurrentItem(m_bottomAxisProperties); + RiuPlotMainWindowTools::selectAsCurrentItem(m_bottomAxisProperties); } else { - plotwindow->selectAsCurrentItem(m_timeAxisProperties); + RiuPlotMainWindowTools::selectAsCurrentItem(m_timeAxisProperties); } } }