#1174 Added Show contributing wells from 3D view

This commit is contained in:
Magne Sjaastad 2017-02-21 09:49:27 +01:00
parent 91a962ab21
commit b2ec4e055f
4 changed files with 21 additions and 36 deletions

View File

@ -8,12 +8,14 @@ set (SOURCE_GROUP_HEADER_FILES
${CEE_CURRENT_LIST_DIR}RicShowWellAllocationPlotFeature.h
${CEE_CURRENT_LIST_DIR}RicAddStoredWellAllocationPlotFeature.h
${CEE_CURRENT_LIST_DIR}RicShowContributingWellsFromPlotFeature.h
${CEE_CURRENT_LIST_DIR}RicShowContributingWellsFeature.h
)
set (SOURCE_GROUP_SOURCE_FILES
${CEE_CURRENT_LIST_DIR}RicShowWellAllocationPlotFeature.cpp
${CEE_CURRENT_LIST_DIR}RicAddStoredWellAllocationPlotFeature.cpp
${CEE_CURRENT_LIST_DIR}RicShowContributingWellsFromPlotFeature.cpp
${CEE_CURRENT_LIST_DIR}RicShowContributingWellsFeature.cpp
)
list(APPEND CODE_HEADER_FILES

View File

@ -16,28 +16,18 @@
//
/////////////////////////////////////////////////////////////////////////////////
#include "RicShowWellAllocationPlotFeature.h"
#include "RicShowContributingWellsFeature.h"
#include "RiaApplication.h"
#include "RimEclipseWell.h"
#include "RimFlowPlotCollection.h"
#include "RimMainPlotCollection.h"
#include "RimProject.h"
#include "RimWellAllocationPlot.h"
#include "RiuMainPlotWindow.h"
#include "cafSelectionManager.h"
#include "cafCmdFeatureManager.h"
#include <QAction>
CAF_CMD_SOURCE_INIT(RicShowWellAllocationPlotFeature, "RicShowWellAllocationPlotFeature");
CAF_CMD_SOURCE_INIT(RicShowContributingWellsFeature, "RicShowContributingWellsFeature");
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicShowWellAllocationPlotFeature::isCommandEnabled()
bool RicShowContributingWellsFeature::isCommandEnabled()
{
return true;
}
@ -45,27 +35,21 @@ bool RicShowWellAllocationPlotFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicShowWellAllocationPlotFeature::onActionTriggered(bool isChecked)
void RicShowContributingWellsFeature::onActionTriggered(bool isChecked)
{
std::vector<RimEclipseWell*> collection;
caf::SelectionManager::instance()->objectsByType(&collection);
// First, shot the well allocation plot
// Then, use the feature to show contributing wells as this is based on the previous feature
if (collection.size() > 0)
std::vector<std::string> commandIds;
commandIds.push_back("RicShowWellAllocationPlotFeature");
commandIds.push_back("RicShowContributingWellsFromPlotFeature");
for (auto commandId : commandIds)
{
RimEclipseWell* eclWell = collection[0];
if (RiaApplication::instance()->project())
auto* feature = caf::CmdFeatureManager::instance()->getCommandFeature(commandId);
if (feature)
{
RimFlowPlotCollection* flowPlotColl = RiaApplication::instance()->project()->mainPlotCollection->flowPlotCollection();
if (flowPlotColl)
{
flowPlotColl->defaultPlot()->setFromSimulationWell(eclWell);
flowPlotColl->defaultPlot()->updateConnectedEditors();
// Make sure the summary plot window is created and visible
RiuMainPlotWindow* plotwindow = RiaApplication::instance()->getOrCreateAndShowMainPlotWindow();
plotwindow->selectAsCurrentItem(flowPlotColl->defaultPlot());
}
feature->actionTriggered(false);
}
}
}
@ -73,8 +57,8 @@ void RicShowWellAllocationPlotFeature::onActionTriggered(bool isChecked)
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicShowWellAllocationPlotFeature::setupActionLook(QAction* actionToSetup)
void RicShowContributingWellsFeature::setupActionLook(QAction* actionToSetup)
{
actionToSetup->setIcon(QIcon(":/new_icon16x16.png"));
actionToSetup->setText("Show Well Allocation Plot");
actionToSetup->setText("Show Contributing Wells");
}

View File

@ -20,13 +20,11 @@
#include "cafCmdFeature.h"
class RimEclipseWell;
//==================================================================================================
///
//==================================================================================================
class RicShowWellAllocationPlotFeature : public caf::CmdFeature
class RicShowContributingWellsFeature : public caf::CmdFeature
{
CAF_CMD_HEADER_INIT;

View File

@ -309,6 +309,7 @@ void RiuViewerCommands::displayContextMenu(QMouseEvent* event)
commandIds << "RicNewSimWellIntersectionFeature";
commandIds << "RicShowWellAllocationPlotFeature";
commandIds << "RicShowContributingWellsFeature";
}
}