mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Support for copying GeoMech case settings using new input (#6471)
* Support copy and replace geomech case, to support importing another data file, but keep the view setup * Make sure surfaces and intersections get updated with the correct separate result, too * Simplify/refactor code * Better naming
This commit is contained in:
@@ -880,7 +880,7 @@ bool RiaApplication::openOdbCaseFromFile( const QString& fileName, bool applyTim
|
||||
delete geoMechCase;
|
||||
return false;
|
||||
}
|
||||
geoMechModelCollection->cases.push_back( geoMechCase );
|
||||
geoMechModelCollection->addCase( geoMechCase );
|
||||
|
||||
progress.incrementProgress();
|
||||
progress.setProgressDescription( "Loading results information" );
|
||||
|
||||
@@ -6,6 +6,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RicCloseSummaryCaseFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicCloseSummaryCaseInCollectionFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicCloseObservedDataFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicCreateSummaryCaseCollectionFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicGeoMechCopyCaseFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicGeoMechPropertyFilterFeatureImpl.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicGeoMechPropertyFilterInsertFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicGeoMechPropertyFilterInsertExec.h
|
||||
@@ -99,6 +100,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RicCloseSummaryCaseFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicCloseSummaryCaseInCollectionFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicCloseObservedDataFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicCreateSummaryCaseCollectionFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicGeoMechCopyCaseFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicGeoMechPropertyFilterFeatureImpl.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicGeoMechPropertyFilterInsertFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicGeoMechPropertyFilterInsertExec.cpp
|
||||
|
||||
@@ -236,7 +236,7 @@ void RicCloseCaseFeature::deleteGeoMechCase( RimGeoMechCase* geoMechCase )
|
||||
RimGeoMechModels* models = ( activeOilField ) ? activeOilField->geoMechModels() : nullptr;
|
||||
if ( models )
|
||||
{
|
||||
models->cases.removeChildObject( geoMechCase );
|
||||
models->removeCase( geoMechCase );
|
||||
models->updateConnectedEditors();
|
||||
}
|
||||
|
||||
|
||||
89
ApplicationCode/Commands/RicGeoMechCopyCaseFeature.cpp
Normal file
89
ApplicationCode/Commands/RicGeoMechCopyCaseFeature.cpp
Normal file
@@ -0,0 +1,89 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2020- 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 "RicGeoMechCopyCaseFeature.h"
|
||||
|
||||
#include "RimGeoMechCase.h"
|
||||
#include "RimGeoMechModels.h"
|
||||
#include "RimOilField.h"
|
||||
#include "RimProject.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
#include "Riu3DMainWindowTools.h"
|
||||
#include "RiuFileDialogTools.h"
|
||||
|
||||
#include "cafSelectionManagerTools.h"
|
||||
#include "cafUtils.h"
|
||||
|
||||
#include <QAction>
|
||||
#include <QFileDialog>
|
||||
|
||||
CAF_CMD_SOURCE_INIT( RicGeoMechCopyCaseFeature, "RicGeoMechCopyCaseFeature" );
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicGeoMechCopyCaseFeature::isCommandEnabled()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicGeoMechCopyCaseFeature::onActionTriggered( bool isChecked )
|
||||
{
|
||||
RimGeoMechModels* coll = caf::SelectionManager::instance()->selectedItemAncestorOfType<RimGeoMechModels>();
|
||||
if ( coll )
|
||||
{
|
||||
// get the cases
|
||||
std::vector<RimGeoMechCase*> cases = caf::selectedObjectsByTypeStrict<RimGeoMechCase*>();
|
||||
|
||||
RimGeoMechCase* caseToSelect = nullptr;
|
||||
RiaApplication* app = RiaApplication::instance();
|
||||
QString defaultDir = app->lastUsedDialogDirectory( "GEOMECH_MODEL" );
|
||||
|
||||
for ( RimGeoMechCase* gmc : cases )
|
||||
{
|
||||
QString fileName = RiuFileDialogTools::getOpenFileName( nullptr,
|
||||
"Import Geo-Mechanical Model",
|
||||
defaultDir,
|
||||
"Abaqus results (*.odb)" );
|
||||
if ( fileName.isEmpty() ) break;
|
||||
|
||||
defaultDir = QFileInfo( fileName ).absolutePath();
|
||||
app->setLastUsedDialogDirectory( "GEOMECH_MODEL", defaultDir );
|
||||
|
||||
caseToSelect = coll->copyCase( gmc, fileName );
|
||||
}
|
||||
|
||||
if ( caseToSelect )
|
||||
{
|
||||
Riu3DMainWindowTools::selectAsCurrentItem( caseToSelect );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicGeoMechCopyCaseFeature::setupActionLook( QAction* actionToSetup )
|
||||
{
|
||||
actionToSetup->setIcon( QIcon( ":/Copy.png" ) );
|
||||
actionToSetup->setText( "Copy and Replace Input" );
|
||||
}
|
||||
35
ApplicationCode/Commands/RicGeoMechCopyCaseFeature.h
Normal file
35
ApplicationCode/Commands/RicGeoMechCopyCaseFeature.h
Normal file
@@ -0,0 +1,35 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2020- 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 RicGeoMechCopyCaseFeature : public caf::CmdFeature
|
||||
{
|
||||
CAF_CMD_HEADER_INIT;
|
||||
|
||||
protected:
|
||||
// Overrides
|
||||
bool isCommandEnabled() override;
|
||||
void onActionTriggered( bool isChecked ) override;
|
||||
void setupActionLook( QAction* actionToSetup ) override;
|
||||
};
|
||||
@@ -273,6 +273,8 @@ caf::CmdFeatureMenuBuilder RimContextCommandBuilder::commandsFromSelection()
|
||||
menuBuilder << "Separator";
|
||||
menuBuilder << "RicImportElementPropertyFeature";
|
||||
menuBuilder << "Separator";
|
||||
menuBuilder << "RicGeoMechCopyCaseFeature";
|
||||
menuBuilder << "Separator";
|
||||
}
|
||||
else if ( dynamic_cast<RimIdenticalGridCaseGroup*>( firstUiItem ) )
|
||||
{
|
||||
|
||||
@@ -301,6 +301,26 @@ RimGeoMechView* RimGeoMechCase::createCopyAndAddView( const RimGeoMechView* sour
|
||||
return rimGeoMechView;
|
||||
}
|
||||
|
||||
RimGeoMechCase* RimGeoMechCase::createCopy( const QString& newInputFileName )
|
||||
{
|
||||
RiaApplication* app = RiaApplication::instance();
|
||||
RimProject* project = app->project();
|
||||
|
||||
RimGeoMechCase* copycase = dynamic_cast<RimGeoMechCase*>(
|
||||
this->xmlCapability()->copyByXmlSerialization( caf::PdmDefaultObjectFactory::instance() ) );
|
||||
CVF_ASSERT( copycase );
|
||||
|
||||
QFileInfo filenameInfo( newInputFileName );
|
||||
QString newCaseName = filenameInfo.completeBaseName();
|
||||
|
||||
copycase->caseUserDescription.setValue( newCaseName + " (copy of " + caseUserDescription.value() + ")" );
|
||||
copycase->setGridFileName( newInputFileName );
|
||||
|
||||
project->assignCaseIdToCase( copycase );
|
||||
|
||||
return copycase;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -466,12 +486,9 @@ void RimGeoMechCase::initAfterRead()
|
||||
{
|
||||
RimCase::initAfterRead();
|
||||
|
||||
size_t j;
|
||||
for ( j = 0; j < geoMechViews().size(); j++ )
|
||||
for ( RimGeoMechView* riv : geoMechViews() )
|
||||
{
|
||||
RimGeoMechView* riv = geoMechViews()[j];
|
||||
CVF_ASSERT( riv );
|
||||
|
||||
riv->setGeoMechCase( this );
|
||||
}
|
||||
|
||||
|
||||
@@ -72,6 +72,8 @@ public:
|
||||
|
||||
CaseOpenStatus openGeoMechCase( std::string* errorMessage );
|
||||
|
||||
RimGeoMechCase* createCopy( const QString& newInputFileName );
|
||||
|
||||
RigGeoMechCaseData* geoMechData();
|
||||
const RigGeoMechCaseData* geoMechData() const;
|
||||
|
||||
|
||||
@@ -19,7 +19,14 @@
|
||||
|
||||
#include "RimGeoMechModels.h"
|
||||
|
||||
#include "RiaLogging.h"
|
||||
|
||||
#include "RimGeoMechCase.h"
|
||||
#include "RimGeoMechView.h"
|
||||
#include "RimGridView.h"
|
||||
#include "RimIntersectionCollection.h"
|
||||
#include "RimIntersectionResultDefinition.h"
|
||||
#include "RimIntersectionResultsDefinitionCollection.h"
|
||||
|
||||
CAF_PDM_SOURCE_INIT( RimGeoMechModels, "ResInsightGeoMechModels" );
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -29,8 +36,8 @@ RimGeoMechModels::RimGeoMechModels( void )
|
||||
{
|
||||
CAF_PDM_InitObject( "Geomechanical Models", ":/GeoMechCases48x48.png", "", "" );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &cases, "Cases", "", "", "", "" );
|
||||
cases.uiCapability()->setUiHidden( true );
|
||||
CAF_PDM_InitFieldNoDefault( &m_cases, "Cases", "", "", "", "" );
|
||||
m_cases.uiCapability()->setUiHidden( true );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -38,5 +45,74 @@ RimGeoMechModels::RimGeoMechModels( void )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimGeoMechModels::~RimGeoMechModels( void )
|
||||
{
|
||||
cases.deleteAllChildObjects();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RimGeoMechCase*> RimGeoMechModels::cases() const
|
||||
{
|
||||
return m_cases.childObjects();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimGeoMechModels::addCase( RimGeoMechCase* thecase )
|
||||
{
|
||||
m_cases.push_back( thecase );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimGeoMechModels::removeCase( RimGeoMechCase* thecase )
|
||||
{
|
||||
m_cases.removeChildObject( thecase );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimGeoMechCase* RimGeoMechModels::copyCase( RimGeoMechCase* thecase, const QString& newInputFileName )
|
||||
{
|
||||
std::vector<RimGeoMechCase*> newcases;
|
||||
|
||||
RimGeoMechCase* copy = thecase->createCopy( newInputFileName );
|
||||
if ( !copy )
|
||||
{
|
||||
RiaLogging::warning( "Could not create a copy of the geomech case" + thecase->caseUserDescription() +
|
||||
" using the new input file " + newInputFileName );
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
m_cases.push_back( copy );
|
||||
|
||||
copy->resolveReferencesRecursively();
|
||||
|
||||
copy->updateConnectedEditors();
|
||||
this->updateConnectedEditors();
|
||||
|
||||
for ( auto riv : copy->views() )
|
||||
{
|
||||
RimGridView* rgv = dynamic_cast<RimGridView*>( riv );
|
||||
if ( rgv )
|
||||
{
|
||||
rgv->loadDataAndUpdate();
|
||||
rgv->scheduleCreateDisplayModelAndRedraw();
|
||||
rgv->intersectionCollection()->scheduleCreateDisplayModelAndRedraw2dIntersectionViews();
|
||||
|
||||
for ( auto coll : rgv->separateIntersectionResultsCollection()->intersectionResultsDefinitions() )
|
||||
{
|
||||
coll->update2dIntersectionViews();
|
||||
}
|
||||
|
||||
for ( auto coll : rgv->separateSurfaceResultsCollection()->intersectionResultsDefinitions() )
|
||||
{
|
||||
coll->update2dIntersectionViews();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return copy;
|
||||
}
|
||||
|
||||
@@ -38,7 +38,12 @@ public:
|
||||
RimGeoMechModels( void );
|
||||
~RimGeoMechModels( void ) override;
|
||||
|
||||
caf::PdmChildArrayField<RimGeoMechCase*> cases;
|
||||
RimGeoMechCase* copyCase( RimGeoMechCase* thecase, const QString& newInputFileName );
|
||||
void removeCase( RimGeoMechCase* thecase );
|
||||
void addCase( RimGeoMechCase* thecase );
|
||||
|
||||
std::vector<RimGeoMechCase*> cases() const;
|
||||
|
||||
private:
|
||||
caf::PdmChildArrayField<RimGeoMechCase*> m_cases;
|
||||
};
|
||||
|
||||
@@ -145,14 +145,6 @@ RimGridView::~RimGridView( void )
|
||||
|
||||
proj->uiCapability()->updateConnectedEditors();
|
||||
}
|
||||
|
||||
delete this->m_overlayInfoConfig();
|
||||
|
||||
delete m_wellMeasurementCollection;
|
||||
delete m_rangeFilterCollection;
|
||||
delete m_overrideRangeFilterCollection;
|
||||
delete m_intersectionCollection;
|
||||
delete m_gridCollection;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -97,17 +97,25 @@ bool RimIntersectionResultDefinition::isActive() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimIntersectionResultDefinition::autoName() const
|
||||
void RimIntersectionResultDefinition::assignCaseIfMissing() const
|
||||
{
|
||||
QString timestepName;
|
||||
QString caseName = "Default undefined source";
|
||||
|
||||
if ( !m_case )
|
||||
{
|
||||
RimCase* ownerCase = nullptr;
|
||||
this->firstAncestorOrThisOfType( ownerCase );
|
||||
const_cast<RimIntersectionResultDefinition*>( this )->setActiveCase( ownerCase );
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimIntersectionResultDefinition::autoName() const
|
||||
{
|
||||
QString timestepName;
|
||||
QString caseName = "Default undefined source";
|
||||
|
||||
assignCaseIfMissing();
|
||||
|
||||
if ( m_case )
|
||||
{
|
||||
@@ -129,6 +137,7 @@ QString RimIntersectionResultDefinition::autoName() const
|
||||
}
|
||||
else if ( geomCase )
|
||||
{
|
||||
m_geomResultDefinition->setGeoMechCase( geomCase );
|
||||
resultVarUiName = m_geomResultDefinition->resultFieldUiName() + ":" +
|
||||
m_geomResultDefinition->resultComponentUiName();
|
||||
}
|
||||
@@ -150,11 +159,7 @@ RimCase* RimIntersectionResultDefinition::activeCase() const
|
||||
void RimIntersectionResultDefinition::setActiveCase( RimCase* activeCase )
|
||||
{
|
||||
m_case = activeCase;
|
||||
|
||||
RimGeoMechCase* geomCase = dynamic_cast<RimGeoMechCase*>( m_case.value() );
|
||||
m_geomResultDefinition->setGeoMechCase( geomCase );
|
||||
RimEclipseCase* eclipseCase = dynamic_cast<RimEclipseCase*>( m_case.value() );
|
||||
m_eclipseResultDefinition->setEclipseCase( eclipseCase );
|
||||
updateCaseInResultDefinitions();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -234,6 +239,8 @@ void RimIntersectionResultDefinition::updateLegendRangesTextAndVisibility( const
|
||||
RiuViewer* nativeOrOverrideViewer,
|
||||
bool isUsingOverrideViewer )
|
||||
{
|
||||
assignCaseIfMissing();
|
||||
|
||||
if ( !this->isInAction() ) return;
|
||||
|
||||
if ( ( this->isEclipseResultDefinition() && m_eclipseResultDefinition()->hasCategoryResult() ) ||
|
||||
@@ -316,12 +323,18 @@ void RimIntersectionResultDefinition::fieldChangedByUi( const caf::PdmFieldHandl
|
||||
const QVariant& oldValue,
|
||||
const QVariant& newValue )
|
||||
{
|
||||
bool reDraw = false;
|
||||
|
||||
assignCaseIfMissing();
|
||||
|
||||
if ( changedField == &m_case )
|
||||
{
|
||||
RimGeoMechCase* geomCase = dynamic_cast<RimGeoMechCase*>( m_case.value() );
|
||||
m_geomResultDefinition->setGeoMechCase( geomCase );
|
||||
RimEclipseCase* eclipseCase = dynamic_cast<RimEclipseCase*>( m_case.value() );
|
||||
m_eclipseResultDefinition->setEclipseCase( eclipseCase );
|
||||
|
||||
reDraw = true;
|
||||
}
|
||||
|
||||
this->updateConnectedEditors();
|
||||
@@ -339,6 +352,11 @@ void RimIntersectionResultDefinition::fieldChangedByUi( const caf::PdmFieldHandl
|
||||
obj->updateConnectedEditors();
|
||||
}
|
||||
|
||||
reDraw = true;
|
||||
}
|
||||
|
||||
if ( reDraw )
|
||||
{
|
||||
RimGridView* gridView = nullptr;
|
||||
this->firstAncestorOrThisOfType( gridView );
|
||||
if ( gridView ) gridView->scheduleCreateDisplayModelAndRedraw();
|
||||
@@ -355,6 +373,7 @@ void RimIntersectionResultDefinition::fieldChangedByUi( const caf::PdmFieldHandl
|
||||
void RimIntersectionResultDefinition::update2dIntersectionViews()
|
||||
{
|
||||
// Update 2D Intersection views
|
||||
updateCaseInResultDefinitions();
|
||||
|
||||
std::vector<RimExtrudedCurveIntersection*> intersections;
|
||||
this->objectsWithReferringPtrFieldsOfType( intersections );
|
||||
@@ -443,21 +462,28 @@ void RimIntersectionResultDefinition::defineUiTreeOrdering( caf::PdmUiTreeOrderi
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimIntersectionResultDefinition::initAfterRead()
|
||||
{
|
||||
RimGeoMechCase* geomCase = dynamic_cast<RimGeoMechCase*>( m_case.value() );
|
||||
RimEclipseCase* eclipseCase = dynamic_cast<RimEclipseCase*>( m_case.value() );
|
||||
|
||||
if ( eclipseCase )
|
||||
{
|
||||
m_eclipseResultDefinition->setEclipseCase( eclipseCase );
|
||||
}
|
||||
else if ( geomCase )
|
||||
{
|
||||
m_geomResultDefinition->setGeoMechCase( geomCase );
|
||||
}
|
||||
updateCaseInResultDefinitions();
|
||||
|
||||
this->updateUiIconFromToggleField();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimIntersectionResultDefinition::updateCaseInResultDefinitions()
|
||||
{
|
||||
if ( m_geomResultDefinition->geoMechCase() == nullptr )
|
||||
{
|
||||
RimGeoMechCase* geomCase = dynamic_cast<RimGeoMechCase*>( m_case.value() );
|
||||
m_geomResultDefinition->setGeoMechCase( geomCase );
|
||||
}
|
||||
if ( m_eclipseResultDefinition->eclipseCase() == nullptr )
|
||||
{
|
||||
RimEclipseCase* eclipseCase = dynamic_cast<RimEclipseCase*>( m_case.value() );
|
||||
m_eclipseResultDefinition->setEclipseCase( eclipseCase );
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -58,6 +58,8 @@ public:
|
||||
RiuViewer* nativeOrOverrideViewer,
|
||||
bool isUsingOverrideViewer );
|
||||
|
||||
void update2dIntersectionViews();
|
||||
|
||||
protected:
|
||||
virtual caf::PdmFieldHandle* userDescriptionField() override;
|
||||
virtual caf::PdmFieldHandle* objectToggleField() override;
|
||||
@@ -73,7 +75,8 @@ protected:
|
||||
virtual void initAfterRead() override;
|
||||
|
||||
private:
|
||||
void update2dIntersectionViews();
|
||||
void assignCaseIfMissing() const;
|
||||
void updateCaseInResultDefinitions();
|
||||
|
||||
caf::PdmField<bool> m_isActive;
|
||||
caf::PdmProxyValueField<QString> m_autoName;
|
||||
|
||||
@@ -98,11 +98,8 @@ void RimIntersectionResultsDefinitionCollection::fieldChangedByUi( const caf::Pd
|
||||
|
||||
RimGridView* gridView = nullptr;
|
||||
this->firstAncestorOrThisOfType( gridView );
|
||||
if ( gridView )
|
||||
{
|
||||
gridView->scheduleCreateDisplayModelAndRedraw();
|
||||
gridView->intersectionCollection()->scheduleCreateDisplayModelAndRedraw2dIntersectionViews();
|
||||
}
|
||||
if ( gridView ) gridView->scheduleCreateDisplayModelAndRedraw();
|
||||
if ( intersectionResultsDefinitions().size() > 0 ) intersectionResultsDefinitions()[0]->update2dIntersectionViews();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -688,9 +688,9 @@ void RimProject::allCases( std::vector<RimCase*>& cases ) const
|
||||
RimGeoMechModels* geomModels = oilField->geoMechModels();
|
||||
if ( geomModels )
|
||||
{
|
||||
for ( size_t caseIdx = 0; caseIdx < geomModels->cases.size(); caseIdx++ )
|
||||
for ( auto acase : geomModels->cases() )
|
||||
{
|
||||
cases.push_back( geomModels->cases[caseIdx] );
|
||||
cases.push_back( acase );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1223,9 +1223,9 @@ std::vector<RimGeoMechCase*> RimProject::geoMechCases() const
|
||||
RimGeoMechModels* geomModels = oilField->geoMechModels();
|
||||
if ( geomModels )
|
||||
{
|
||||
for ( size_t caseIdx = 0; caseIdx < geomModels->cases.size(); caseIdx++ )
|
||||
for ( auto acase : geomModels->cases() )
|
||||
{
|
||||
cases.push_back( geomModels->cases[caseIdx] );
|
||||
cases.push_back( acase );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user