mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#811 Setting default legend type for category results
This commit is contained in:
parent
3e8873c870
commit
e4e3c37f89
@ -75,3 +75,27 @@ void RimGeoMechCellColors::initAfterRead()
|
|||||||
{
|
{
|
||||||
updateIconState();
|
updateIconState();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimGeoMechCellColors::updateLegendCategorySettings()
|
||||||
|
{
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -43,4 +43,7 @@ public:
|
|||||||
|
|
||||||
void updateIconState();
|
void updateIconState();
|
||||||
virtual void initAfterRead();
|
virtual void initAfterRead();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void updateLegendCategorySettings() override;
|
||||||
};
|
};
|
||||||
|
@ -187,6 +187,8 @@ void RimGeoMechResultDefinition::fieldChangedByUi(const caf::PdmFieldHandle* cha
|
|||||||
|
|
||||||
if (dynamic_cast<RimGeoMechCellColors*>(this))
|
if (dynamic_cast<RimGeoMechCellColors*>(this))
|
||||||
{
|
{
|
||||||
|
this->updateLegendCategorySettings();
|
||||||
|
|
||||||
if (view)
|
if (view)
|
||||||
{
|
{
|
||||||
RimViewLinker* viewLinker = view->assosiatedViewLinker();
|
RimViewLinker* viewLinker = view->assosiatedViewLinker();
|
||||||
|
@ -63,6 +63,7 @@ public:
|
|||||||
bool hasCategoryResult() { return m_resultPositionType() == RIG_FORMATION_NAMES; }
|
bool hasCategoryResult() { return m_resultPositionType() == RIG_FORMATION_NAMES; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
virtual void updateLegendCategorySettings() {};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
virtual QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions,
|
virtual QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions,
|
||||||
@ -82,6 +83,7 @@ private:
|
|||||||
|
|
||||||
friend class RimGeoMechPropertyFilter; // Property filter needs the ui fields
|
friend class RimGeoMechPropertyFilter; // Property filter needs the ui fields
|
||||||
friend class RimWellLogExtractionCurve; // Curve needs the ui fields
|
friend class RimWellLogExtractionCurve; // Curve needs the ui fields
|
||||||
|
friend class RimGeoMechCellColors; // Needs the ui fields
|
||||||
|
|
||||||
caf::PdmField<caf::AppEnum<RigFemResultPosEnum> > m_resultPositionTypeUiField;
|
caf::PdmField<caf::AppEnum<RigFemResultPosEnum> > m_resultPositionTypeUiField;
|
||||||
caf::PdmField<QString> m_resultVariableUiField;
|
caf::PdmField<QString> m_resultVariableUiField;
|
||||||
|
@ -549,6 +549,15 @@ void RimLegendConfig::setColorRangeMode(ColorRangesType colorMode)
|
|||||||
updateLegend();
|
updateLegend();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimLegendConfig::setMappingMode(MappingType mappingType)
|
||||||
|
{
|
||||||
|
m_mappingMode = mappingType;
|
||||||
|
updateLegend();
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
@ -705,6 +714,7 @@ void RimLegendConfig::setCategories(const std::set<int>& globalCategories, const
|
|||||||
m_localCategories.set(i++, val);
|
m_localCategories.set(i++, val);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
updateLegend();
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -749,6 +759,8 @@ void RimLegendConfig::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering&
|
|||||||
mappingGr->add(&m_userDefinedMaxValue);
|
mappingGr->add(&m_userDefinedMaxValue);
|
||||||
mappingGr->add(&m_userDefinedMinValue);
|
mappingGr->add(&m_userDefinedMinValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
updateFieldVisibility();
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -97,7 +97,12 @@ public:
|
|||||||
|
|
||||||
typedef caf::AppEnum<MappingType> MappingEnum;
|
typedef caf::AppEnum<MappingType> MappingEnum;
|
||||||
void recreateLegend();
|
void recreateLegend();
|
||||||
|
|
||||||
void setColorRangeMode(ColorRangesType colorMode);
|
void setColorRangeMode(ColorRangesType colorMode);
|
||||||
|
ColorRangesType colorRangeMode() { return m_colorRangeMode();}
|
||||||
|
void setMappingMode(MappingType mappingType);
|
||||||
|
MappingType mappingMode() { return m_mappingMode();}
|
||||||
|
|
||||||
void setAutomaticRanges(double globalMin, double globalMax, double localMin, double localMax);
|
void setAutomaticRanges(double globalMin, double globalMax, double localMin, double localMax);
|
||||||
void setClosestToZeroValues(double globalPosClosestToZero, double globalNegClosestToZero, double localPosClosestToZero, double localNegClosestToZero);
|
void setClosestToZeroValues(double globalPosClosestToZero, double globalNegClosestToZero, double localPosClosestToZero, double localNegClosestToZero);
|
||||||
void setCategories(const std::set<int>& globalCategories, const std::set<int>& localCategories);
|
void setCategories(const std::set<int>& globalCategories, const std::set<int>& localCategories);
|
||||||
@ -107,7 +112,6 @@ public:
|
|||||||
cvf::ScalarMapper* scalarMapper() { return m_currentScalarMapper.p(); }
|
cvf::ScalarMapper* scalarMapper() { return m_currentScalarMapper.p(); }
|
||||||
cvf::OverlayItem* legend();
|
cvf::OverlayItem* legend();
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
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();
|
||||||
|
Loading…
Reference in New Issue
Block a user