mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#7647 PERM and other arrays default colour legend type change
Restore default color legend to "Continuous Logarithmic" instead of "Discrete Logarithmic"
This commit is contained in:
@@ -110,6 +110,7 @@ RimGridCrossPlotDataSet::RimGridCrossPlotDataSet()
|
|||||||
|
|
||||||
CAF_PDM_InitFieldNoDefault( &m_groupingProperty, "GroupingProperty", "Data Grouping Property", "", "", "" );
|
CAF_PDM_InitFieldNoDefault( &m_groupingProperty, "GroupingProperty", "Data Grouping Property", "", "", "" );
|
||||||
m_groupingProperty = new RimEclipseCellColors;
|
m_groupingProperty = new RimEclipseCellColors;
|
||||||
|
m_groupingProperty->useDiscreteLogLevels( true );
|
||||||
m_groupingProperty.uiCapability()->setUiHidden( true );
|
m_groupingProperty.uiCapability()->setUiHidden( true );
|
||||||
CVF_ASSERT( m_groupingProperty->legendConfig() );
|
CVF_ASSERT( m_groupingProperty->legendConfig() );
|
||||||
m_groupingProperty->legendConfig()->setMappingMode( RimRegularLegendConfig::MappingType::CATEGORY_INTEGER );
|
m_groupingProperty->legendConfig()->setMappingMode( RimRegularLegendConfig::MappingType::CATEGORY_INTEGER );
|
||||||
|
|||||||
@@ -68,6 +68,8 @@ RimEclipseCellColors::RimEclipseCellColors()
|
|||||||
|
|
||||||
// Make sure we have a created legend for the default/undefined result variable
|
// Make sure we have a created legend for the default/undefined result variable
|
||||||
changeLegendConfig( this->resultVariable() );
|
changeLegendConfig( this->resultVariable() );
|
||||||
|
|
||||||
|
m_useDiscreteLogLevels = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@@ -150,7 +152,9 @@ void RimEclipseCellColors::changeLegendConfig( QString resultVarNameOfNewLegend
|
|||||||
|
|
||||||
if ( !found )
|
if ( !found )
|
||||||
{
|
{
|
||||||
auto newLegend = createLegendForResult( resultVarNameOfNewLegend, this->hasCategoryResult() );
|
auto newLegend = createLegendForResult( resultVarNameOfNewLegend,
|
||||||
|
this->m_useDiscreteLogLevels,
|
||||||
|
this->hasCategoryResult() );
|
||||||
|
|
||||||
m_legendConfigData.push_back( newLegend );
|
m_legendConfigData.push_back( newLegend );
|
||||||
|
|
||||||
@@ -176,7 +180,9 @@ void RimEclipseCellColors::onLegendConfigChanged( const caf::SignalEmitter* emit
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RimRegularLegendConfig* RimEclipseCellColors::createLegendForResult( const QString& resultName, bool isCategoryResult )
|
RimRegularLegendConfig* RimEclipseCellColors::createLegendForResult( const QString& resultName,
|
||||||
|
bool useDiscreteLogLevels,
|
||||||
|
bool isCategoryResult )
|
||||||
{
|
{
|
||||||
bool useLog = false;
|
bool useLog = false;
|
||||||
{
|
{
|
||||||
@@ -207,7 +213,11 @@ RimRegularLegendConfig* RimEclipseCellColors::createLegendForResult( const QStri
|
|||||||
|
|
||||||
if ( useLog )
|
if ( useLog )
|
||||||
{
|
{
|
||||||
newLegend->setMappingMode( RimRegularLegendConfig::MappingType::LOG10_DISCRETE );
|
if ( useDiscreteLogLevels )
|
||||||
|
newLegend->setMappingMode( RimRegularLegendConfig::MappingType::LOG10_DISCRETE );
|
||||||
|
else
|
||||||
|
newLegend->setMappingMode( RimRegularLegendConfig::MappingType::LOG10_CONTINUOUS );
|
||||||
|
|
||||||
newLegend->setTickNumberFormat( RimRegularLegendConfig::NumberFormatType::AUTO );
|
newLegend->setTickNumberFormat( RimRegularLegendConfig::NumberFormatType::AUTO );
|
||||||
newLegend->setRangeMode( RimLegendConfig::RangeModeType::USER_DEFINED );
|
newLegend->setRangeMode( RimLegendConfig::RangeModeType::USER_DEFINED );
|
||||||
newLegend->resetUserDefinedValues();
|
newLegend->resetUserDefinedValues();
|
||||||
@@ -302,6 +312,14 @@ void RimEclipseCellColors::uiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrderin
|
|||||||
defineUiTreeOrdering( uiTreeOrdering, uiConfigName );
|
defineUiTreeOrdering( uiTreeOrdering, uiConfigName );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimEclipseCellColors::useDiscreteLogLevels( bool enable )
|
||||||
|
{
|
||||||
|
m_useDiscreteLogLevels = true;
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -60,6 +60,8 @@ public:
|
|||||||
void updateLegendCategorySettings() override;
|
void updateLegendCategorySettings() override;
|
||||||
void uiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName = "" );
|
void uiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName = "" );
|
||||||
|
|
||||||
|
void useDiscreteLogLevels( bool enable );
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Overridden methods
|
// Overridden methods
|
||||||
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
|
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
|
||||||
@@ -74,7 +76,8 @@ protected:
|
|||||||
private:
|
private:
|
||||||
void changeLegendConfig( QString resultVarNameOfNewLegend );
|
void changeLegendConfig( QString resultVarNameOfNewLegend );
|
||||||
void onLegendConfigChanged( const caf::SignalEmitter* emitter, RimLegendConfigChangeType changeType );
|
void onLegendConfigChanged( const caf::SignalEmitter* emitter, RimLegendConfigChangeType changeType );
|
||||||
static RimRegularLegendConfig* createLegendForResult( const QString& resultName, bool isCategoryResult );
|
static RimRegularLegendConfig*
|
||||||
|
createLegendForResult( const QString& resultName, bool useDiscreteLevels, bool isCategoryResult );
|
||||||
|
|
||||||
caf::PdmChildArrayField<RimRegularLegendConfig*> m_legendConfigData;
|
caf::PdmChildArrayField<RimRegularLegendConfig*> m_legendConfigData;
|
||||||
caf::PdmPtrField<RimRegularLegendConfig*> m_legendConfigPtrField;
|
caf::PdmPtrField<RimRegularLegendConfig*> m_legendConfigPtrField;
|
||||||
@@ -82,6 +85,8 @@ private:
|
|||||||
|
|
||||||
caf::PdmPointer<RimEclipseView> m_reservoirView;
|
caf::PdmPointer<RimEclipseView> m_reservoirView;
|
||||||
|
|
||||||
|
bool m_useDiscreteLogLevels;
|
||||||
|
|
||||||
// Obsolete
|
// Obsolete
|
||||||
caf::PdmChildField<RimRegularLegendConfig*> obsoleteField_legendConfig;
|
caf::PdmChildField<RimRegularLegendConfig*> obsoleteField_legendConfig;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user