#1597 Hide completions for well paths that have none, and enable commands to add new ones on well path directly

This commit is contained in:
Bjørnar Grip Fjær
2017-06-16 15:36:59 +02:00
parent 95ef92a9af
commit d5d7625864
6 changed files with 98 additions and 12 deletions

View File

@@ -74,6 +74,7 @@ void RicNewPerforationIntervalFeature::onActionTriggered(bool isChecked)
//--------------------------------------------------------------------------------------------------
void RicNewPerforationIntervalFeature::setupActionLook(QAction* actionToSetup)
{
actionToSetup->setIcon(QIcon(":/PerforationInterval16x16.png"));
actionToSetup->setText("New Perforation Interval");
}
@@ -92,5 +93,15 @@ RimPerforationCollection* RicNewPerforationIntervalFeature::selectedPerforationC
objHandle->firstAncestorOrThisOfType(objToFind);
}
if (objToFind == nullptr)
{
std::vector<RimWellPath*> wellPaths;
caf::SelectionManager::instance()->objectsByType(&wellPaths);
if (!wellPaths.empty())
{
return wellPaths[0]->perforationIntervalCollection();
}
}
return objToFind;
}