#3459 Set initial start and end depth from well path

This commit is contained in:
Gaute Lindkvist
2018-10-05 10:26:26 +02:00
parent fbc49e2b02
commit 461e3b87b8
3 changed files with 32 additions and 7 deletions

View File

@@ -62,7 +62,14 @@ void RicNewWellPathAttributeFeature::onActionTriggered(bool isChecked)
{
RimWellPathAttributeCollection* attributeCollection = nullptr;
attributes[0]->firstAncestorOrThisOfTypeAsserted(attributeCollection);
attributeCollection->insertAttribute(attributes[0], new RimWellPathAttribute);
RimWellPathAttribute* attribute = new RimWellPathAttribute;
RimWellPath* wellPath = nullptr;
attributeCollection->firstAncestorOrThisOfTypeAsserted(wellPath);
attribute->setDepthsFromWellPath(wellPath);
attributeCollection->insertAttribute(attributes[0], attribute);
attributeCollection->updateAllRequiredEditors();
return;
}
@@ -74,7 +81,10 @@ void RicNewWellPathAttributeFeature::onActionTriggered(bool isChecked)
wellPath->descendantsIncludingThisOfType(attributeCollections);
if (!attributeCollections.empty())
{
attributeCollections[0]->insertAttribute(nullptr, new RimWellPathAttribute);
RimWellPathAttribute* attribute = new RimWellPathAttribute;
attribute->setDepthsFromWellPath(wellPath);
attributeCollections[0]->insertAttribute(nullptr, attribute);
attributeCollections[0]->updateAllRequiredEditors();
}
}