mirror of
https://github.com/OPM/ResInsight.git
synced 2024-12-29 10:21:54 -06:00
#11994 GeoMech: Allow property filter to be linked to cell result
This commit is contained in:
parent
0ec9a36406
commit
7877cdf62d
@ -124,9 +124,9 @@ void RicGeoMechPropertyFilterFeatureImpl::setDefaults( RimGeoMechPropertyFilter*
|
|||||||
RimGeoMechView* reservoirView = propertyFilterCollection->reservoirView();
|
RimGeoMechView* reservoirView = propertyFilterCollection->reservoirView();
|
||||||
CVF_ASSERT( reservoirView );
|
CVF_ASSERT( reservoirView );
|
||||||
|
|
||||||
propertyFilter->resultDefinition->setGeoMechCase( reservoirView->geoMechCase() );
|
propertyFilter->resultDefinition()->setGeoMechCase( reservoirView->geoMechCase() );
|
||||||
propertyFilter->resultDefinition->setResultAddress( reservoirView->cellResultResultDefinition()->resultAddress() );
|
propertyFilter->resultDefinition()->setResultAddress( reservoirView->cellResultResultDefinition()->resultAddress() );
|
||||||
propertyFilter->resultDefinition->loadResult();
|
propertyFilter->resultDefinition()->loadResult();
|
||||||
propertyFilter->setToDefaultValues();
|
propertyFilter->setToDefaultValues();
|
||||||
propertyFilter->updateFilterName();
|
propertyFilter->updateFilterName();
|
||||||
}
|
}
|
||||||
|
@ -157,19 +157,19 @@ void RivFemElmVisibilityCalculator::computePropertyVisibility( cvf::UByteArray*
|
|||||||
|
|
||||||
RigGeoMechCaseData* caseData = propFilterColl->reservoirView()->geoMechCase()->geoMechData();
|
RigGeoMechCaseData* caseData = propFilterColl->reservoirView()->geoMechCase()->geoMechData();
|
||||||
|
|
||||||
RigFemResultAddress resVarAddress = RigFemAddressDefines::getResultLookupAddress( propertyFilter->resultDefinition->resultAddress() );
|
RigFemResultAddress resVarAddress = RigFemAddressDefines::getResultLookupAddress( propertyFilter->resultDefinition()->resultAddress() );
|
||||||
|
|
||||||
const std::vector<float>& resVals =
|
const std::vector<float>& resVals =
|
||||||
caseData->femPartResults()->resultValues( resVarAddress, part->elementPartId(), timeStepIndex, frameIndex );
|
caseData->femPartResults()->resultValues( resVarAddress, part->elementPartId(), timeStepIndex, frameIndex );
|
||||||
|
|
||||||
if ( !propertyFilter->isActive() ) continue;
|
if ( !propertyFilter->isActive() ) continue;
|
||||||
if ( !propertyFilter->resultDefinition->hasResult() ) continue;
|
if ( !propertyFilter->resultDefinition()->hasResult() ) continue;
|
||||||
if ( resVals.empty() ) continue;
|
if ( resVals.empty() ) continue;
|
||||||
|
|
||||||
const double lowerBound = propertyFilter->lowerBound();
|
const double lowerBound = propertyFilter->lowerBound();
|
||||||
const double upperBound = propertyFilter->upperBound();
|
const double upperBound = propertyFilter->upperBound();
|
||||||
|
|
||||||
if ( propertyFilter->resultDefinition->resultAddress().resultPosType == RIG_FORMATION_NAMES )
|
if ( propertyFilter->resultDefinition()->resultAddress().resultPosType == RIG_FORMATION_NAMES )
|
||||||
{
|
{
|
||||||
std::vector<int> integerVector = propertyFilter->selectedCategoryValues();
|
std::vector<int> integerVector = propertyFilter->selectedCategoryValues();
|
||||||
std::set<int> integerSet;
|
std::set<int> integerSet;
|
||||||
|
@ -30,6 +30,7 @@
|
|||||||
|
|
||||||
#include "RiuMainWindow.h"
|
#include "RiuMainWindow.h"
|
||||||
|
|
||||||
|
#include "cafPdmUiCheckBoxEditor.h"
|
||||||
#include "cafPdmUiDoubleSliderEditor.h"
|
#include "cafPdmUiDoubleSliderEditor.h"
|
||||||
|
|
||||||
#include "cvfAssert.h"
|
#include "cvfAssert.h"
|
||||||
@ -44,18 +45,25 @@ RimGeoMechPropertyFilter::RimGeoMechPropertyFilter()
|
|||||||
{
|
{
|
||||||
CAF_PDM_InitObject( "Property Filter", ":/CellFilter_Values.png" );
|
CAF_PDM_InitObject( "Property Filter", ":/CellFilter_Values.png" );
|
||||||
|
|
||||||
CAF_PDM_InitFieldNoDefault( &resultDefinition, "ResultDefinition", "Result Definition" );
|
CAF_PDM_InitFieldNoDefault( &m_resultDefinition, "ResultDefinition", "Result Definition" );
|
||||||
resultDefinition = new RimGeoMechResultDefinition();
|
m_resultDefinition = new RimGeoMechResultDefinition();
|
||||||
|
|
||||||
// Set to hidden to avoid this item to been displayed as a child item
|
// Set to hidden to avoid this item to been displayed as a child item
|
||||||
// Fields in this object are displayed using defineUiOrdering()
|
// Fields in this object are displayed using defineUiOrdering()
|
||||||
resultDefinition.uiCapability()->setUiTreeChildrenHidden( true );
|
m_resultDefinition.uiCapability()->setUiTreeChildrenHidden( true );
|
||||||
|
|
||||||
CAF_PDM_InitField( &lowerBound, "LowerBound", 0.0, "Min" );
|
CAF_PDM_InitFieldNoDefault( &m_linkedWithCellResult,
|
||||||
lowerBound.uiCapability()->setUiEditorTypeName( caf::PdmUiDoubleSliderEditor::uiEditorTypeName() );
|
"LinkedWithCellResult",
|
||||||
|
"Linked With Cell Result",
|
||||||
|
"",
|
||||||
|
"The selected cell result is automatically used to update the property filter." );
|
||||||
|
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_linkedWithCellResult );
|
||||||
|
|
||||||
CAF_PDM_InitField( &upperBound, "UpperBound", 0.0, "Max" );
|
CAF_PDM_InitField( &m_lowerBound, "LowerBound", 0.0, "Min" );
|
||||||
upperBound.uiCapability()->setUiEditorTypeName( caf::PdmUiDoubleSliderEditor::uiEditorTypeName() );
|
m_lowerBound.uiCapability()->setUiEditorTypeName( caf::PdmUiDoubleSliderEditor::uiEditorTypeName() );
|
||||||
|
|
||||||
|
CAF_PDM_InitField( &m_upperBound, "UpperBound", 0.0, "Max" );
|
||||||
|
m_upperBound.uiCapability()->setUiEditorTypeName( caf::PdmUiDoubleSliderEditor::uiEditorTypeName() );
|
||||||
|
|
||||||
updateIconState();
|
updateIconState();
|
||||||
|
|
||||||
@ -68,7 +76,47 @@ RimGeoMechPropertyFilter::RimGeoMechPropertyFilter()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RimGeoMechPropertyFilter::~RimGeoMechPropertyFilter()
|
RimGeoMechPropertyFilter::~RimGeoMechPropertyFilter()
|
||||||
{
|
{
|
||||||
delete resultDefinition;
|
delete m_resultDefinition;
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
RimGeoMechResultDefinition* RimGeoMechPropertyFilter::resultDefinition() const
|
||||||
|
{
|
||||||
|
return m_resultDefinition;
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
bool RimGeoMechPropertyFilter::isLinkedWithCellResult() const
|
||||||
|
{
|
||||||
|
return m_linkedWithCellResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimGeoMechPropertyFilter::setLinkedWithCellResult( bool linkedWithCellResult )
|
||||||
|
{
|
||||||
|
m_linkedWithCellResult = linkedWithCellResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
double RimGeoMechPropertyFilter::lowerBound() const
|
||||||
|
{
|
||||||
|
return m_lowerBound;
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
double RimGeoMechPropertyFilter::upperBound() const
|
||||||
|
{
|
||||||
|
return m_upperBound;
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -76,8 +124,8 @@ RimGeoMechPropertyFilter::~RimGeoMechPropertyFilter()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimGeoMechPropertyFilter::fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue )
|
void RimGeoMechPropertyFilter::fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue )
|
||||||
{
|
{
|
||||||
if ( &lowerBound == changedField || &upperBound == changedField || &m_isActive == changedField || &m_filterMode == changedField ||
|
if ( &m_lowerBound == changedField || &m_upperBound == changedField || &m_isActive == changedField || &m_filterMode == changedField ||
|
||||||
&m_selectedCategoryValues == changedField )
|
&m_selectedCategoryValues == changedField || &m_linkedWithCellResult == changedField )
|
||||||
{
|
{
|
||||||
updateIconState();
|
updateIconState();
|
||||||
updateFilterName();
|
updateFilterName();
|
||||||
@ -112,8 +160,8 @@ void RimGeoMechPropertyFilter::setToDefaultValues()
|
|||||||
|
|
||||||
computeResultValueRange();
|
computeResultValueRange();
|
||||||
|
|
||||||
lowerBound = m_minimumResultValue;
|
m_lowerBound = m_minimumResultValue;
|
||||||
upperBound = m_maximumResultValue;
|
m_upperBound = m_maximumResultValue;
|
||||||
|
|
||||||
m_selectedCategoryValues = m_categoryValues;
|
m_selectedCategoryValues = m_categoryValues;
|
||||||
|
|
||||||
@ -126,22 +174,28 @@ void RimGeoMechPropertyFilter::setToDefaultValues()
|
|||||||
void RimGeoMechPropertyFilter::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering )
|
void RimGeoMechPropertyFilter::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering )
|
||||||
{
|
{
|
||||||
uiOrdering.add( &m_name );
|
uiOrdering.add( &m_name );
|
||||||
|
uiOrdering.add( &m_linkedWithCellResult );
|
||||||
|
if ( m_linkedWithCellResult() )
|
||||||
|
{
|
||||||
|
uiOrdering.skipRemainingFields( true );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
caf::PdmUiGroup* group1 = uiOrdering.addNewGroup( "Result" );
|
caf::PdmUiGroup* group1 = uiOrdering.addNewGroup( "Result" );
|
||||||
resultDefinition->uiOrdering( uiConfigName, *group1 );
|
m_resultDefinition->uiOrdering( uiConfigName, *group1 );
|
||||||
|
|
||||||
caf::PdmUiGroup& group2 = *( uiOrdering.addNewGroup( "Filter Settings" ) );
|
caf::PdmUiGroup& group2 = *( uiOrdering.addNewGroup( "Filter Settings" ) );
|
||||||
|
|
||||||
group2.add( &m_filterMode );
|
group2.add( &m_filterMode );
|
||||||
|
|
||||||
if ( resultDefinition->hasCategoryResult() )
|
if ( m_resultDefinition->hasCategoryResult() )
|
||||||
{
|
{
|
||||||
group2.add( &m_selectedCategoryValues );
|
group2.add( &m_selectedCategoryValues );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
group2.add( &lowerBound );
|
group2.add( &m_lowerBound );
|
||||||
group2.add( &upperBound );
|
group2.add( &m_upperBound );
|
||||||
}
|
}
|
||||||
|
|
||||||
updateReadOnlyStateOfAllFields();
|
updateReadOnlyStateOfAllFields();
|
||||||
@ -169,9 +223,9 @@ void RimGeoMechPropertyFilter::updateReadOnlyStateOfAllFields()
|
|||||||
std::vector<caf::PdmFieldHandle*> objFields = fields();
|
std::vector<caf::PdmFieldHandle*> objFields = fields();
|
||||||
|
|
||||||
// Include fields declared in RimResultDefinition
|
// Include fields declared in RimResultDefinition
|
||||||
objFields.push_back( &( resultDefinition->m_resultPositionTypeUiField ) );
|
objFields.push_back( &( m_resultDefinition->m_resultPositionTypeUiField ) );
|
||||||
objFields.push_back( &( resultDefinition->m_resultVariableUiField ) );
|
objFields.push_back( &( m_resultDefinition->m_resultVariableUiField ) );
|
||||||
objFields.push_back( &( resultDefinition->m_timeLapseBaseTimestep ) );
|
objFields.push_back( &( m_resultDefinition->m_timeLapseBaseTimestep ) );
|
||||||
|
|
||||||
for ( size_t i = 0; i < objFields.size(); i++ )
|
for ( size_t i = 0; i < objFields.size(); i++ )
|
||||||
{
|
{
|
||||||
@ -212,7 +266,7 @@ void RimGeoMechPropertyFilter::updateActiveState()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
bool RimGeoMechPropertyFilter::isActiveAndHasResult()
|
bool RimGeoMechPropertyFilter::isActiveAndHasResult()
|
||||||
{
|
{
|
||||||
return isActive() && resultDefinition->hasResult();
|
return isActive() && m_resultDefinition->hasResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -225,7 +279,7 @@ void RimGeoMechPropertyFilter::defineEditorAttribute( const caf::PdmFieldHandle*
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( field == &lowerBound || field == &upperBound )
|
if ( field == &m_lowerBound || field == &m_upperBound )
|
||||||
{
|
{
|
||||||
caf::PdmUiDoubleSliderEditorAttribute* myAttr = dynamic_cast<caf::PdmUiDoubleSliderEditorAttribute*>( attribute );
|
caf::PdmUiDoubleSliderEditorAttribute* myAttr = dynamic_cast<caf::PdmUiDoubleSliderEditorAttribute*>( attribute );
|
||||||
if ( !myAttr )
|
if ( !myAttr )
|
||||||
@ -250,25 +304,25 @@ void RimGeoMechPropertyFilter::computeResultValueRange()
|
|||||||
|
|
||||||
clearCategories();
|
clearCategories();
|
||||||
|
|
||||||
RigFemResultAddress resultAddress = resultDefinition->resultAddress();
|
RigFemResultAddress resultAddress = m_resultDefinition->resultAddress();
|
||||||
if ( resultAddress.isValid() && resultDefinition->ownerCaseData() )
|
if ( resultAddress.isValid() && m_resultDefinition->ownerCaseData() )
|
||||||
{
|
{
|
||||||
if ( resultDefinition->hasCategoryResult() )
|
if ( m_resultDefinition->hasCategoryResult() )
|
||||||
{
|
{
|
||||||
std::vector<QString> fnVector = resultDefinition->ownerCaseData()->femPartResults()->formationNames();
|
std::vector<QString> fnVector = m_resultDefinition->ownerCaseData()->femPartResults()->formationNames();
|
||||||
setCategoryNames( fnVector );
|
setCategoryNames( fnVector );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
resultDefinition->ownerCaseData()->femPartResults()->minMaxScalarValues( resultAddress, &min, &max );
|
m_resultDefinition->ownerCaseData()->femPartResults()->minMaxScalarValues( resultAddress, &min, &max );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
m_maximumResultValue = max;
|
m_maximumResultValue = max;
|
||||||
m_minimumResultValue = min;
|
m_minimumResultValue = min;
|
||||||
|
|
||||||
lowerBound.uiCapability()->setUiName( QString( "Min (%1)" ).arg( min ) );
|
m_lowerBound.uiCapability()->setUiName( QString( "Min (%1)" ).arg( min ) );
|
||||||
upperBound.uiCapability()->setUiName( QString( "Max (%1)" ).arg( max ) );
|
m_upperBound.uiCapability()->setUiName( QString( "Max (%1)" ).arg( max ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -276,12 +330,12 @@ void RimGeoMechPropertyFilter::computeResultValueRange()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimGeoMechPropertyFilter::updateFilterName()
|
void RimGeoMechPropertyFilter::updateFilterName()
|
||||||
{
|
{
|
||||||
RigFemResultAddress resultAddress = resultDefinition->resultAddress();
|
RigFemResultAddress resultAddress = m_resultDefinition->resultAddress();
|
||||||
QString newFiltername;
|
QString newFiltername;
|
||||||
|
|
||||||
if ( resultAddress.resultPosType == RIG_FORMATION_NAMES )
|
if ( resultAddress.resultPosType == RIG_FORMATION_NAMES )
|
||||||
{
|
{
|
||||||
newFiltername = resultDefinition->resultFieldName();
|
newFiltername = m_resultDefinition->resultFieldName();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -303,11 +357,11 @@ void RimGeoMechPropertyFilter::updateFilterName()
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString fieldUiName = resultDefinition->resultFieldUiName();
|
QString fieldUiName = m_resultDefinition->resultFieldUiName();
|
||||||
QString compoUiName = resultDefinition->resultComponentUiName();
|
QString compoUiName = m_resultDefinition->resultComponentUiName();
|
||||||
|
|
||||||
newFiltername = posName + ", " + fieldUiName + ", " + compoUiName + " (" + QString::number( lowerBound() ) + " .. " +
|
newFiltername = posName + ", " + fieldUiName + ", " + compoUiName + " (" + QString::number( m_lowerBound() ) + " .. " +
|
||||||
QString::number( upperBound ) + ")";
|
QString::number( m_upperBound ) + ")";
|
||||||
}
|
}
|
||||||
|
|
||||||
m_name = newFiltername;
|
m_name = newFiltername;
|
||||||
|
@ -38,10 +38,13 @@ public:
|
|||||||
RimGeoMechPropertyFilter();
|
RimGeoMechPropertyFilter();
|
||||||
~RimGeoMechPropertyFilter() override;
|
~RimGeoMechPropertyFilter() override;
|
||||||
|
|
||||||
caf::PdmChildField<RimGeoMechResultDefinition*> resultDefinition;
|
RimGeoMechResultDefinition* resultDefinition() const;
|
||||||
|
|
||||||
caf::PdmField<double> lowerBound;
|
bool isLinkedWithCellResult() const;
|
||||||
caf::PdmField<double> upperBound;
|
void setLinkedWithCellResult( bool linkedWithCellResult );
|
||||||
|
|
||||||
|
double lowerBound() const;
|
||||||
|
double upperBound() const;
|
||||||
|
|
||||||
void setParentContainer( RimGeoMechPropertyFilterCollection* parentContainer );
|
void setParentContainer( RimGeoMechPropertyFilterCollection* parentContainer );
|
||||||
RimGeoMechPropertyFilterCollection* parentContainer();
|
RimGeoMechPropertyFilterCollection* parentContainer();
|
||||||
@ -63,6 +66,12 @@ private:
|
|||||||
bool isPropertyFilterControlled();
|
bool isPropertyFilterControlled();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
caf::PdmChildField<RimGeoMechResultDefinition*> m_resultDefinition;
|
||||||
|
caf::PdmField<bool> m_linkedWithCellResult;
|
||||||
|
|
||||||
|
caf::PdmField<double> m_lowerBound;
|
||||||
|
caf::PdmField<double> m_upperBound;
|
||||||
|
|
||||||
RimGeoMechPropertyFilterCollection* m_parentContainer;
|
RimGeoMechPropertyFilterCollection* m_parentContainer;
|
||||||
double m_minimumResultValue;
|
double m_minimumResultValue;
|
||||||
double m_maximumResultValue;
|
double m_maximumResultValue;
|
||||||
|
@ -25,6 +25,8 @@
|
|||||||
#include "RimViewController.h"
|
#include "RimViewController.h"
|
||||||
#include "RimViewLinker.h"
|
#include "RimViewLinker.h"
|
||||||
|
|
||||||
|
#include "RigFemResultAddress.h"
|
||||||
|
|
||||||
#include "cvfAssert.h"
|
#include "cvfAssert.h"
|
||||||
|
|
||||||
CAF_PDM_SOURCE_INIT( RimGeoMechPropertyFilterCollection, "GeoMechPropertyFilters" );
|
CAF_PDM_SOURCE_INIT( RimGeoMechPropertyFilterCollection, "GeoMechPropertyFilters" );
|
||||||
@ -55,8 +57,8 @@ void RimGeoMechPropertyFilterCollection::loadAndInitializePropertyFilters()
|
|||||||
for ( size_t i = 0; i < propertyFilters.size(); i++ )
|
for ( size_t i = 0; i < propertyFilters.size(); i++ )
|
||||||
{
|
{
|
||||||
RimGeoMechPropertyFilter* propertyFilter = propertyFilters[i];
|
RimGeoMechPropertyFilter* propertyFilter = propertyFilters[i];
|
||||||
propertyFilter->resultDefinition->setGeoMechCase( reservoirView()->geoMechCase() );
|
propertyFilter->resultDefinition()->setGeoMechCase( reservoirView()->geoMechCase() );
|
||||||
propertyFilter->resultDefinition->loadResult();
|
propertyFilter->resultDefinition()->loadResult();
|
||||||
propertyFilter->computeResultValueRange();
|
propertyFilter->computeResultValueRange();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -71,7 +73,7 @@ void RimGeoMechPropertyFilterCollection::initAfterRead()
|
|||||||
RimGeoMechPropertyFilter* propertyFilter = propertyFilters[i];
|
RimGeoMechPropertyFilter* propertyFilter = propertyFilters[i];
|
||||||
|
|
||||||
propertyFilter->setParentContainer( this );
|
propertyFilter->setParentContainer( this );
|
||||||
propertyFilter->resultDefinition->setGeoMechCase( reservoirView()->geoMechCase() );
|
propertyFilter->resultDefinition()->setGeoMechCase( reservoirView()->geoMechCase() );
|
||||||
propertyFilter->updateIconState();
|
propertyFilter->updateIconState();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -88,7 +90,7 @@ bool RimGeoMechPropertyFilterCollection::hasActiveFilters() const
|
|||||||
for ( size_t i = 0; i < propertyFilters.size(); i++ )
|
for ( size_t i = 0; i < propertyFilters.size(); i++ )
|
||||||
{
|
{
|
||||||
RimGeoMechPropertyFilter* propertyFilter = propertyFilters[i];
|
RimGeoMechPropertyFilter* propertyFilter = propertyFilters[i];
|
||||||
if ( propertyFilter->isActive() && propertyFilter->resultDefinition->hasResult() ) return true;
|
if ( propertyFilter->isActive() && propertyFilter->resultDefinition()->hasResult() ) return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
@ -112,8 +114,8 @@ bool RimGeoMechPropertyFilterCollection::isUsingFormationNames() const
|
|||||||
for ( size_t i = 0; i < propertyFilters.size(); i++ )
|
for ( size_t i = 0; i < propertyFilters.size(); i++ )
|
||||||
{
|
{
|
||||||
RimGeoMechPropertyFilter* propertyFilter = propertyFilters[i];
|
RimGeoMechPropertyFilter* propertyFilter = propertyFilters[i];
|
||||||
if ( propertyFilter->isActive() && propertyFilter->resultDefinition->resultPositionType() == RIG_FORMATION_NAMES &&
|
if ( propertyFilter->isActive() && propertyFilter->resultDefinition()->resultPositionType() == RIG_FORMATION_NAMES &&
|
||||||
propertyFilter->resultDefinition->resultFieldName() != "" )
|
propertyFilter->resultDefinition()->resultFieldName() != "" )
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -150,3 +152,23 @@ void RimGeoMechPropertyFilterCollection::updateIconState()
|
|||||||
propFilter->updateIconState();
|
propFilter->updateIconState();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimGeoMechPropertyFilterCollection::updateFromResult( const RimGeoMechResultDefinition* resultDefinition )
|
||||||
|
{
|
||||||
|
if ( !resultDefinition ) return;
|
||||||
|
|
||||||
|
for ( auto filter : propertyFilters )
|
||||||
|
{
|
||||||
|
if ( filter->isLinkedWithCellResult() )
|
||||||
|
{
|
||||||
|
filter->resultDefinition()->setResultAddress( resultDefinition->resultAddress() );
|
||||||
|
filter->setToDefaultValues();
|
||||||
|
filter->updateFilterName();
|
||||||
|
|
||||||
|
updateDisplayModelNotifyManagedViews( filter );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -27,6 +27,7 @@
|
|||||||
|
|
||||||
class RimGeoMechPropertyFilter;
|
class RimGeoMechPropertyFilter;
|
||||||
class RimGeoMechView;
|
class RimGeoMechView;
|
||||||
|
class RimGeoMechResultDefinition;
|
||||||
|
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
///
|
///
|
||||||
@ -52,6 +53,8 @@ public:
|
|||||||
void loadAndInitializePropertyFilters() override;
|
void loadAndInitializePropertyFilters() override;
|
||||||
void updateIconState() override;
|
void updateIconState() override;
|
||||||
|
|
||||||
|
void updateFromResult( const RimGeoMechResultDefinition* resultDefinition );
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Overridden methods
|
// Overridden methods
|
||||||
void initAfterRead() override;
|
void initAfterRead() override;
|
||||||
|
@ -922,7 +922,7 @@ void RimGeoMechCase::updateFormationNamesData()
|
|||||||
RimGeoMechPropertyFilterCollection* eclFilColl = geomView->geoMechPropertyFilterCollection();
|
RimGeoMechPropertyFilterCollection* eclFilColl = geomView->geoMechPropertyFilterCollection();
|
||||||
for ( RimGeoMechPropertyFilter* propFilter : eclFilColl->propertyFilters )
|
for ( RimGeoMechPropertyFilter* propFilter : eclFilColl->propertyFilters )
|
||||||
{
|
{
|
||||||
if ( propFilter->resultDefinition->resultPositionType() == RIG_FORMATION_NAMES )
|
if ( propFilter->resultDefinition()->resultPositionType() == RIG_FORMATION_NAMES )
|
||||||
{
|
{
|
||||||
propFilter->setToDefaultValues();
|
propFilter->setToDefaultValues();
|
||||||
propFilter->updateConnectedEditors();
|
propFilter->updateConnectedEditors();
|
||||||
@ -1021,9 +1021,9 @@ void RimGeoMechCase::closeSelectedElementPropertyFiles()
|
|||||||
|
|
||||||
for ( RimGeoMechPropertyFilter* propertyFilter : view->geoMechPropertyFilterCollection()->propertyFilters() )
|
for ( RimGeoMechPropertyFilter* propertyFilter : view->geoMechPropertyFilterCollection()->propertyFilters() )
|
||||||
{
|
{
|
||||||
if ( address == propertyFilter->resultDefinition->resultAddress() )
|
if ( address == propertyFilter->resultDefinition()->resultAddress() )
|
||||||
{
|
{
|
||||||
propertyFilter->resultDefinition->setResultAddress( RigFemResultAddress() );
|
propertyFilter->resultDefinition()->setResultAddress( RigFemResultAddress() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -504,6 +504,14 @@ void RimGeoMechView::onUpdateStaticCellColors()
|
|||||||
m_vizLogic->updateStaticCellColors( -1 );
|
m_vizLogic->updateStaticCellColors( -1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimGeoMechView::childFieldChangedByUi( const caf::PdmFieldHandle* changedChildField )
|
||||||
|
{
|
||||||
|
m_propertyFilterCollection->updateFromResult( cellResult() );
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -138,6 +138,8 @@ private:
|
|||||||
void onUpdateDisplayModelForCurrentTimeStep() override;
|
void onUpdateDisplayModelForCurrentTimeStep() override;
|
||||||
void onUpdateStaticCellColors() override;
|
void onUpdateStaticCellColors() override;
|
||||||
|
|
||||||
|
void childFieldChangedByUi( const caf::PdmFieldHandle* changedChildField ) override;
|
||||||
|
|
||||||
void onUpdateLegends() override;
|
void onUpdateLegends() override;
|
||||||
|
|
||||||
void updateTensorLegendTextAndRanges( RimRegularLegendConfig* legendConfig, int viewerTimeStep );
|
void updateTensorLegendTextAndRanges( RimRegularLegendConfig* legendConfig, int viewerTimeStep );
|
||||||
|
Loading…
Reference in New Issue
Block a user