#9323 Thermal Fracture: add python methods for importing fracture template.

Fixes #9323.
This commit is contained in:
Kristian Bendiksen committed 2022-10-06 10:07:37 +02:00
1 parent dc80f582bd
commit accf5713ac
7 files changed
+195 -3

No files matched your search

@@ -45,14 +45,22 @@ void RicPlaceThermalFractureUsingTemplateDataFeature::onActionTriggered( bool is
if ( !fracture->fractureTemplate() ) return;
placeUsingTemplateData( fracture );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicPlaceThermalFractureUsingTemplateDataFeature::placeUsingTemplateData( RimWellPathFracture* fracture )
{
RimThermalFractureTemplate* thermalTemplate = dynamic_cast<RimThermalFractureTemplate*>( fracture->fractureTemplate() );
if ( !thermalTemplate ) return;
if ( !thermalTemplate ) return false;
RimWellPath* wellPath = nullptr;
fracture->firstAncestorOrThisOfTypeAsserted( wellPath );
auto wellPathGeometry = wellPath->wellPathGeometry();
if ( !wellPathGeometry ) return;
if ( !wellPathGeometry ) return false;
auto [centerPosition, rotation] = thermalTemplate->computePositionAndRotation();
@@ -77,6 +85,7 @@ void RicPlaceThermalFractureUsingTemplateDataFeature::onActionTriggered( bool is
fracture->updateConnectedEditors();
RimProject* project = RimProject::current();
project->reloadCompletionTypeResultsInAllViews();
return true;
}
//--------------------------------------------------------------------------------------------------