mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#950 Fixed formation name changes updating for geomech views
This commit is contained in:
@@ -35,6 +35,10 @@
|
|||||||
#include "RimTools.h"
|
#include "RimTools.h"
|
||||||
#include "RimWellLogPlotCollection.h"
|
#include "RimWellLogPlotCollection.h"
|
||||||
#include "RimFormationNames.h"
|
#include "RimFormationNames.h"
|
||||||
|
#include "RimGeoMechPropertyFilterCollection.h"
|
||||||
|
#include "RimGeoMechCellColors.h"
|
||||||
|
#include "RimGeoMechResultDefinition.h"
|
||||||
|
#include "RimGeoMechPropertyFilter.h"
|
||||||
|
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
|
|
||||||
@@ -122,7 +126,14 @@ bool RimGeoMechCase::openGeoMechCase(std::string* errorMessage)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
this->updateFormationNamesData();
|
if ( activeFormationNames() )
|
||||||
|
{
|
||||||
|
m_geoMechCaseData->femPartResults()->setActiveFormationNames(activeFormationNames()->formationNamesData());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_geoMechCaseData->femPartResults()->setActiveFormationNames(nullptr);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return fileOpenSuccess;
|
return fileOpenSuccess;
|
||||||
}
|
}
|
||||||
@@ -299,8 +310,41 @@ void RimGeoMechCase::updateFormationNamesData()
|
|||||||
std::vector<RimView*> views = this->views();
|
std::vector<RimView*> views = this->views();
|
||||||
for(RimView* view : views)
|
for(RimView* view : views)
|
||||||
{
|
{
|
||||||
if(view && view->isUsingFormationNames())
|
RimGeoMechView* geomView = dynamic_cast<RimGeoMechView*>(view);
|
||||||
|
|
||||||
|
if ( geomView && geomView->isUsingFormationNames() )
|
||||||
{
|
{
|
||||||
|
if ( !activeFormationNames() )
|
||||||
|
{
|
||||||
|
if ( geomView->cellResult()->resultPositionType() == RIG_FORMATION_NAMES )
|
||||||
|
{
|
||||||
|
geomView->cellResult()->setResultAddress(RigFemResultAddress(RIG_FORMATION_NAMES, "", ""));
|
||||||
|
geomView->cellResult()->updateConnectedEditors();
|
||||||
|
}
|
||||||
|
|
||||||
|
RimGeoMechPropertyFilterCollection* eclFilColl = geomView->geoMechPropertyFilterCollection();
|
||||||
|
for ( RimGeoMechPropertyFilter* propFilter : eclFilColl->propertyFilters )
|
||||||
|
{
|
||||||
|
if ( propFilter->resultDefinition()->resultPositionType() == RIG_FORMATION_NAMES )
|
||||||
|
{
|
||||||
|
propFilter->resultDefinition()->setResultAddress(RigFemResultAddress(RIG_FORMATION_NAMES, "", ""));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
RimGeoMechPropertyFilterCollection* eclFilColl = geomView->geoMechPropertyFilterCollection();
|
||||||
|
for ( RimGeoMechPropertyFilter* propFilter : eclFilColl->propertyFilters )
|
||||||
|
{
|
||||||
|
if ( propFilter->resultDefinition->resultPositionType() == RIG_FORMATION_NAMES )
|
||||||
|
{
|
||||||
|
propFilter->setToDefaultValues();
|
||||||
|
propFilter->updateConnectedEditors();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
geomView->cellResult()->updateConnectedEditors();
|
||||||
|
|
||||||
|
view->scheduleGeometryRegen(PROPERTY_FILTERED);
|
||||||
view->scheduleCreateDisplayModelAndRedraw();
|
view->scheduleCreateDisplayModelAndRedraw();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -118,6 +118,24 @@ bool RimGeoMechPropertyFilterCollection::hasActiveDynamicFilters() const
|
|||||||
return hasActiveFilters();
|
return hasActiveFilters();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
bool RimGeoMechPropertyFilterCollection::isUsingFormationNames() const
|
||||||
|
{
|
||||||
|
if ( !isActive ) return false;
|
||||||
|
|
||||||
|
for ( size_t i = 0; i < propertyFilters.size(); i++ )
|
||||||
|
{
|
||||||
|
RimGeoMechPropertyFilter* propertyFilter = propertyFilters[i];
|
||||||
|
if ( propertyFilter->isActive()
|
||||||
|
&& propertyFilter->resultDefinition->resultPositionType() == RIG_FORMATION_NAMES
|
||||||
|
&& propertyFilter->resultDefinition->resultFieldName() != "") return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ public:
|
|||||||
// Methods
|
// Methods
|
||||||
bool hasActiveFilters() const;
|
bool hasActiveFilters() const;
|
||||||
bool hasActiveDynamicFilters() const;
|
bool hasActiveDynamicFilters() const;
|
||||||
|
bool isUsingFormationNames() const;
|
||||||
|
|
||||||
void loadAndInitializePropertyFilters();
|
void loadAndInitializePropertyFilters();
|
||||||
void updateIconState();
|
void updateIconState();
|
||||||
|
|||||||
@@ -672,7 +672,9 @@ void RimGeoMechView::axisLabels(cvf::String* xLabel, cvf::String* yLabel, cvf::S
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
bool RimGeoMechView::isUsingFormationNames() const
|
bool RimGeoMechView::isUsingFormationNames() const
|
||||||
{
|
{
|
||||||
return cellResult()->hasCategoryResult(); // Correct for now
|
if (cellResult()->hasCategoryResult()) return true; // Correct for now
|
||||||
|
|
||||||
|
return geoMechPropertyFilterCollection()->isUsingFormationNames();
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user