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()->setFixedMeasuredDepths( measuredDepths );
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->createWellPathGeometry();
if ( wellPathGroup )
{
@ -94,7 +103,8 @@ void RicNewWellPathLateralAtDepthFeature::onActionTriggered( bool isChecked )
}
else
{
wellPathCollection->addWellPath( newModeledWellPath, false );
bool importedWellPath = false;
wellPathCollection->addWellPath( newModeledWellPath, importedWellPath );
wellPathCollection->groupWellPaths( { wellPath, newModeledWellPath } );
}
newModeledWellPath->firstAncestorOrThisOfTypeAsserted( wellPathGroup );

View File

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

View File

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

View File

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

View File

@ -58,15 +58,15 @@ public:
void setFixedWellPathPoints( const std::vector<cvf::Vec3d>& points );
void setFixedMeasuredDepths( const std::vector<double>& mds );
std::vector<RimWellPathTarget*> createTargets( const std::vector<cvf::Vec3d>& points);
std::vector<RimWellPathTarget*> createTargets( const std::vector<cvf::Vec3d>& points );
std::pair<RimWellPathTarget*, RimWellPathTarget*>
findActiveTargetsAroundInsertionPoint( const RimWellPathTarget* targetToInsertBefore );
cvf::ref<RigWellPath> createWellPathGeometry();
void insertTarget( const RimWellPathTarget* targetToInsertBefore, RimWellPathTarget* targetToInsert );
void deleteTarget( RimWellPathTarget* targetTodelete );
void deleteAllTargets();
void insertTarget( const RimWellPathTarget* targetToInsertBefore, RimWellPathTarget* targetToInsert );
void deleteTarget( RimWellPathTarget* targetTodelete );
void deleteAllTargets();
RimWellPathTarget* appendTarget();
const RimWellPathTarget* firstActiveTarget() const;
@ -102,7 +102,6 @@ private:
RiaLineArcWellPathCalculator lineArcWellPathCalculator() const;
void updateTargetAtSeaLevel();
void test();
private:
caf::PdmField<cvf::Vec3d> m_referencePointUtmXyd;

View File

@ -37,7 +37,6 @@ CAF_PDM_SOURCE_INIT( RimWellPathGroup, "WellPathGroup" );
///
//--------------------------------------------------------------------------------------------------
RimWellPathGroup::RimWellPathGroup()
: wellPathAddedOrRemoved( this )
{
CAF_PDM_InitScriptableObjectWithNameAndComment( "Well Path Group",
":/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 trimmedCommonRoot = RiaTextStringTools::trimNonAlphaNumericCharacters( commonRoot );
@ -323,6 +336,9 @@ QString RimWellPathGroup::createGroupName() const
nameWithoutSpaces.remove( ' ' );
if ( nameWithoutSpaces.length() > 8 ) fullName = trimmedCommonRoot + trimmedCommonSuffix;
if ( fullName.isEmpty() ) fullName = "Well 1";
return fullName;
}

View File

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