#1597 Enable New fracture command on well path and show fracture collection only when fractures are present

This commit is contained in:
Bjørnar Grip Fjær 2017-06-20 13:38:27 +02:00
parent 7c99a2573a
commit 05d210df93
2 changed files with 17 additions and 1 deletions

View File

@ -145,5 +145,15 @@ RimWellPathFractureCollection* RicNewWellPathFractureFeature::selectedWellPathFr
objHandle->firstAncestorOrThisOfType(objToFind);
}
if (objToFind == nullptr)
{
std::vector<RimWellPath*> wellPaths;
caf::SelectionManager::instance()->objectsByType(&wellPaths);
if (!wellPaths.empty())
{
return wellPaths[0]->fractureCollection();
}
}
return objToFind;
}

View File

@ -105,7 +105,8 @@ bool RimWellPathCompletions::hasCompletions() const
{
return !fishbonesCollection()->fishbonesSubs().empty() ||
!fishbonesCollection()->wellPathCollection()->wellPaths().empty() ||
!perforationCollection()->perforations().empty();
!perforationCollection()->perforations().empty() ||
!fractureCollection()->fractures().empty();
}
//--------------------------------------------------------------------------------------------------
@ -133,4 +134,9 @@ void RimWellPathCompletions::defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTree
{
uiTreeOrdering.add(&m_fishbonesCollection);
}
if (!fractureCollection()->fractures().empty())
{
uiTreeOrdering.add(&m_fractureCollection);
}
}