mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -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);
|
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();
|
void updateIconState();
|
||||||
|
|
||||||
|
virtual void updateLegendCategorySettings() override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Overridden methods
|
// Overridden methods
|
||||||
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue);
|
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))
|
if (dynamic_cast<RimEclipseCellColors*>(this))
|
||||||
{
|
{
|
||||||
|
this->updateLegendCategorySettings();
|
||||||
|
|
||||||
if (view)
|
if (view)
|
||||||
{
|
{
|
||||||
RimViewLinker* viewLinker = view->assosiatedViewLinker();
|
RimViewLinker* viewLinker = view->assosiatedViewLinker();
|
||||||
@ -169,6 +171,7 @@ void RimEclipseResultDefinition::fieldChangedByUi(const caf::PdmFieldHandle* cha
|
|||||||
|
|
||||||
if (cellEdgeColors)
|
if (cellEdgeColors)
|
||||||
{
|
{
|
||||||
|
cellEdgeColors->singleVarEdgeResultColors()->updateLegendCategorySettings();
|
||||||
cellEdgeColors->loadResult();
|
cellEdgeColors->loadResult();
|
||||||
|
|
||||||
if (view)
|
if (view)
|
||||||
|
@ -65,6 +65,11 @@ public:
|
|||||||
virtual QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool* useOptionsOnly);
|
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 fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue);
|
||||||
virtual void initAfterRead();
|
virtual void initAfterRead();
|
||||||
|
|
||||||
|
virtual void updateLegendCategorySettings() {};
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void updateFieldVisibility();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
caf::PdmField< caf::AppEnum< RimDefines::ResultCatType > > m_resultType;
|
caf::PdmField< caf::AppEnum< RimDefines::ResultCatType > > m_resultType;
|
||||||
@ -82,9 +87,6 @@ protected:
|
|||||||
|
|
||||||
caf::PdmPointer<RimEclipseCase> m_eclipseCase;
|
caf::PdmPointer<RimEclipseCase> m_eclipseCase;
|
||||||
|
|
||||||
protected:
|
|
||||||
void updateFieldVisibility();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QList<caf::PdmOptionItemInfo> calculateValueOptionsForSpecifiedDerivedListPosition(bool showDerivedResultsFirstInList, const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly);
|
QList<caf::PdmOptionItemInfo> calculateValueOptionsForSpecifiedDerivedListPosition(bool showDerivedResultsFirstInList, const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly);
|
||||||
QStringList getResultVariableListForCurrentUIFieldSettings();
|
QStringList getResultVariableListForCurrentUIFieldSettings();
|
||||||
|
Loading…
Reference in New Issue
Block a user