From b4e3586e2cec63c4ca573f72d2143bc61c3b3024 Mon Sep 17 00:00:00 2001 From: Kristian Bendiksen Date: Fri, 17 Jun 2022 14:10:20 +0200 Subject: [PATCH] Janitor: StimPlanFractureTemplate: Remove use of obsolete field. Might turn on mesh display for some StimPlan fractures in projects older than v2018.1.0.103. The "show mesh" has been controlled by RimStimPlanColors since 2018. --- .../RimFractureTemplateCollection.cpp | 111 ------------------ .../RimStimPlanFractureTemplate.cpp | 9 +- .../Completions/RimStimPlanFractureTemplate.h | 2 - 3 files changed, 1 insertion(+), 121 deletions(-) diff --git a/ApplicationLibCode/ProjectDataModel/Completions/RimFractureTemplateCollection.cpp b/ApplicationLibCode/ProjectDataModel/Completions/RimFractureTemplateCollection.cpp index 6d87884fcb..ab2084eea7 100644 --- a/ApplicationLibCode/ProjectDataModel/Completions/RimFractureTemplateCollection.cpp +++ b/ApplicationLibCode/ProjectDataModel/Completions/RimFractureTemplateCollection.cpp @@ -22,7 +22,6 @@ #include "RigStatisticsMath.h" -#include "RigEclipseCaseData.h" #include "RimCase.h" #include "RimEclipseCase.h" #include "RimEclipseView.h" @@ -30,21 +29,11 @@ #include "RimFracture.h" #include "RimFractureTemplate.h" #include "RimProject.h" -#include "RimSimWellInViewCollection.h" -#include "RimStimPlanColors.h" #include "RimStimPlanFractureTemplate.h" -#include "RimTools.h" -#include "RimWellPath.h" -#include "RimWellPathCollection.h" -#include "RimWellPathFracture.h" -#include "RimWellPathFractureCollection.h" -#include "cafPdmFieldScriptingCapability.h" #include "cafPdmObject.h" #include "cafPdmObjectScriptingCapability.h" -#include - CAF_PDM_SOURCE_INIT( RimFractureTemplateCollection, "FractureTemplateCollection", "FractureDefinitionCollection" ); //-------------------------------------------------------------------------------------------------- @@ -317,106 +306,6 @@ void RimFractureTemplateCollection::initAfterRead() { if ( templ->id() < 0 ) templ->setId( nextFractureTemplateId() ); } - - RimProject* proj = nullptr; - this->firstAncestorOrThisOfType( proj ); - if ( proj && proj->isProjectFileVersionEqualOrOlderThan( "2018.1.0.103" ) ) - { - bool setAllShowMeshToFalseOnAllEclipseViews = false; - - std::vector wellPathFractures; - RimWellPathCollection* wellPathCollection = RimTools::wellPathCollection(); - wellPathCollection->descendantsIncludingThisOfType( wellPathFractures ); - - for ( RimWellPathFracture* fracture : wellPathFractures ) - { - RimStimPlanFractureTemplate* stimPlanFractureTemplate = - dynamic_cast( fracture->fractureTemplate() ); - if ( stimPlanFractureTemplate ) - { - if ( stimPlanFractureTemplate->showStimPlanMesh() == false ) - { - setAllShowMeshToFalseOnAllEclipseViews = true; - break; - } - } - } - - std::vector eclipseViews; - - std::vector rimCases; - proj->allCases( rimCases ); - - for ( RimCase* rimCase : rimCases ) - { - for ( Rim3dView* view : rimCase->views() ) - { - RimEclipseView* eclView = dynamic_cast( view ); - if ( eclView ) - { - eclipseViews.push_back( eclView ); - } - } - } - - for ( RimEclipseView* eclipseView : eclipseViews ) - { - if ( setAllShowMeshToFalseOnAllEclipseViews ) - { - eclipseView->fractureColors()->setShowStimPlanMesh( false ); - continue; - } - - // Find all fractures in all simWells - std::map stimPlanFractureTemplatesInView; - - std::vector fractures; - if ( eclipseView->wellCollection() ) - { - eclipseView->wellCollection()->descendantsIncludingThisOfType( fractures ); - } - if ( fractures.empty() ) continue; - - for ( RimFracture* fracture : fractures ) - { - RimStimPlanFractureTemplate* stimPlanFractureTemplate = - dynamic_cast( fracture->fractureTemplate() ); - if ( stimPlanFractureTemplate ) - { - stimPlanFractureTemplatesInView[stimPlanFractureTemplate]; - } - } - - if ( stimPlanFractureTemplatesInView.empty() ) continue; - - auto templateIt = stimPlanFractureTemplatesInView.begin(); - - if ( stimPlanFractureTemplatesInView.size() == 1 ) - { - eclipseView->fractureColors()->setShowStimPlanMesh( templateIt->first->showStimPlanMesh() ); - } - else - { - bool anySetShowStimPlanMeshIsSetToFalse = false; - for ( ; templateIt != stimPlanFractureTemplatesInView.end(); templateIt++ ) - { - if ( templateIt->first->showStimPlanMesh() == false ) - { - anySetShowStimPlanMeshIsSetToFalse = true; - break; - } - } - if ( anySetShowStimPlanMeshIsSetToFalse ) - { - eclipseView->fractureColors()->setShowStimPlanMesh( false ); - } - else - { - eclipseView->fractureColors()->setShowStimPlanMesh( true ); - } - } - } - } } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/ProjectDataModel/Completions/RimStimPlanFractureTemplate.cpp b/ApplicationLibCode/ProjectDataModel/Completions/RimStimPlanFractureTemplate.cpp index 01bb2c6688..bca9c76949 100644 --- a/ApplicationLibCode/ProjectDataModel/Completions/RimStimPlanFractureTemplate.cpp +++ b/ApplicationLibCode/ProjectDataModel/Completions/RimStimPlanFractureTemplate.cpp @@ -99,6 +99,7 @@ RimStimPlanFractureTemplate::RimStimPlanFractureTemplate() CAF_PDM_InitField( &m_showStimPlanMesh_OBSOLETE, "ShowStimPlanMesh", true, "" ); m_showStimPlanMesh_OBSOLETE.uiCapability()->setUiHidden( true ); + m_showStimPlanMesh_OBSOLETE.xmlCapability()->setIOWritable( false ); m_readError = false; @@ -782,14 +783,6 @@ QString RimStimPlanFractureTemplate::mapUiResultNameToFileResultName( const QStr return fileResultName; } -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -bool RimStimPlanFractureTemplate::showStimPlanMesh() const -{ - return m_showStimPlanMesh_OBSOLETE(); -} - //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/ProjectDataModel/Completions/RimStimPlanFractureTemplate.h b/ApplicationLibCode/ProjectDataModel/Completions/RimStimPlanFractureTemplate.h index 4c2dd0c085..f1290b2e62 100644 --- a/ApplicationLibCode/ProjectDataModel/Completions/RimStimPlanFractureTemplate.h +++ b/ApplicationLibCode/ProjectDataModel/Completions/RimStimPlanFractureTemplate.h @@ -95,8 +95,6 @@ public: QString mapUiResultNameToFileResultName( const QString& uiResultName ) const; - bool showStimPlanMesh() const; - void convertToUnitSystem( RiaDefines::EclipseUnitSystem neededUnit ) override; double formationDip() const;