#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;
RimSimWellInView* simWell = caf::firstAncestorOfTypeFromSelectedObject<RimSimWellInView*>();
RimWellPath* rimWellPath = simWell == nullptr ? caf::firstAncestorOfTypeFromSelectedObject<RimWellPath*>() : nullptr;
bool enable = true;
if (simWell != nullptr)
{
RimEclipseResultCase* eclCase = caf::firstAncestorOfTypeFromSelectedObject<RimEclipseResultCase*>();
if (simWell != nullptr)
{
enable &= RimWellPlotTools::hasFlowData(eclCase);
}
}
else if (rimWellPath)
{
enable &= RimWellPlotTools::hasFlowData(rimWellPath);
RimProject* proj = RiaApplication::instance()->project();
QString simWellName = simWell->name();
RimWellPath* wellPath = proj->wellPathFromSimulationWell(simWellName);
enable = wellPath != nullptr;
}
return enable;
}

View File

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

View File

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