mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#8115 3D View : Add checkbox to GeoMech color result
This commit is contained in:
parent
736f3a45ed
commit
a5be5b6b61
@ -149,18 +149,23 @@ std::vector<RigEclipseResultAddress> RiaMemoryCleanup::selectedEclipseResults()
|
||||
std::set<RigFemResultAddress> RiaMemoryCleanup::findGeoMechCaseResultsInUse() const
|
||||
{
|
||||
std::set<RigFemResultAddress> resultsInUse;
|
||||
RimGeoMechCase* geoMechCase = dynamic_cast<RimGeoMechCase*>( m_case() );
|
||||
|
||||
auto geoMechCase = dynamic_cast<RimGeoMechCase*>( m_case() );
|
||||
if ( geoMechCase )
|
||||
{
|
||||
std::vector<RimFemResultObserver*> geoMechResults;
|
||||
geoMechCase->descendantsIncludingThisOfType( geoMechResults );
|
||||
for ( RimFemResultObserver* resultDef : geoMechResults )
|
||||
{
|
||||
caf::PdmField<bool>* field = dynamic_cast<caf::PdmField<bool>*>( resultDef->objectToggleField() );
|
||||
if ( !field || ( *field )() )
|
||||
auto pdmObj = dynamic_cast<caf::PdmObject*>( resultDef );
|
||||
if ( pdmObj )
|
||||
{
|
||||
std::vector<RigFemResultAddress> required = resultDef->observedResults();
|
||||
resultsInUse.insert( required.begin(), required.end() );
|
||||
auto field = dynamic_cast<caf::PdmField<bool>*>( pdmObj->objectToggleField() );
|
||||
if ( !field || ( *field )() )
|
||||
{
|
||||
std::vector<RigFemResultAddress> required = resultDef->observedResults();
|
||||
resultsInUse.insert( required.begin(), required.end() );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -36,7 +36,6 @@ add_library(
|
||||
RigFemResultAddress.h
|
||||
RigFemResultPosEnum.h
|
||||
RimFemResultObserver.h
|
||||
RimFemResultObserver.cpp
|
||||
RigHexGradientTools.h
|
||||
RigHexGradientTools.cpp
|
||||
RigFemPartResultCalculator.h
|
||||
|
@ -1,3 +0,0 @@
|
||||
#include "RimFemResultObserver.h"
|
||||
|
||||
CAF_PDM_ABSTRACT_SOURCE_INIT( RimFemResultObserver, "RimFemResultObserver" );
|
@ -18,16 +18,12 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "cafPdmObject.h"
|
||||
|
||||
#include <vector>
|
||||
|
||||
class RigFemResultAddress;
|
||||
|
||||
class RimFemResultObserver : public caf::PdmObject
|
||||
class RimFemResultObserver
|
||||
{
|
||||
CAF_PDM_HEADER_INIT;
|
||||
|
||||
public:
|
||||
virtual std::vector<RigFemResultAddress> observedResults() const = 0;
|
||||
};
|
||||
};
|
||||
|
@ -384,7 +384,7 @@ void RimGeoMechResultDefinition::fieldChangedByUi( const caf::PdmFieldHandle* ch
|
||||
|
||||
if ( &m_resultVariableUiField == changedField || &m_compactionRefLayerUiField == changedField ||
|
||||
&m_timeLapseBaseTimestep == changedField || &m_normalizeByHydrostaticPressure == changedField ||
|
||||
&m_normalizationAirGap == changedField || &m_referenceTimeStep == changedField )
|
||||
&m_normalizationAirGap == changedField || &m_referenceTimeStep == changedField || &m_isChecked == changedField )
|
||||
{
|
||||
QStringList fieldComponentNames = m_resultVariableUiField().split( QRegExp( "\\s+" ) );
|
||||
if ( fieldComponentNames.size() > 0 )
|
||||
@ -671,6 +671,8 @@ RigFemResultPosEnum RimGeoMechResultDefinition::resultPositionType() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimGeoMechResultDefinition::resultFieldName() const
|
||||
{
|
||||
if ( !isChecked() ) return "";
|
||||
|
||||
return m_resultFieldName();
|
||||
}
|
||||
|
||||
|
@ -20,8 +20,11 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "RigFemResultPosEnum.h"
|
||||
#include "RimCheckableObject.h"
|
||||
#include "RimFemResultObserver.h"
|
||||
|
||||
#include "RigFemResultPosEnum.h"
|
||||
|
||||
#include "cafAppEnum.h"
|
||||
#include "cafPdmField.h"
|
||||
#include "cafPdmObject.h"
|
||||
@ -38,7 +41,7 @@ class RimRegularLegendConfig;
|
||||
///
|
||||
///
|
||||
//==================================================================================================
|
||||
class RimGeoMechResultDefinition : public RimFemResultObserver
|
||||
class RimGeoMechResultDefinition : public RimFemResultObserver, public RimCheckableObject
|
||||
{
|
||||
CAF_PDM_HEADER_INIT;
|
||||
|
||||
|
@ -37,7 +37,7 @@ class RimRegularLegendConfig;
|
||||
///
|
||||
///
|
||||
//==================================================================================================
|
||||
class RimTensorResults : public RimFemResultObserver
|
||||
class RimTensorResults : public RimFemResultObserver, public caf::PdmObject
|
||||
{
|
||||
CAF_PDM_HEADER_INIT;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user