Alligned the GeoMechResultDefinition to the EclipseResultDefinition way of updating the PropertyFilter

This commit is contained in:
Jacob Støren 2015-08-10 17:26:19 +02:00
parent df0b4164c5
commit b35e37bde2
3 changed files with 8 additions and 16 deletions

View File

@ -43,7 +43,6 @@ RimGeoMechPropertyFilter::RimGeoMechPropertyFilter()
CAF_PDM_InitFieldNoDefault(&resultDefinition, "ResultDefinition", "Result definition", "", "", ""); CAF_PDM_InitFieldNoDefault(&resultDefinition, "ResultDefinition", "Result definition", "", "", "");
resultDefinition = new RimGeoMechResultDefinition(); resultDefinition = new RimGeoMechResultDefinition();
resultDefinition->setOwnerPropertyFilter(this);
// 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()

View File

@ -165,6 +165,9 @@ void RimGeoMechResultDefinition::fieldChangedByUi(const caf::PdmFieldHandle* cha
} }
// Get the possible property filter owner
RimGeoMechPropertyFilter* propFilter = dynamic_cast<RimGeoMechPropertyFilter*>(this->parentField()->ownerObject());
if (&m_resultVariableUiField == changedField) if (&m_resultVariableUiField == changedField)
{ {
QStringList fieldComponentNames = m_resultVariableUiField().split(QRegExp("\\s+")); QStringList fieldComponentNames = m_resultVariableUiField().split(QRegExp("\\s+"));
@ -186,9 +189,9 @@ void RimGeoMechResultDefinition::fieldChangedByUi(const caf::PdmFieldHandle* cha
m_reservoirView->hasUserRequestedAnimation = true; m_reservoirView->hasUserRequestedAnimation = true;
} }
if (m_propertyFilter) if (propFilter)
{ {
m_propertyFilter->setToDefaultValues(); propFilter->setToDefaultValues();
((RimView*)reservoirView())->scheduleGeometryRegen(PROPERTY_FILTERED); ((RimView*)reservoirView())->scheduleGeometryRegen(PROPERTY_FILTERED);
} }
@ -197,9 +200,9 @@ void RimGeoMechResultDefinition::fieldChangedByUi(const caf::PdmFieldHandle* cha
} }
} }
if (m_propertyFilter) if (propFilter)
{ {
m_propertyFilter->updateConnectedEditors(); propFilter->updateConnectedEditors();
} }
} }
@ -326,13 +329,6 @@ QString RimGeoMechResultDefinition::convertToUiResultFieldName(QString resultFie
return resultFieldName; return resultFieldName;
} }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimGeoMechResultDefinition::setOwnerPropertyFilter( RimGeoMechPropertyFilter* propertyFilter )
{
m_propertyFilter = propertyFilter;
}
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///

View File

@ -57,8 +57,6 @@ public:
QString resultComponentName() { return m_resultComponentName();} QString resultComponentName() { return m_resultComponentName();}
void setResultAddress(const RigFemResultAddress& resultAddress); void setResultAddress(const RigFemResultAddress& resultAddress);
void setOwnerPropertyFilter(RimGeoMechPropertyFilter* propertyFilter);
QString resultFieldUiName(); QString resultFieldUiName();
QString resultComponentUiName(); QString resultComponentUiName();
@ -85,7 +83,6 @@ private:
caf::PdmField<QString> m_resultVariableUiField; caf::PdmField<QString> m_resultVariableUiField;
caf::PdmPointer<RimGeoMechView> m_reservoirView; caf::PdmPointer<RimGeoMechView> m_reservoirView;
caf::PdmPointer<RimGeoMechPropertyFilter> m_propertyFilter;
static QString convertToUiResultFieldName(QString resultFieldName); static QString convertToUiResultFieldName(QString resultFieldName);
}; };