#1190 Make sure well log features are disabled for well allocation objects

This commit is contained in:
Magne Sjaastad 2017-02-07 09:34:11 +01:00
parent b8e838614c
commit 4313409c57
8 changed files with 46 additions and 2 deletions

View File

@ -41,6 +41,8 @@ CAF_CMD_SOURCE_INIT(RicExportToLasFileFeature, "RicExportToLasFileFeature");
//--------------------------------------------------------------------------------------------------
bool RicExportToLasFileFeature::isCommandEnabled()
{
if (RicWellLogPlotCurveFeatureImpl::parentWellAllocationPlot()) return false;
return RicWellLogPlotCurveFeatureImpl::selectedWellLogCurves().size() > 0;
}
@ -49,6 +51,8 @@ bool RicExportToLasFileFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
void RicExportToLasFileFeature::onActionTriggered(bool isChecked)
{
if (RicWellLogPlotCurveFeatureImpl::parentWellAllocationPlot()) return;
std::vector<RimWellLogCurve*> curves = RicWellLogPlotCurveFeatureImpl::selectedWellLogCurves();
if (curves.size() == 0) return;

View File

@ -37,6 +37,8 @@ CAF_CMD_SOURCE_INIT(RicChangeDataSourceFeature, "RicChangeDataSourceFeature");
//--------------------------------------------------------------------------------------------------
bool RicChangeDataSourceFeature::isCommandEnabled()
{
if (RicWellLogPlotCurveFeatureImpl::parentWellAllocationPlot()) return false;
std::vector<RimWellLogExtractionCurve*> extrCurves = extractionCurves();
return extrCurves.size() > 0;
@ -47,6 +49,8 @@ bool RicChangeDataSourceFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
void RicChangeDataSourceFeature::onActionTriggered(bool isChecked)
{
if (RicWellLogPlotCurveFeatureImpl::parentWellAllocationPlot()) return;
std::vector<RimWellLogExtractionCurve*> extrCurves = extractionCurves();
if (extrCurves.size() == 0) return;

View File

@ -47,6 +47,8 @@ CAF_CMD_SOURCE_INIT(RicNewWellLogCurveExtractionFeature, "RicNewWellLogCurveExtr
//--------------------------------------------------------------------------------------------------
bool RicNewWellLogCurveExtractionFeature::isCommandEnabled()
{
if (RicWellLogPlotCurveFeatureImpl::parentWellAllocationPlot()) return false;
return (selectedWellLogPlotTrack() != NULL || selectedWellPath() != NULL) && caseAvailable();
}
@ -55,6 +57,8 @@ bool RicNewWellLogCurveExtractionFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
void RicNewWellLogCurveExtractionFeature::onActionTriggered(bool isChecked)
{
if (RicWellLogPlotCurveFeatureImpl::parentWellAllocationPlot()) return;
RimWellLogTrack* wellLogPlotTrack = selectedWellLogPlotTrack();
if (wellLogPlotTrack)
{

View File

@ -19,11 +19,12 @@
#include "RicNewWellLogPlotTrackFeature.h"
#include "RicNewWellLogCurveExtractionFeature.h"
#include "RicWellLogPlotCurveFeatureImpl.h"
#include "RimWellLogPlot.h"
#include "RimWellLogTrack.h"
#include "RicNewWellLogCurveExtractionFeature.h"
#include "cafSelectionManager.h"
#include <QAction>
@ -36,6 +37,8 @@ CAF_CMD_SOURCE_INIT(RicNewWellLogPlotTrackFeature, "RicNewWellLogPlotTrackFeatur
//--------------------------------------------------------------------------------------------------
bool RicNewWellLogPlotTrackFeature::isCommandEnabled()
{
if (RicWellLogPlotCurveFeatureImpl::parentWellAllocationPlot()) return false;
return selectedWellLogPlot() != NULL;
}
@ -44,6 +47,8 @@ bool RicNewWellLogPlotTrackFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
void RicNewWellLogPlotTrackFeature::onActionTriggered(bool isChecked)
{
if (RicWellLogPlotCurveFeatureImpl::parentWellAllocationPlot()) return;
RimWellLogPlot* wellLogPlot = selectedWellLogPlot();
if (wellLogPlot)
{

View File

@ -17,6 +17,7 @@
/////////////////////////////////////////////////////////////////////////////////
#include "RicPasteWellLogCurveFeature.h"
#include "RicWellLogPlotCurveFeatureImpl.h"
#include "OperationsUsingObjReferences/RicPasteFeatureImpl.h"
@ -41,6 +42,8 @@ CAF_CMD_SOURCE_INIT(RicPasteWellLogCurveFeature, "RicPasteWellLogCurveFeature");
//--------------------------------------------------------------------------------------------------
bool RicPasteWellLogCurveFeature::isCommandEnabled()
{
if (RicWellLogPlotCurveFeatureImpl::parentWellAllocationPlot()) return false;
caf::PdmObjectHandle* destinationObject = dynamic_cast<caf::PdmObjectHandle*>(caf::SelectionManager::instance()->selectedItem());
RimWellLogTrack* wellLogTrack = nullptr;
@ -58,6 +61,8 @@ bool RicPasteWellLogCurveFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
void RicPasteWellLogCurveFeature::onActionTriggered(bool isChecked)
{
if (RicWellLogPlotCurveFeatureImpl::parentWellAllocationPlot()) return;
caf::PdmObjectHandle* destinationObject = dynamic_cast<caf::PdmObjectHandle*>(caf::SelectionManager::instance()->selectedItem());
RimWellLogTrack* wellLogTrack = nullptr;

View File

@ -19,6 +19,7 @@
#include "RicPasteWellLogTrackFeature.h"
#include "OperationsUsingObjReferences/RicPasteFeatureImpl.h"
#include "RicWellLogPlotCurveFeatureImpl.h"
#include "RimWellLogPlot.h"
#include "RimWellLogTrack.h"
@ -39,6 +40,8 @@ CAF_CMD_SOURCE_INIT(RicPasteWellLogTrackFeature, "RicPasteWellLogTrackFeature");
//--------------------------------------------------------------------------------------------------
bool RicPasteWellLogTrackFeature::isCommandEnabled()
{
if (RicWellLogPlotCurveFeatureImpl::parentWellAllocationPlot()) return false;
caf::PdmObjectHandle* destinationObject = dynamic_cast<caf::PdmObjectHandle*>(caf::SelectionManager::instance()->selectedItem());
RimWellLogPlot* wellLogPlot = nullptr;
@ -56,6 +59,8 @@ bool RicPasteWellLogTrackFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
void RicPasteWellLogTrackFeature::onActionTriggered(bool isChecked)
{
if (RicWellLogPlotCurveFeatureImpl::parentWellAllocationPlot()) return;
caf::PdmObjectHandle* destinationObject = dynamic_cast<caf::PdmObjectHandle*>(caf::SelectionManager::instance()->selectedItem());
RimWellLogPlot* wellLogPlot = nullptr;

View File

@ -19,6 +19,7 @@
#include "RicWellLogPlotCurveFeatureImpl.h"
#include "RimWellAllocationPlot.h"
#include "RimWellLogCurve.h"
#include "cafSelectionManager.h"
@ -92,3 +93,17 @@ std::vector<RimWellLogCurve*> RicWellLogPlotCurveFeatureImpl::selectedWellLogCur
return allCurves;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimWellAllocationPlot* RicWellLogPlotCurveFeatureImpl::parentWellAllocationPlot()
{
caf::PdmObjectHandle* destinationObject = dynamic_cast<caf::PdmObjectHandle*>(caf::SelectionManager::instance()->selectedItem());
if (!destinationObject) return nullptr;
RimWellAllocationPlot* wellAllocationPlot = nullptr;
destinationObject->firstAncestorOrThisOfType(wellAllocationPlot);
return wellAllocationPlot;
}

View File

@ -22,6 +22,7 @@
#include "cafPdmFieldCvfColor.h"
class RimWellLogCurve;
class RimWellAllocationPlot;
//==================================================================================================
///
@ -31,4 +32,5 @@ class RicWellLogPlotCurveFeatureImpl
public:
static cvf::Color3f curveColorFromTable();
static std::vector<RimWellLogCurve*> selectedWellLogCurves();
static RimWellAllocationPlot* parentWellAllocationPlot();
};