#2535 Use the MainWindowTools class instead of MainWindow directly (part 1)

This commit is contained in:
Jacob Støren
2018-02-27 15:21:14 +01:00
parent 43dc25eca0
commit d74807d669
29 changed files with 90 additions and 100 deletions

View File

@@ -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);

View File

@@ -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);
}
//--------------------------------------------------------------------------------------------------

View File

@@ -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);
}
//--------------------------------------------------------------------------------------------------

View File

@@ -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);
}
//--------------------------------------------------------------------------------------------------

View File

@@ -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);
}
//--------------------------------------------------------------------------------------------------

View File

@@ -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);
}
}

View File

@@ -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);
}
}
}

View File

@@ -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);
}
}
}

View File

@@ -41,7 +41,6 @@
#include "RiaSummaryTools.h"
#include "RiuMainPlotWindow.h"
#include "RiuMainWindow.h"
#include "cafSelectionManager.h"

View File

@@ -32,7 +32,7 @@
#include "RimProject.h"
#include "Rim3dView.h"
#include "RiuMainPlotWindow.h"
#include "RiuPlotMainWindowTools.h"
#include <QAction>
@@ -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());
}
}
}

View File

@@ -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());
}
}
}

View File

@@ -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);
}
//--------------------------------------------------------------------------------------------------

View File

@@ -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);

View File

@@ -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());
}
//--------------------------------------------------------------------------------------------------

View File

@@ -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);
}

View File

@@ -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);
}
}

View File

@@ -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);

View File

@@ -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;
}

View File

@@ -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);
}
//--------------------------------------------------------------------------------------------------

View File

@@ -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;

View File

@@ -27,7 +27,7 @@
#include "RimViewLinker.h"
#include "RimViewLinkerCollection.h"
#include "RiuMainWindow.h"
#include "Riu3DMainWindowTools.h"
#include <QAction>
#include <QTreeView>
@@ -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);
}
//--------------------------------------------------------------------------------------------------

View File

@@ -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);
}
//--------------------------------------------------------------------------------------------------

View File

@@ -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);
}
//--------------------------------------------------------------------------------------------------

View File

@@ -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);
}
}