Modeled Well : Several view update issues (#7463)

This commit is contained in:
Magne Sjaastad 2021-03-05 15:19:55 +01:00 committed by GitHub
parent 6f3640ff78
commit c1f7f0f66f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 46 additions and 8 deletions

View File

@ -86,7 +86,16 @@ void RicNewWellPathLateralAtDepthFeature::onActionTriggered( bool isChecked )
newModeledWellPath->geometryDefinition()->setFixedWellPathPoints( pointVector ); newModeledWellPath->geometryDefinition()->setFixedWellPathPoints( pointVector );
newModeledWellPath->geometryDefinition()->setFixedMeasuredDepths( measuredDepths ); newModeledWellPath->geometryDefinition()->setFixedMeasuredDepths( measuredDepths );
newModeledWellPath->setName( wellPath->name() + QString( " md=%1" ).arg( wellPathSelItem->m_measuredDepth ) ); newModeledWellPath->setName( wellPath->name() + QString( " md=%1" ).arg( wellPathSelItem->m_measuredDepth ) );
{
RimWellPathTarget* newTarget = newModeledWellPath->geometryDefinition()->appendTarget();
auto lastPoint = pointVector.back();
auto tangent = lastPoint - pointVector[pointVector.size() - 2];
newTarget->setAsPointXYZAndTangentTarget( { lastPoint[0], lastPoint[1], lastPoint[2] }, tangent );
}
newModeledWellPath->geometryDefinition()->enableTargetPointPicking( true ); newModeledWellPath->geometryDefinition()->enableTargetPointPicking( true );
newModeledWellPath->createWellPathGeometry(); newModeledWellPath->createWellPathGeometry();
if ( wellPathGroup ) if ( wellPathGroup )
{ {
@ -94,7 +103,8 @@ void RicNewWellPathLateralAtDepthFeature::onActionTriggered( bool isChecked )
} }
else else
{ {
wellPathCollection->addWellPath( newModeledWellPath, false ); bool importedWellPath = false;
wellPathCollection->addWellPath( newModeledWellPath, importedWellPath );
wellPathCollection->groupWellPaths( { wellPath, newModeledWellPath } ); wellPathCollection->groupWellPaths( { wellPath, newModeledWellPath } );
} }
newModeledWellPath->firstAncestorOrThisOfTypeAsserted( wellPathGroup ); newModeledWellPath->firstAncestorOrThisOfTypeAsserted( wellPathGroup );

View File

@ -37,6 +37,9 @@
class RimMultipleValveLocations; class RimMultipleValveLocations;
class RimWellPath; class RimWellPath;
//==================================================================================================
///
//==================================================================================================
class RimWellPathValve : public RimCheckableNamedObject, public RimWellPathComponentInterface class RimWellPathValve : public RimCheckableNamedObject, public RimWellPathComponentInterface
{ {
CAF_PDM_HEADER_INIT; CAF_PDM_HEADER_INIT;

View File

@ -1029,6 +1029,8 @@ bool RimWellPath::isAssociatedWithSimulationWell() const
void RimWellPath::onChildDeleted( caf::PdmChildArrayFieldHandle* childArray, void RimWellPath::onChildDeleted( caf::PdmChildArrayFieldHandle* childArray,
std::vector<caf::PdmObjectHandle*>& referringObjects ) std::vector<caf::PdmObjectHandle*>& referringObjects )
{ {
RimProject::current()->reloadCompletionTypeResultsInAllViews();
updateConnectedEditors(); updateConnectedEditors();
} }

View File

@ -633,6 +633,11 @@ void RimWellPathGeometryDef::initAfterRead()
{ {
m_useAutoGeneratedTargetAtSeaLevel = false; m_useAutoGeneratedTargetAtSeaLevel = false;
} }
for ( auto wt : m_wellTargets )
{
if ( wt ) wt->moved.connect( this, &RimWellPathGeometryDef::onTargetMoved );
}
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

View File

@ -102,7 +102,6 @@ private:
RiaLineArcWellPathCalculator lineArcWellPathCalculator() const; RiaLineArcWellPathCalculator lineArcWellPathCalculator() const;
void updateTargetAtSeaLevel(); void updateTargetAtSeaLevel();
void test();
private: private:
caf::PdmField<cvf::Vec3d> m_referencePointUtmXyd; caf::PdmField<cvf::Vec3d> m_referencePointUtmXyd;

View File

@ -37,7 +37,6 @@ CAF_PDM_SOURCE_INIT( RimWellPathGroup, "WellPathGroup" );
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
RimWellPathGroup::RimWellPathGroup() RimWellPathGroup::RimWellPathGroup()
: wellPathAddedOrRemoved( this )
{ {
CAF_PDM_InitScriptableObjectWithNameAndComment( "Well Path Group", CAF_PDM_InitScriptableObjectWithNameAndComment( "Well Path Group",
":/WellPathGroup.svg", ":/WellPathGroup.svg",
@ -290,6 +289,20 @@ QString RimWellPathGroup::createGroupName() const
} }
} }
// if no imported well path is present, use all modeled well paths
if ( allNames.empty() )
{
std::vector<RimModeledWellPath*> descendantWellPaths;
this->descendantsOfType( descendantWellPaths );
for ( auto wellPath : descendantWellPaths )
{
if ( wellPath )
{
allNames.push_back( wellPath->name() );
}
}
}
QString commonRoot = RiaTextStringTools::commonRoot( allNames ); QString commonRoot = RiaTextStringTools::commonRoot( allNames );
QString trimmedCommonRoot = RiaTextStringTools::trimNonAlphaNumericCharacters( commonRoot ); QString trimmedCommonRoot = RiaTextStringTools::trimNonAlphaNumericCharacters( commonRoot );
@ -323,6 +336,9 @@ QString RimWellPathGroup::createGroupName() const
nameWithoutSpaces.remove( ' ' ); nameWithoutSpaces.remove( ' ' );
if ( nameWithoutSpaces.length() > 8 ) fullName = trimmedCommonRoot + trimmedCommonSuffix; if ( nameWithoutSpaces.length() > 8 ) fullName = trimmedCommonRoot + trimmedCommonSuffix;
if ( fullName.isEmpty() ) fullName = "Well 1";
return fullName; return fullName;
} }

View File

@ -25,10 +25,13 @@ class RimWellPathValve;
#include <QString> #include <QString>
//==================================================================================================
///
///
//==================================================================================================
class RimWellPathGroup : public RimWellPath class RimWellPathGroup : public RimWellPath
{ {
CAF_PDM_HEADER_INIT; CAF_PDM_HEADER_INIT;
caf::Signal<> wellPathAddedOrRemoved;
public: public:
RimWellPathGroup(); RimWellPathGroup();