(#468) Showing well log plot context menu items only when a well path is picked

This commit is contained in:
Pål Hagen 2015-09-22 13:14:08 +02:00
parent 430ea86962
commit ff1f7b24b5

View File

@ -204,16 +204,25 @@ void RiuViewerCommands::displayContextMenu(QMouseEvent* event)
} }
// Well log curve creation commands // Well log curve creation commands
if (firstHitPart && firstHitPart->sourceInfo())
{ {
RicNewWellLogFileCurveFeature* newWellLogFileCurveFeature = dynamic_cast<RicNewWellLogFileCurveFeature*>(caf::CmdFeatureManager::instance()->getCommandFeature("RicNewWellLogFileCurveFeature")); const RivWellPathSourceInfo* wellPathSourceInfo = dynamic_cast<const RivWellPathSourceInfo*>(firstHitPart->sourceInfo());
CVF_ASSERT(newWellLogFileCurveFeature); if (wellPathSourceInfo)
{
menu.addAction(newWellLogFileCurveFeature->action()); RimWellPath* wellPath = wellPathSourceInfo->wellPath();
if (wellPath)
{
RicNewWellLogFileCurveFeature* newWellLogFileCurveFeature = dynamic_cast<RicNewWellLogFileCurveFeature*>(caf::CmdFeatureManager::instance()->getCommandFeature("RicNewWellLogFileCurveFeature"));
CVF_ASSERT(newWellLogFileCurveFeature);
RicNewWellLogCurveExtractionFeature* newExtractionCurveFeature = dynamic_cast<RicNewWellLogCurveExtractionFeature*>(caf::CmdFeatureManager::instance()->getCommandFeature("RicNewWellLogCurveExtractionFeature")); menu.addAction(newWellLogFileCurveFeature->action());
CVF_ASSERT(newExtractionCurveFeature);
menu.addAction(newExtractionCurveFeature->action()); RicNewWellLogCurveExtractionFeature* newExtractionCurveFeature = dynamic_cast<RicNewWellLogCurveExtractionFeature*>(caf::CmdFeatureManager::instance()->getCommandFeature("RicNewWellLogCurveExtractionFeature"));
CVF_ASSERT(newExtractionCurveFeature);
menu.addAction(newExtractionCurveFeature->action());
}
}
} }
// View Link commands // View Link commands