mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#11248 Remove caching of simulation well coordinates to avoid state handling bugs
This commit is contained in:
parent
3689cccae7
commit
1217236d73
@ -457,7 +457,7 @@ void RimExtrudedCurveIntersection::fieldChangedByUi( const caf::PdmFieldHandle*
|
||||
|
||||
if ( changedField == &m_simulationWell || changedField == &m_isActive || changedField == &m_type )
|
||||
{
|
||||
recomputeSimulationWellBranchData();
|
||||
rebuildGeometryAndScheduleCreateDisplayModel();
|
||||
}
|
||||
|
||||
if ( changedField == &m_simulationWell || changedField == &m_wellPath || changedField == &m_branchIndex ||
|
||||
@ -546,12 +546,16 @@ void RimExtrudedCurveIntersection::defineUiOrdering( QString uiConfigName, caf::
|
||||
else if ( type() == CrossSectionEnum::CS_SIMULATION_WELL )
|
||||
{
|
||||
geometryGroup->add( &m_simulationWell );
|
||||
updateSimulationWellCenterline();
|
||||
if ( m_simulationWell() && m_simulationWellBranchCenterlines.size() > 1 )
|
||||
|
||||
if ( m_simulationWell() )
|
||||
{
|
||||
auto branchCenterLines = simulationWellBranchCenterlines();
|
||||
if ( branchCenterLines.size() > 1 )
|
||||
{
|
||||
geometryGroup->add( &m_branchIndex );
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ( type() == CrossSectionEnum::CS_POLYLINE )
|
||||
{
|
||||
geometryGroup->add( &m_userPolylineXydForUi );
|
||||
@ -705,9 +709,8 @@ QList<caf::PdmOptionItemInfo> RimExtrudedCurveIntersection::calculateValueOption
|
||||
}
|
||||
else if ( fieldNeedingOptions == &m_branchIndex )
|
||||
{
|
||||
updateSimulationWellCenterline();
|
||||
|
||||
size_t branchCount = m_simulationWellBranchCenterlines.size();
|
||||
auto branchCenterLines = simulationWellBranchCenterlines();
|
||||
size_t branchCount = branchCenterLines.size();
|
||||
|
||||
options.push_back( caf::PdmOptionItemInfo( "All", -1 ) );
|
||||
|
||||
@ -812,14 +815,16 @@ std::vector<std::vector<cvf::Vec3d>> RimExtrudedCurveIntersection::polyLines( cv
|
||||
{
|
||||
int branchIndexToUse = branchIndex();
|
||||
|
||||
if ( 0 <= branchIndexToUse && branchIndexToUse < static_cast<int>( m_simulationWellBranchCenterlines.size() ) )
|
||||
auto branchCenterLines = simulationWellBranchCenterlines();
|
||||
|
||||
if ( 0 <= branchIndexToUse && branchIndexToUse < static_cast<int>( branchCenterLines.size() ) )
|
||||
{
|
||||
lines.push_back( m_simulationWellBranchCenterlines[branchIndexToUse] );
|
||||
lines.push_back( branchCenterLines[branchIndexToUse] );
|
||||
}
|
||||
|
||||
if ( branchIndexToUse == -1 )
|
||||
{
|
||||
lines = m_simulationWellBranchCenterlines;
|
||||
lines = branchCenterLines;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -900,27 +905,6 @@ std::vector<cvf::Vec3d> RimExtrudedCurveIntersection::polyLinesForExtrusionDirec
|
||||
return m_customExtrusionPoints;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimExtrudedCurveIntersection::updateSimulationWellCenterline()
|
||||
{
|
||||
if ( m_isActive() && type() == CrossSectionEnum::CS_SIMULATION_WELL && m_simulationWell() )
|
||||
{
|
||||
if ( m_simulationWellBranchCenterlines.empty() )
|
||||
{
|
||||
auto simWells = m_simulationWell()->wellBranchesForVisualization();
|
||||
const auto& [coords, wellCells] = RigSimulationWellCenterLineCalculator::extractBranchData( simWells );
|
||||
|
||||
m_simulationWellBranchCenterlines = coords;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_simulationWellBranchCenterlines.clear();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -1019,7 +1003,8 @@ int RimExtrudedCurveIntersection::branchIndex() const
|
||||
return -1;
|
||||
}
|
||||
|
||||
if ( m_branchIndex >= static_cast<int>( m_simulationWellBranchCenterlines.size() ) )
|
||||
auto branchCenterLines = simulationWellBranchCenterlines();
|
||||
if ( m_branchIndex >= static_cast<int>( branchCenterLines.size() ) )
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
@ -1279,20 +1264,6 @@ double RimExtrudedCurveIntersection::extentLength()
|
||||
return m_extentLength();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimExtrudedCurveIntersection::recomputeSimulationWellBranchData()
|
||||
{
|
||||
if ( m_type() == CrossSectionEnum::CS_SIMULATION_WELL )
|
||||
{
|
||||
m_simulationWellBranchCenterlines.clear();
|
||||
updateSimulationWellCenterline();
|
||||
|
||||
m_crossSectionPartMgr = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -1426,3 +1397,16 @@ RimEclipseView* RimExtrudedCurveIntersection::eclipseView() const
|
||||
{
|
||||
return firstAncestorOrThisOfType<RimEclipseView>();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<std::vector<cvf::Vec3d>> RimExtrudedCurveIntersection::simulationWellBranchCenterlines() const
|
||||
{
|
||||
if ( !m_simulationWell() ) return {};
|
||||
|
||||
const auto simWells = m_simulationWell()->wellBranchesForVisualization();
|
||||
const auto& [branchCenterLines, wellCells] = RigSimulationWellCenterLineCalculator::extractBranchData( simWells );
|
||||
|
||||
return branchCenterLines;
|
||||
}
|
||||
|
@ -127,7 +127,6 @@ public:
|
||||
void setLengthUp( double heightUp );
|
||||
void setLengthDown( double heightDown );
|
||||
double extentLength();
|
||||
void recomputeSimulationWellBranchData();
|
||||
bool hasDefiningPoints() const;
|
||||
|
||||
std::vector<RimSurfaceIntersectionCurve*> surfaceIntersectionCurves() const;
|
||||
@ -152,7 +151,6 @@ private:
|
||||
|
||||
RimSimWellInViewCollection* simulationWellCollection() const;
|
||||
void updateAzimuthLine();
|
||||
void updateSimulationWellCenterline();
|
||||
void addExtents( std::vector<cvf::Vec3d>& polyLine ) const;
|
||||
void updateName();
|
||||
static double azimuthInRadians( cvf::Vec3d vec );
|
||||
@ -166,6 +164,8 @@ private:
|
||||
|
||||
RimEclipseView* eclipseView() const;
|
||||
|
||||
std::vector<std::vector<cvf::Vec3d>> simulationWellBranchCenterlines() const;
|
||||
|
||||
private:
|
||||
caf::PdmField<QString> m_name;
|
||||
|
||||
|
@ -295,17 +295,6 @@ std::vector<RimBoxIntersection*> RimIntersectionCollection::intersectionBoxes()
|
||||
return m_intersectionBoxes.childrenByType();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimIntersectionCollection::recomputeSimWellBranchData()
|
||||
{
|
||||
for ( const auto& intersection : intersections() )
|
||||
{
|
||||
intersection->recomputeSimulationWellBranchData();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -68,7 +68,6 @@ public:
|
||||
|
||||
void syncronize2dIntersectionViews();
|
||||
void scheduleCreateDisplayModelAndRedraw2dIntersectionViews();
|
||||
void recomputeSimWellBranchData();
|
||||
|
||||
bool shouldApplyCellFiltersToIntersections() const;
|
||||
|
||||
|
@ -49,7 +49,6 @@
|
||||
#include "RimEclipseInputPropertyCollection.h"
|
||||
#include "RimEclipseView.h"
|
||||
#include "RimFlowDiagSolution.h"
|
||||
#include "RimIntersectionCollection.h"
|
||||
#include "RimMockModelSettings.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimReservoirCellResultsStorage.h"
|
||||
@ -660,7 +659,6 @@ void RimEclipseResultCase::fieldChangedByUi( const caf::PdmFieldHandle* changedF
|
||||
{
|
||||
resView->scheduleSimWellGeometryRegen();
|
||||
resView->scheduleCreateDisplayModelAndRedraw();
|
||||
resView->intersectionCollection()->recomputeSimWellBranchData();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -31,7 +31,6 @@
|
||||
#include "RimEclipseContourMapView.h"
|
||||
#include "RimEclipseResultCase.h"
|
||||
#include "RimEclipseView.h"
|
||||
#include "RimIntersectionCollection.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimSimWellFractureCollection.h"
|
||||
#include "RimSimWellInView.h"
|
||||
@ -483,10 +482,7 @@ void RimSimWellInViewCollection::fieldChangedByUi( const caf::PdmFieldHandle* ch
|
||||
|
||||
if ( &wellPipeCoordType == changedField || &isAutoDetectingBranches == changedField )
|
||||
{
|
||||
if ( m_reservoirView )
|
||||
{
|
||||
m_reservoirView->intersectionCollection()->recomputeSimWellBranchData();
|
||||
}
|
||||
if ( m_reservoirView ) m_reservoirView->scheduleCreateDisplayModelAndRedraw();
|
||||
|
||||
for ( RimSimWellInView* w : wells )
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user