#2138 PLT Plot. Add context command to tree view and 3D objects

This commit is contained in:
Bjørn Erik Jensen 2017-11-14 11:37:03 +01:00
parent dc11cbd4c5
commit 440b10e381
3 changed files with 6 additions and 11 deletions

View File

@ -58,20 +58,15 @@ bool RicNewPltPlotFeature::isCommandEnabled()
if (RicWellLogPlotCurveFeatureImpl::parentWellAllocationPlot()) return false; if (RicWellLogPlotCurveFeatureImpl::parentWellAllocationPlot()) return false;
RimSimWellInView* simWell = caf::firstAncestorOfTypeFromSelectedObject<RimSimWellInView*>(); RimSimWellInView* simWell = caf::firstAncestorOfTypeFromSelectedObject<RimSimWellInView*>();
RimWellPath* rimWellPath = simWell == nullptr ? caf::firstAncestorOfTypeFromSelectedObject<RimWellPath*>() : nullptr;
bool enable = true; bool enable = true;
if (simWell != nullptr) if (simWell != nullptr)
{ {
RimEclipseResultCase* eclCase = caf::firstAncestorOfTypeFromSelectedObject<RimEclipseResultCase*>(); RimProject* proj = RiaApplication::instance()->project();
if (simWell != nullptr) QString simWellName = simWell->name();
{
enable &= RimWellPlotTools::hasFlowData(eclCase); RimWellPath* wellPath = proj->wellPathFromSimulationWell(simWellName);
} enable = wellPath != nullptr;
}
else if (rimWellPath)
{
enable &= RimWellPlotTools::hasFlowData(rimWellPath);
} }
return enable; return enable;
} }

View File

@ -235,7 +235,6 @@ QStringList RimContextCommandBuilder::commandsFromSelection()
commandIds << "RicNewWellLogFileCurveFeature"; commandIds << "RicNewWellLogFileCurveFeature";
commandIds << "RicNewWellLogCurveExtractionFeature"; commandIds << "RicNewWellLogCurveExtractionFeature";
commandIds << "RicNewWellPathIntersectionFeature"; commandIds << "RicNewWellPathIntersectionFeature";
commandIds << "RicNewRftPlotFeature";
} }
else if (dynamic_cast<RimWellLogFile*>(uiItem)) else if (dynamic_cast<RimWellLogFile*>(uiItem))
{ {

View File

@ -307,6 +307,7 @@ void RiuViewerCommands::displayContextMenu(QMouseEvent* event)
commandIds << "RicNewWellLogCurveExtractionFeature"; commandIds << "RicNewWellLogCurveExtractionFeature";
commandIds << "RicNewWellLogFileCurveFeature"; commandIds << "RicNewWellLogFileCurveFeature";
commandIds << "RicNewRftPlotFeature"; commandIds << "RicNewRftPlotFeature";
commandIds << "RicNewPltPlotFeature";
commandIds << "Separator"; commandIds << "Separator";
commandIds << "RicNewWellPathIntersectionFeature"; commandIds << "RicNewWellPathIntersectionFeature";
commandIds << "RicNewFishbonesSubsAtMeasuredDepthFeature"; commandIds << "RicNewFishbonesSubsAtMeasuredDepthFeature";