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.
This commit is contained in:
Kristian Bendiksen 2022-06-17 14:10:20 +02:00
parent e7ff6f8a7b
commit b4e3586e2c
3 changed files with 1 additions and 121 deletions

View File

@ -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 <map>
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<RimWellPathFracture*> wellPathFractures;
RimWellPathCollection* wellPathCollection = RimTools::wellPathCollection();
wellPathCollection->descendantsIncludingThisOfType( wellPathFractures );
for ( RimWellPathFracture* fracture : wellPathFractures )
{
RimStimPlanFractureTemplate* stimPlanFractureTemplate =
dynamic_cast<RimStimPlanFractureTemplate*>( fracture->fractureTemplate() );
if ( stimPlanFractureTemplate )
{
if ( stimPlanFractureTemplate->showStimPlanMesh() == false )
{
setAllShowMeshToFalseOnAllEclipseViews = true;
break;
}
}
}
std::vector<RimEclipseView*> eclipseViews;
std::vector<RimCase*> rimCases;
proj->allCases( rimCases );
for ( RimCase* rimCase : rimCases )
{
for ( Rim3dView* view : rimCase->views() )
{
RimEclipseView* eclView = dynamic_cast<RimEclipseView*>( 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<RimStimPlanFractureTemplate*, bool> stimPlanFractureTemplatesInView;
std::vector<RimFracture*> fractures;
if ( eclipseView->wellCollection() )
{
eclipseView->wellCollection()->descendantsIncludingThisOfType( fractures );
}
if ( fractures.empty() ) continue;
for ( RimFracture* fracture : fractures )
{
RimStimPlanFractureTemplate* stimPlanFractureTemplate =
dynamic_cast<RimStimPlanFractureTemplate*>( 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 );
}
}
}
}
}
//--------------------------------------------------------------------------------------------------

View File

@ -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();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@ -95,8 +95,6 @@ public:
QString mapUiResultNameToFileResultName( const QString& uiResultName ) const;
bool showStimPlanMesh() const;
void convertToUnitSystem( RiaDefines::EclipseUnitSystem neededUnit ) override;
double formationDip() const;