mirror of
https://github.com/OPM/ResInsight.git
synced 2025-01-21 22:13:25 -06:00
#829 Eclipse: Set default legend mapping and color range when selecting a category result
This commit is contained in:
parent
f404299702
commit
cf8190cbf1
@ -191,6 +191,32 @@ void RimEclipseCellColors::defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOr
|
||||
uiTreeOrdering.setForgetRemainingFields(true);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEclipseCellColors::updateLegendCategorySettings()
|
||||
{
|
||||
changeLegendConfig(this->resultVariable());
|
||||
|
||||
if (this->hasCategoryResult())
|
||||
{
|
||||
legendConfig()->setMappingMode(RimLegendConfig::CATEGORY_INTEGER);
|
||||
legendConfig()->setColorRangeMode(RimLegendConfig::CATEGORY);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (legendConfig()->mappingMode() == RimLegendConfig::CATEGORY_INTEGER)
|
||||
{
|
||||
legendConfig()->setMappingMode(RimLegendConfig::LINEAR_CONTINUOUS);
|
||||
}
|
||||
|
||||
if (legendConfig()->colorRangeMode() == RimLegendConfig::CATEGORY)
|
||||
{
|
||||
legendConfig()->setColorRangeMode(RimLegendConfig::NORMAL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -51,6 +51,8 @@ public:
|
||||
|
||||
void updateIconState();
|
||||
|
||||
virtual void updateLegendCategorySettings() override;
|
||||
|
||||
protected:
|
||||
// Overridden methods
|
||||
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue);
|
||||
|
@ -157,6 +157,8 @@ void RimEclipseResultDefinition::fieldChangedByUi(const caf::PdmFieldHandle* cha
|
||||
|
||||
if (dynamic_cast<RimEclipseCellColors*>(this))
|
||||
{
|
||||
this->updateLegendCategorySettings();
|
||||
|
||||
if (view)
|
||||
{
|
||||
RimViewLinker* viewLinker = view->assosiatedViewLinker();
|
||||
@ -169,6 +171,7 @@ void RimEclipseResultDefinition::fieldChangedByUi(const caf::PdmFieldHandle* cha
|
||||
|
||||
if (cellEdgeColors)
|
||||
{
|
||||
cellEdgeColors->singleVarEdgeResultColors()->updateLegendCategorySettings();
|
||||
cellEdgeColors->loadResult();
|
||||
|
||||
if (view)
|
||||
|
@ -65,6 +65,11 @@ public:
|
||||
virtual QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool* useOptionsOnly);
|
||||
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue);
|
||||
virtual void initAfterRead();
|
||||
|
||||
virtual void updateLegendCategorySettings() {};
|
||||
|
||||
protected:
|
||||
void updateFieldVisibility();
|
||||
|
||||
protected:
|
||||
caf::PdmField< caf::AppEnum< RimDefines::ResultCatType > > m_resultType;
|
||||
@ -82,9 +87,6 @@ protected:
|
||||
|
||||
caf::PdmPointer<RimEclipseCase> m_eclipseCase;
|
||||
|
||||
protected:
|
||||
void updateFieldVisibility();
|
||||
|
||||
private:
|
||||
QList<caf::PdmOptionItemInfo> calculateValueOptionsForSpecifiedDerivedListPosition(bool showDerivedResultsFirstInList, const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly);
|
||||
QStringList getResultVariableListForCurrentUIFieldSettings();
|
||||
|
Loading…
Reference in New Issue
Block a user