mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#7824 Modeled Well Path : Optional support for linking of wells
#7824 Modeled Well Path : Add to context menu in 3D view
This commit is contained in:
parent
3a1f2c8a05
commit
a3d5847733
@ -22,6 +22,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RicNewWellPathLateralFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicPasteModeledWellPathFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicCreateMultipleWellPathLaterals.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicCreateMultipleWellPathLateralsUi.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicLinkWellPathFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/PointTangentManipulator/Ric3dObjectEditorHandle.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/PointTangentManipulator/RicPointTangentManipulator.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/PointTangentManipulator/RicWellTarget3dEditor.h
|
||||
@ -54,6 +55,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RicNewWellPathLateralFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicPasteModeledWellPathFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicCreateMultipleWellPathLaterals.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicCreateMultipleWellPathLateralsUi.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicLinkWellPathFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/PointTangentManipulator/Ric3dObjectEditorHandle.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/PointTangentManipulator/RicPointTangentManipulator.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/PointTangentManipulator/RicWellTarget3dEditor.cpp
|
||||
|
@ -24,6 +24,7 @@
|
||||
#include "RimCase.h"
|
||||
#include "RimModeledWellPath.h"
|
||||
#include "RimWellPathGeometryDef.h"
|
||||
#include "RimWellPathGeometryDefTools.h"
|
||||
#include "RimWellPathTarget.h"
|
||||
|
||||
#include "RiuViewer.h"
|
||||
@ -166,15 +167,19 @@ void RicWellTarget3dEditor::slotUpdated( const cvf::Vec3d& origin, const cvf::Ve
|
||||
auto relativePositionXYZ = domainCoordXYZ - geomDef->anchorPointXyz();
|
||||
auto delta = target->targetPointXYZ() - relativePositionXYZ;
|
||||
|
||||
auto currentRefPointXyz = geomDef->anchorPointXyz();
|
||||
auto newRefPointXyz = currentRefPointXyz - delta;
|
||||
geomDef->setReferencePointXyz( newRefPointXyz );
|
||||
geomDef->changed.send( false );
|
||||
geomDef->updateWellPathVisualization( true );
|
||||
for ( auto wt : geomDef->activeWellTargets() )
|
||||
// Find all linked wells and update with delta change
|
||||
|
||||
std::vector<RimWellPathGeometryDef*> linkedWellPathGeoDefs;
|
||||
if ( geomDef->isReferencePointUpdatesLinked() )
|
||||
{
|
||||
wt->updateConnectedEditors();
|
||||
linkedWellPathGeoDefs = RimWellPathGeometryDefTools::linkedDefinitions();
|
||||
}
|
||||
else
|
||||
{
|
||||
linkedWellPathGeoDefs.push_back( geomDef );
|
||||
}
|
||||
|
||||
RimWellPathGeometryDefTools::updateLinkedGeometryDefinitions( linkedWellPathGeoDefs, delta );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -0,0 +1,87 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2021- Equinor ASA
|
||||
//
|
||||
// ResInsight is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
// FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RicLinkWellPathFeature.h"
|
||||
|
||||
#include "RimModeledWellPath.h"
|
||||
#include "RimWellPathGeometryDef.h"
|
||||
|
||||
#include "Riu3dSelectionManager.h"
|
||||
|
||||
#include "cafSelectionManager.h"
|
||||
|
||||
#include <QAction>
|
||||
|
||||
CAF_CMD_SOURCE_INIT( RicLinkWellPathFeature, "RicLinkWellPathFeature" );
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicLinkWellPathFeature::isCommandEnabled()
|
||||
{
|
||||
return ( wellPathGeometryDef() != nullptr );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicLinkWellPathFeature::onActionTriggered( bool isChecked )
|
||||
{
|
||||
if ( auto geoDef = wellPathGeometryDef() )
|
||||
{
|
||||
geoDef->enableLinkOfReferencePointUpdates( isChecked );
|
||||
geoDef->updateConnectedEditors();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicLinkWellPathFeature::setupActionLook( QAction* actionToSetup )
|
||||
{
|
||||
QString text = "Link Reference Point";
|
||||
actionToSetup->setText( text );
|
||||
actionToSetup->setCheckable( true );
|
||||
actionToSetup->setChecked( isCommandChecked() );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicLinkWellPathFeature::isCommandChecked()
|
||||
{
|
||||
if ( auto geoDef = wellPathGeometryDef() )
|
||||
{
|
||||
return geoDef->isReferencePointUpdatesLinked();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimWellPathGeometryDef* RicLinkWellPathFeature::wellPathGeometryDef()
|
||||
{
|
||||
auto wellPathSelectionItem = RiuWellPathSelectionItem::wellPathSelectionItem();
|
||||
if ( wellPathSelectionItem && wellPathSelectionItem->m_wellpath )
|
||||
{
|
||||
auto modeledWellPath = dynamic_cast<RimModeledWellPath*>( wellPathSelectionItem->m_wellpath );
|
||||
return modeledWellPath->geometryDefinition();
|
||||
}
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2021- Equinor ASA
|
||||
//
|
||||
// ResInsight is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
// FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "cafCmdFeature.h"
|
||||
|
||||
class RimWellPathGeometryDef;
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
class RicLinkWellPathFeature : public caf::CmdFeature
|
||||
{
|
||||
CAF_CMD_HEADER_INIT;
|
||||
|
||||
public:
|
||||
bool isCommandEnabled() override;
|
||||
void onActionTriggered( bool isChecked ) override;
|
||||
void setupActionLook( QAction* actionToSetup ) override;
|
||||
bool isCommandChecked() override;
|
||||
|
||||
private:
|
||||
static RimWellPathGeometryDef* wellPathGeometryDef();
|
||||
};
|
@ -27,6 +27,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RimWellMeasurement.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimWellMeasurementCollection.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimWellMeasurementFilePath.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimWellPathGeometryDef.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimWellPathGeometryDefTools.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimWellPathAttribute.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimWellPathAttributeCollection.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimWellPathCollection.h
|
||||
@ -185,6 +186,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RimWellMeasurement.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimWellMeasurementCollection.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimWellMeasurementFilePath.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimWellPathGeometryDef.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimWellPathGeometryDefTools.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimWellPathAttribute.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimWellPathAttributeCollection.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimWellPathCollection.cpp
|
||||
|
@ -32,6 +32,7 @@
|
||||
|
||||
#include "RimModeledWellPath.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimWellPathGeometryDefTools.h"
|
||||
#include "RimWellPathTarget.h"
|
||||
|
||||
#include "RiuViewerCommands.h"
|
||||
@ -101,6 +102,14 @@ RimWellPathGeometryDef::RimWellPathGeometryDef()
|
||||
"",
|
||||
"" );
|
||||
|
||||
CAF_PDM_InitScriptableField( &m_linkReferencePointUpdates,
|
||||
"LinkReferencePointUpdates",
|
||||
false,
|
||||
"Link Reference Point Updates",
|
||||
"",
|
||||
"",
|
||||
"" );
|
||||
|
||||
CAF_PDM_InitScriptableFieldNoDefault( &m_autoTargetAtSeaLevel, "AutoGeneratedTarget", "Auto Generated Target", "", "", "" );
|
||||
m_autoTargetAtSeaLevel = new RimWellPathTarget;
|
||||
m_autoTargetAtSeaLevel->setEnabled( false );
|
||||
@ -168,6 +177,22 @@ void RimWellPathGeometryDef::enableReferencePointFromTopLevelWell( bool enable )
|
||||
m_useTopLevelWellReferencePoint = enable;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellPathGeometryDef::enableLinkOfReferencePointUpdates( bool enable )
|
||||
{
|
||||
m_linkReferencePointUpdates = enable;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimWellPathGeometryDef::isReferencePointUpdatesLinked() const
|
||||
{
|
||||
return m_linkReferencePointUpdates;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -478,6 +503,26 @@ void RimWellPathGeometryDef::fieldChangedByUi( const caf::PdmFieldHandle* change
|
||||
{
|
||||
this->updateConnectedEditors();
|
||||
}
|
||||
else if ( changedField == &m_referencePointUtmXyd )
|
||||
{
|
||||
if ( isReferencePointUpdatesLinked() )
|
||||
{
|
||||
auto linkedDefs = RimWellPathGeometryDefTools::linkedDefinitions();
|
||||
|
||||
// Remove this to avoid duplicate updates
|
||||
linkedDefs.erase( std::remove_if( linkedDefs.begin(),
|
||||
linkedDefs.end(),
|
||||
[this]( auto const& geoDef ) { return geoDef == this; } ),
|
||||
linkedDefs.end() );
|
||||
|
||||
cvf::Vec3d oldPos;
|
||||
caf::PdmValueFieldSpecialization<cvf::Vec3d>::setFromVariant( oldValue, oldPos );
|
||||
|
||||
auto delta = m_referencePointUtmXyd() - oldPos;
|
||||
|
||||
RimWellPathGeometryDefTools::updateLinkedGeometryDefinitions( linkedDefs, delta );
|
||||
}
|
||||
}
|
||||
|
||||
changed.send( false );
|
||||
}
|
||||
@ -488,15 +533,19 @@ void RimWellPathGeometryDef::fieldChangedByUi( const caf::PdmFieldHandle* change
|
||||
void RimWellPathGeometryDef::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering )
|
||||
{
|
||||
uiOrdering.add( &m_referencePointUtmXyd );
|
||||
uiOrdering.add( &m_useTopLevelWellReferencePoint );
|
||||
m_referencePointUtmXyd.uiCapability()->setUiReadOnly( m_useTopLevelWellReferencePoint );
|
||||
|
||||
if ( !m_isAttachedToParentWell )
|
||||
{
|
||||
uiOrdering.add( &m_linkReferencePointUpdates );
|
||||
uiOrdering.add( &m_airGap );
|
||||
uiOrdering.add( &m_mdAtFirstTarget );
|
||||
uiOrdering.add( &m_useAutoGeneratedTargetAtSeaLevel );
|
||||
}
|
||||
else
|
||||
{
|
||||
uiOrdering.add( &m_useTopLevelWellReferencePoint );
|
||||
}
|
||||
|
||||
auto group = uiOrdering.addNewGroup( "Well Target Appearance" );
|
||||
group->add( &m_showSpheres );
|
||||
|
@ -54,6 +54,8 @@ public:
|
||||
void setReferencePointXyz( const cvf::Vec3d& refPointXyz );
|
||||
bool useReferencePointFromTopLevelWell() const;
|
||||
void enableReferencePointFromTopLevelWell( bool enable );
|
||||
void enableLinkOfReferencePointUpdates( bool enable );
|
||||
bool isReferencePointUpdatesLinked() const;
|
||||
|
||||
double airGap() const;
|
||||
void setAirGap( double airGap );
|
||||
@ -125,6 +127,7 @@ private:
|
||||
caf::PdmChildArrayField<RimWellPathTarget*> m_wellTargets;
|
||||
caf::PdmField<bool> m_showAbsolutePosForWellTargets;
|
||||
caf::PdmField<bool> m_useTopLevelWellReferencePoint;
|
||||
caf::PdmField<bool> m_linkReferencePointUpdates;
|
||||
|
||||
caf::PdmField<bool> m_useAutoGeneratedTargetAtSeaLevel;
|
||||
caf::PdmChildField<RimWellPathTarget*> m_autoTargetAtSeaLevel;
|
||||
|
@ -0,0 +1,68 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2021 Equinor ASA
|
||||
//
|
||||
// ResInsight is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
// FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RimWellPathGeometryDefTools.h"
|
||||
|
||||
#include "RimModeledWellPath.h"
|
||||
#include "RimTools.h"
|
||||
#include "RimWellPathCollection.h"
|
||||
#include "RimWellPathGeometryDef.h"
|
||||
#include "RimWellPathTarget.h"
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellPathGeometryDefTools::updateLinkedGeometryDefinitions( std::vector<RimWellPathGeometryDef*>& definitions,
|
||||
cvf::Vec3d delta )
|
||||
{
|
||||
for ( auto wellPathGeoDef : definitions )
|
||||
{
|
||||
auto currentRefPointXyz = wellPathGeoDef->anchorPointXyz();
|
||||
auto newRefPointXyz = currentRefPointXyz - delta;
|
||||
|
||||
wellPathGeoDef->setReferencePointXyz( newRefPointXyz );
|
||||
|
||||
wellPathGeoDef->changed.send( false );
|
||||
wellPathGeoDef->updateWellPathVisualization( true );
|
||||
for ( auto wt : wellPathGeoDef->activeWellTargets() )
|
||||
{
|
||||
wt->updateConnectedEditors();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RimWellPathGeometryDef*> RimWellPathGeometryDefTools::linkedDefinitions()
|
||||
{
|
||||
std::vector<RimWellPathGeometryDef*> linkedWellPathGeoDefs;
|
||||
|
||||
for ( auto w : RimTools::wellPathCollection()->allWellPaths() )
|
||||
{
|
||||
auto modeledWellPath = dynamic_cast<RimModeledWellPath*>( w );
|
||||
if ( !modeledWellPath ) continue;
|
||||
|
||||
if ( modeledWellPath->geometryDefinition()->isReferencePointUpdatesLinked() )
|
||||
{
|
||||
linkedWellPathGeoDefs.push_back( modeledWellPath->geometryDefinition() );
|
||||
}
|
||||
}
|
||||
|
||||
return linkedWellPathGeoDefs;
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2021 Equinor ASA
|
||||
//
|
||||
// ResInsight is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
// FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
#pragma once
|
||||
|
||||
class RimWellPathGeometryDefTools
|
||||
{
|
||||
public:
|
||||
static void updateLinkedGeometryDefinitions( std::vector<RimWellPathGeometryDef*>& definitions, cvf::Vec3d delta );
|
||||
|
||||
static std::vector<RimWellPathGeometryDef*> linkedDefinitions();
|
||||
};
|
@ -553,6 +553,7 @@ void RiuViewerCommands::displayContextMenu( QMouseEvent* event )
|
||||
menuBuilder.addSeparator();
|
||||
menuBuilder << "RicNewWellPathLateralAtDepthFeature";
|
||||
menuBuilder << "RicNewWellPathIntersectionFeature";
|
||||
menuBuilder << "RicLinkWellPathFeature";
|
||||
}
|
||||
|
||||
const RivSimWellPipeSourceInfo* eclipseWellSourceInfo =
|
||||
|
Loading…
Reference in New Issue
Block a user