#1190 Do not show delete features for well allocation plot objects

This commit is contained in:
Magne Sjaastad 2017-02-09 08:34:28 +01:00
parent 9753e8b242
commit 6e901cdb12
2 changed files with 18 additions and 1 deletions

View File

@ -36,6 +36,7 @@
#include "RimSummaryCurveFilter.h"
#include "RimSummaryPlot.h"
#include "RimViewController.h"
#include "RimWellAllocationPlot.h"
#include "RimWellFlowRateCurve.h"
#include "RimWellLogCurve.h"
#include "RimWellLogPlot.h"
@ -56,7 +57,17 @@ namespace caf
bool isDeletable(PdmUiItem * uiItem)
{
if (dynamic_cast<RimWellFlowRateCurve*>(uiItem)) return false;
caf::PdmObjectHandle* destinationObject = dynamic_cast<caf::PdmObjectHandle*>(uiItem);
if (destinationObject)
{
RimWellAllocationPlot* wellAllocationPlot = nullptr;
destinationObject->firstAncestorOrThisOfType(wellAllocationPlot);
if (wellAllocationPlot)
{
return false;
}
}
if (dynamic_cast<RimGeoMechView*>(uiItem)) return true;
if (dynamic_cast<RimEclipseView*>(uiItem)) return true;

View File

@ -19,6 +19,8 @@
#include "RicDeleteWellLogPlotTrackFeature.h"
#include "RicWellLogPlotCurveFeatureImpl.h"
#include "RimWellLogTrack.h"
#include "RimWellLogPlot.h"
@ -34,6 +36,8 @@ CAF_CMD_SOURCE_INIT(RicDeleteWellLogPlotTrackFeature, "RicDeleteWellLogPlotTrack
//--------------------------------------------------------------------------------------------------
bool RicDeleteWellLogPlotTrackFeature::isCommandEnabled()
{
if (RicWellLogPlotCurveFeatureImpl::parentWellAllocationPlot()) return false;
std::vector<RimWellLogTrack*> selection;
caf::SelectionManager::instance()->objectsByType(&selection);
@ -55,6 +59,8 @@ bool RicDeleteWellLogPlotTrackFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
void RicDeleteWellLogPlotTrackFeature::onActionTriggered(bool isChecked)
{
if (RicWellLogPlotCurveFeatureImpl::parentWellAllocationPlot()) return;
std::vector<RimWellLogTrack*> selection;
caf::SelectionManager::instance()->objectsByType(&selection);