Janitor : Use class enum

This commit is contained in:
Magne Sjaastad 2020-08-14 10:41:01 +02:00
parent 07c778280b
commit 523cdc2b7d
22 changed files with 181 additions and 156 deletions

View File

@ -210,7 +210,7 @@ RimEclipseContourMapView* RicNewContourMapViewFeature::createEclipseContourMapFr
// Set default values
RimRegularLegendConfig* legendConfig = contourMap->cellResult()->legendConfig();
if ( legendConfig && legendConfig->mappingMode() == RimRegularLegendConfig::CATEGORY_INTEGER )
if ( legendConfig && legendConfig->mappingMode() == RimRegularLegendConfig::MappingType::CATEGORY_INTEGER )
{
RicNewContourMapViewFeature::assignDefaultResultAndLegend( contourMap );
}
@ -353,7 +353,7 @@ void RicNewContourMapViewFeature::assignDefaultResultAndLegend( RimEclipseContou
RimRegularLegendConfig* legendConfig = contourMap->cellResult()->legendConfig();
if ( legendConfig )
{
RimColorLegend* legend = legendConfig->mapToColorLegend( RimRegularLegendConfig::RAINBOW );
RimColorLegend* legend = legendConfig->mapToColorLegend( RimRegularLegendConfig::ColorRangesType::RAINBOW );
legendConfig->setColorLegend( legend );
}
}

View File

@ -619,7 +619,7 @@ RimSummaryPlot*
if ( ensembleColoringStyle == EnsembleColoringType::LOG_PARAMETER )
{
curveSet->legendConfig()->setMappingMode( RimRegularLegendConfig::LOG10_CONTINUOUS );
curveSet->legendConfig()->setMappingMode( RimRegularLegendConfig::MappingType::LOG10_CONTINUOUS );
}
}
@ -684,7 +684,7 @@ std::vector<RimSummaryPlot*> RicSummaryPlotFeatureImpl::createMultipleSummaryPlo
curveSet->setEnsembleParameter( ensembleColoringParameter );
if ( ensembleColoringStyle == EnsembleColoringType::LOG_PARAMETER )
{
curveSet->legendConfig()->setMappingMode( RimRegularLegendConfig::LOG10_CONTINUOUS );
curveSet->legendConfig()->setMappingMode( RimRegularLegendConfig::MappingType::LOG10_CONTINUOUS );
}
}
createdEnsembleCurveSets.push_back( curveSet );

View File

@ -173,7 +173,8 @@ RimCorrelationMatrixPlot::RimCorrelationMatrixPlot()
m_legendConfig = new RimRegularLegendConfig();
m_legendConfig->setAutomaticRanges( -1.0, 1.0, -1.0, 1.0 );
m_legendConfig->setColorLegend( RimRegularLegendConfig::mapToColorLegend( RimRegularLegendConfig::CORRELATION ) );
m_legendConfig->setColorLegend(
RimRegularLegendConfig::mapToColorLegend( RimRegularLegendConfig::ColorRangesType::CORRELATION ) );
this->uiCapability()->setUiTreeChildrenHidden( true );
m_selectMultipleVectors = true;

View File

@ -112,7 +112,7 @@ RimGridCrossPlotDataSet::RimGridCrossPlotDataSet()
m_groupingProperty = new RimEclipseCellColors;
m_groupingProperty.uiCapability()->setUiHidden( true );
CVF_ASSERT( m_groupingProperty->legendConfig() );
m_groupingProperty->legendConfig()->setMappingMode( RimRegularLegendConfig::CATEGORY_INTEGER );
m_groupingProperty->legendConfig()->setMappingMode( RimRegularLegendConfig::MappingType::CATEGORY_INTEGER );
m_groupingProperty->setTernaryEnabled( false );
CAF_PDM_InitFieldNoDefault( &m_nameConfig, "NameConfig", "Name", "", "", "" );
@ -172,7 +172,7 @@ void RimGridCrossPlotDataSet::setCellFilterView( RimGridView* cellFilterView )
{
m_grouping = GROUP_BY_FORMATION;
m_groupingProperty->legendConfig()->setColorLegend(
RimRegularLegendConfig::mapToColorLegend( RimRegularLegendConfig::CATEGORY ) );
RimRegularLegendConfig::mapToColorLegend( RimRegularLegendConfig::ColorRangesType::CATEGORY ) );
}
RimGridCrossPlot* parentPlot = nullptr;
@ -868,18 +868,21 @@ void RimGridCrossPlotDataSet::fieldChangedByUi( const caf::PdmFieldHandle* chang
{
if ( m_grouping == GROUP_BY_TIME )
{
legendConfig()->setColorLegend( RimRegularLegendConfig::mapToColorLegend( RimRegularLegendConfig::NORMAL ) );
legendConfig()->setMappingMode( RimRegularLegendConfig::CATEGORY_INTEGER );
legendConfig()->setColorLegend(
RimRegularLegendConfig::mapToColorLegend( RimRegularLegendConfig::ColorRangesType::NORMAL ) );
legendConfig()->setMappingMode( RimRegularLegendConfig::MappingType::CATEGORY_INTEGER );
}
else if ( groupingByCategoryResult() )
{
legendConfig()->setColorLegend( RimRegularLegendConfig::mapToColorLegend( RimRegularLegendConfig::CATEGORY ) );
legendConfig()->setMappingMode( RimRegularLegendConfig::CATEGORY_INTEGER );
legendConfig()->setColorLegend(
RimRegularLegendConfig::mapToColorLegend( RimRegularLegendConfig::ColorRangesType::CATEGORY ) );
legendConfig()->setMappingMode( RimRegularLegendConfig::MappingType::CATEGORY_INTEGER );
}
else
{
legendConfig()->setColorLegend( RimRegularLegendConfig::mapToColorLegend( RimRegularLegendConfig::NORMAL ) );
legendConfig()->setMappingMode( RimRegularLegendConfig::LINEAR_DISCRETE );
legendConfig()->setColorLegend(
RimRegularLegendConfig::mapToColorLegend( RimRegularLegendConfig::ColorRangesType::NORMAL ) );
legendConfig()->setMappingMode( RimRegularLegendConfig::MappingType::LINEAR_DISCRETE );
}
destroyCurves();
@ -1310,7 +1313,7 @@ void RimGridCrossPlotDataSet::setDefaults()
{
m_grouping = GROUP_BY_FORMATION;
m_groupingProperty->legendConfig()->setColorLegend(
RimRegularLegendConfig::mapToColorLegend( RimRegularLegendConfig::CATEGORY ) );
RimRegularLegendConfig::mapToColorLegend( RimRegularLegendConfig::ColorRangesType::CATEGORY ) );
}
}
}

View File

@ -99,7 +99,7 @@ void RimColorLegendCollection::createStandardColorLegends()
QString legendName = ColorRangeEnum::uiTextFromIndex( typeIdx );
cvf::Color3ubArray colorArray = RimRegularLegendConfig::colorArrayFromColorType( colorType );
if ( colorType == RimRegularLegendConfig::CATEGORY )
if ( colorType == RimRegularLegendConfig::ColorRangesType::CATEGORY )
{
// Reverse the ordering of the category items in the category legend to match the changes
// for fixing issue https://github.com/OPM/ResInsight/issues/6252

View File

@ -832,11 +832,11 @@ void RimContourMapProjection::generateTrianglesWithVertexValues()
bool discrete = false;
std::vector<double> contourLevels;
if ( legendConfig()->mappingMode() != RimRegularLegendConfig::CATEGORY_INTEGER )
if ( legendConfig()->mappingMode() != RimRegularLegendConfig::MappingType::CATEGORY_INTEGER )
{
legendConfig()->scalarMapper()->majorTickValues( &contourLevels );
if ( legendConfig()->mappingMode() == RimRegularLegendConfig::LINEAR_DISCRETE ||
legendConfig()->mappingMode() == RimRegularLegendConfig::LOG10_DISCRETE )
if ( legendConfig()->mappingMode() == RimRegularLegendConfig::MappingType::LINEAR_DISCRETE ||
legendConfig()->mappingMode() == RimRegularLegendConfig::MappingType::LOG10_DISCRETE )
{
discrete = true;
}
@ -1082,7 +1082,7 @@ void RimContourMapProjection::generateContourPolygons()
std::vector<ContourPolygons> contourPolygons;
std::vector<double> contourLevels;
if ( resultRangeIsValid() && legendConfig()->mappingMode() != RimRegularLegendConfig::CATEGORY_INTEGER )
if ( resultRangeIsValid() && legendConfig()->mappingMode() != RimRegularLegendConfig::MappingType::CATEGORY_INTEGER )
{
legendConfig()->scalarMapper()->majorTickValues( &contourLevels );
int nContourLevels = static_cast<int>( contourLevels.size() );
@ -1092,8 +1092,8 @@ void RimContourMapProjection::generateContourPolygons()
{
if ( nContourLevels > 2 )
{
if ( legendConfig()->mappingMode() == RimRegularLegendConfig::LINEAR_DISCRETE ||
legendConfig()->mappingMode() == RimRegularLegendConfig::LINEAR_CONTINUOUS )
if ( legendConfig()->mappingMode() == RimRegularLegendConfig::MappingType::LINEAR_DISCRETE ||
legendConfig()->mappingMode() == RimRegularLegendConfig::MappingType::LINEAR_CONTINUOUS )
{
contourLevels.front() -= 0.01 * ( contourLevels.back() - contourLevels.front() );
}

View File

@ -169,8 +169,8 @@ void RimEclipseCellColors::changeLegendConfig( QString resultVarNameOfNewLegend
if ( useLog )
{
newLegend->setMappingMode( RimRegularLegendConfig::LOG10_CONTINUOUS );
newLegend->setTickNumberFormat( RimRegularLegendConfig::AUTO );
newLegend->setMappingMode( RimRegularLegendConfig::MappingType::LOG10_CONTINUOUS );
newLegend->setTickNumberFormat( RimRegularLegendConfig::NumberFormatType::AUTO );
}
m_legendConfigData.push_back( newLegend );
@ -249,19 +249,22 @@ void RimEclipseCellColors::updateLegendCategorySettings()
if ( this->hasCategoryResult() )
{
legendConfig()->setMappingMode( RimRegularLegendConfig::CATEGORY_INTEGER );
legendConfig()->setColorLegend( RimRegularLegendConfig::mapToColorLegend( RimRegularLegendConfig::CATEGORY ) );
legendConfig()->setMappingMode( RimRegularLegendConfig::MappingType::CATEGORY_INTEGER );
legendConfig()->setColorLegend(
RimRegularLegendConfig::mapToColorLegend( RimRegularLegendConfig::ColorRangesType::CATEGORY ) );
}
else
{
if ( legendConfig()->mappingMode() == RimRegularLegendConfig::CATEGORY_INTEGER )
if ( legendConfig()->mappingMode() == RimRegularLegendConfig::MappingType::CATEGORY_INTEGER )
{
legendConfig()->setMappingMode( RimRegularLegendConfig::LINEAR_CONTINUOUS );
legendConfig()->setMappingMode( RimRegularLegendConfig::MappingType::LINEAR_CONTINUOUS );
}
if ( legendConfig()->colorLegend() == RimRegularLegendConfig::mapToColorLegend( RimRegularLegendConfig::CATEGORY ) )
if ( legendConfig()->colorLegend() ==
RimRegularLegendConfig::mapToColorLegend( RimRegularLegendConfig::ColorRangesType::CATEGORY ) )
{
legendConfig()->setColorLegend( RimRegularLegendConfig::mapToColorLegend( RimRegularLegendConfig::NORMAL ) );
legendConfig()->setColorLegend(
RimRegularLegendConfig::mapToColorLegend( RimRegularLegendConfig::ColorRangesType::NORMAL ) );
}
}
}

View File

@ -195,7 +195,7 @@ RimEclipseView::RimEclipseView()
this->cellResult()->setReservoirView( this );
this->cellEdgeResult()->setReservoirView( this );
this->cellEdgeResult()->legendConfig()->setColorLegend(
RimRegularLegendConfig::mapToColorLegend( RimRegularLegendConfig::PINK_WHITE ) );
RimRegularLegendConfig::mapToColorLegend( RimRegularLegendConfig::ColorRangesType::PINK_WHITE ) );
this->faultResultSettings()->setReservoirView( this );

View File

@ -198,11 +198,11 @@ void RimElementVectorResult::mappingRange( double& min, double& max ) const
resultsData->ensureKnownResultLoaded( resVarAddr );
if ( m_legendConfig->rangeMode() == RimRegularLegendConfig::AUTOMATIC_ALLTIMESTEPS )
if ( m_legendConfig->rangeMode() == RimRegularLegendConfig::RangeModeType::AUTOMATIC_ALLTIMESTEPS )
{
resultsData->minMaxCellScalarValues( resVarAddr, min, max );
}
else if ( m_legendConfig->rangeMode() == RimRegularLegendConfig::AUTOMATIC_CURRENT_TIMESTEP )
else if ( m_legendConfig->rangeMode() == RimRegularLegendConfig::RangeModeType::AUTOMATIC_CURRENT_TIMESTEP )
{
resultsData->minMaxCellScalarValues( resVarAddr, currentTimeStep, min, max );
}

View File

@ -85,19 +85,22 @@ void RimGeoMechCellColors::updateLegendCategorySettings()
{
if ( this->hasCategoryResult() )
{
legendConfig->setMappingMode( RimRegularLegendConfig::CATEGORY_INTEGER );
legendConfig->setColorLegend( RimRegularLegendConfig::mapToColorLegend( RimRegularLegendConfig::CATEGORY ) );
legendConfig->setMappingMode( RimRegularLegendConfig::MappingType::CATEGORY_INTEGER );
legendConfig->setColorLegend(
RimRegularLegendConfig::mapToColorLegend( RimRegularLegendConfig::ColorRangesType::CATEGORY ) );
}
else
{
if ( legendConfig->mappingMode() == RimRegularLegendConfig::CATEGORY_INTEGER )
if ( legendConfig->mappingMode() == RimRegularLegendConfig::MappingType::CATEGORY_INTEGER )
{
legendConfig->setMappingMode( RimRegularLegendConfig::LINEAR_CONTINUOUS );
legendConfig->setMappingMode( RimRegularLegendConfig::MappingType::LINEAR_CONTINUOUS );
}
if ( legendConfig->colorLegend() == RimRegularLegendConfig::mapToColorLegend( RimRegularLegendConfig::CATEGORY ) )
if ( legendConfig->colorLegend() ==
RimRegularLegendConfig::mapToColorLegend( RimRegularLegendConfig::ColorRangesType::CATEGORY ) )
{
legendConfig->setColorLegend( RimRegularLegendConfig::mapToColorLegend( RimRegularLegendConfig::NORMAL ) );
legendConfig->setColorLegend(
RimRegularLegendConfig::mapToColorLegend( RimRegularLegendConfig::ColorRangesType::NORMAL ) );
}
}
}

View File

@ -239,22 +239,22 @@ void RimIntersectionResultDefinition::updateLegendRangesTextAndVisibility( const
if ( ( this->isEclipseResultDefinition() && m_eclipseResultDefinition()->hasCategoryResult() ) ||
( !this->isEclipseResultDefinition() && m_geomResultDefinition()->hasCategoryResult() ) )
{
regularLegendConfig()->setMappingMode( RimRegularLegendConfig::CATEGORY_INTEGER );
regularLegendConfig()->setMappingMode( RimRegularLegendConfig::MappingType::CATEGORY_INTEGER );
regularLegendConfig()->setColorLegend(
RimRegularLegendConfig::mapToColorLegend( RimRegularLegendConfig::CATEGORY ) );
RimRegularLegendConfig::mapToColorLegend( RimRegularLegendConfig::ColorRangesType::CATEGORY ) );
}
else
{
if ( regularLegendConfig()->mappingMode() == RimRegularLegendConfig::CATEGORY_INTEGER )
if ( regularLegendConfig()->mappingMode() == RimRegularLegendConfig::MappingType::CATEGORY_INTEGER )
{
regularLegendConfig()->setMappingMode( RimRegularLegendConfig::LINEAR_CONTINUOUS );
regularLegendConfig()->setMappingMode( RimRegularLegendConfig::MappingType::LINEAR_CONTINUOUS );
}
if ( regularLegendConfig()->colorLegend() ==
RimRegularLegendConfig::mapToColorLegend( RimRegularLegendConfig::CATEGORY ) )
RimRegularLegendConfig::mapToColorLegend( RimRegularLegendConfig::ColorRangesType::CATEGORY ) )
{
regularLegendConfig()->setColorLegend(
RimRegularLegendConfig::mapToColorLegend( RimRegularLegendConfig::NORMAL ) );
RimRegularLegendConfig::mapToColorLegend( RimRegularLegendConfig::ColorRangesType::NORMAL ) );
}
}

View File

@ -28,10 +28,14 @@ namespace caf
template <>
void AppEnum<RimLegendConfig::RangeModeType>::setUp()
{
addItem( RimLegendConfig::AUTOMATIC_ALLTIMESTEPS, "AUTOMATIC_ALLTIMESTEPS", "Min and Max for All Timesteps" );
addItem( RimLegendConfig::AUTOMATIC_CURRENT_TIMESTEP, "AUTOMATIC_CURRENT_TIMESTEP", "Min and Max for Current Timestep" );
addItem( RimLegendConfig::USER_DEFINED, "USER_DEFINED_MAX_MIN", "User Defined Range" );
setDefault( RimLegendConfig::AUTOMATIC_ALLTIMESTEPS );
addItem( RimLegendConfig::RangeModeType::AUTOMATIC_ALLTIMESTEPS,
"AUTOMATIC_ALLTIMESTEPS",
"Min and Max for All Timesteps" );
addItem( RimLegendConfig::RangeModeType::AUTOMATIC_CURRENT_TIMESTEP,
"AUTOMATIC_CURRENT_TIMESTEP",
"Min and Max for Current Timestep" );
addItem( RimLegendConfig::RangeModeType::USER_DEFINED, "USER_DEFINED_MAX_MIN", "User Defined Range" );
setDefault( RimLegendConfig::RangeModeType::AUTOMATIC_ALLTIMESTEPS );
}
} // namespace caf

View File

@ -39,7 +39,7 @@ public:
RimLegendConfig();
~RimLegendConfig() override;
enum RangeModeType
enum class RangeModeType
{
AUTOMATIC_ALLTIMESTEPS,
AUTOMATIC_CURRENT_TIMESTEP,

View File

@ -78,26 +78,26 @@ namespace caf
template <>
void RimRegularLegendConfig::ColorRangeEnum::setUp()
{
addItem( RimRegularLegendConfig::NORMAL, "NORMAL", "Full color, Red on top" );
addItem( RimRegularLegendConfig::OPPOSITE_NORMAL, "OPPOSITE_NORMAL", "Full color, Blue on top" );
addItem( RimRegularLegendConfig::WHITE_PINK, "WHITE_PIMK", "White to pink" );
addItem( RimRegularLegendConfig::PINK_WHITE, "PINK_WHITE", "Pink to white" );
addItem( RimRegularLegendConfig::BLUE_WHITE_RED, "BLUE_WHITE_RED", "Blue, white, red" );
addItem( RimRegularLegendConfig::RED_WHITE_BLUE, "RED_WHITE_BLUE", "Red, white, blue" );
addItem( RimRegularLegendConfig::WHITE_BLACK, "WHITE_BLACK", "White to black" );
addItem( RimRegularLegendConfig::BLACK_WHITE, "BLACK_WHITE", "Black to white" );
addItem( RimRegularLegendConfig::CATEGORY, "CATEGORY", "Category colors" );
addItem( RimRegularLegendConfig::ANGULAR, "ANGULAR", "Full color cyclic" );
addItem( RimRegularLegendConfig::RAINBOW, "RAINBOW", "Rainbow Palette" );
addItem( RimRegularLegendConfig::STIMPLAN, "STIMPLAN", "StimPlan colors" );
addItem( RimRegularLegendConfig::RED_LIGHT_DARK, "RED_DARK_LIGHT", "Red Light to Dark" );
addItem( RimRegularLegendConfig::GREEN_LIGHT_DARK, "GREEN_DARK_LIGHT", "Green Light to Dark" );
addItem( RimRegularLegendConfig::BLUE_LIGHT_DARK, "BLUE_DARK_LIGHT", "Blue Light to Dark" );
addItem( RimRegularLegendConfig::GREEN_RED, "GREEN_RED", "Green to Red" );
addItem( RimRegularLegendConfig::BLUE_MAGENTA, "BLUE_MAGENTA", "Blue to Magenta" );
addItem( RimRegularLegendConfig::CORRELATION, "CORRELATION", "Correlation colors" );
addItem( RimRegularLegendConfig::UNDEFINED, "UNDEFINED", "Undefined" );
setDefault( RimRegularLegendConfig::UNDEFINED );
addItem( RimRegularLegendConfig::ColorRangesType::NORMAL, "NORMAL", "Full color, Red on top" );
addItem( RimRegularLegendConfig::ColorRangesType::OPPOSITE_NORMAL, "OPPOSITE_NORMAL", "Full color, Blue on top" );
addItem( RimRegularLegendConfig::ColorRangesType::WHITE_PINK, "WHITE_PIMK", "White to pink" );
addItem( RimRegularLegendConfig::ColorRangesType::PINK_WHITE, "PINK_WHITE", "Pink to white" );
addItem( RimRegularLegendConfig::ColorRangesType::BLUE_WHITE_RED, "BLUE_WHITE_RED", "Blue, white, red" );
addItem( RimRegularLegendConfig::ColorRangesType::RED_WHITE_BLUE, "RED_WHITE_BLUE", "Red, white, blue" );
addItem( RimRegularLegendConfig::ColorRangesType::WHITE_BLACK, "WHITE_BLACK", "White to black" );
addItem( RimRegularLegendConfig::ColorRangesType::BLACK_WHITE, "BLACK_WHITE", "Black to white" );
addItem( RimRegularLegendConfig::ColorRangesType::CATEGORY, "CATEGORY", "Category colors" );
addItem( RimRegularLegendConfig::ColorRangesType::ANGULAR, "ANGULAR", "Full color cyclic" );
addItem( RimRegularLegendConfig::ColorRangesType::RAINBOW, "RAINBOW", "Rainbow Palette" );
addItem( RimRegularLegendConfig::ColorRangesType::STIMPLAN, "STIMPLAN", "StimPlan colors" );
addItem( RimRegularLegendConfig::ColorRangesType::RED_LIGHT_DARK, "RED_DARK_LIGHT", "Red Light to Dark" );
addItem( RimRegularLegendConfig::ColorRangesType::GREEN_LIGHT_DARK, "GREEN_DARK_LIGHT", "Green Light to Dark" );
addItem( RimRegularLegendConfig::ColorRangesType::BLUE_LIGHT_DARK, "BLUE_DARK_LIGHT", "Blue Light to Dark" );
addItem( RimRegularLegendConfig::ColorRangesType::GREEN_RED, "GREEN_RED", "Green to Red" );
addItem( RimRegularLegendConfig::ColorRangesType::BLUE_MAGENTA, "BLUE_MAGENTA", "Blue to Magenta" );
addItem( RimRegularLegendConfig::ColorRangesType::CORRELATION, "CORRELATION", "Correlation colors" );
addItem( RimRegularLegendConfig::ColorRangesType::UNDEFINED, "UNDEFINED", "Undefined" );
setDefault( RimRegularLegendConfig::ColorRangesType::UNDEFINED );
}
} // namespace caf
@ -106,12 +106,12 @@ namespace caf
template <>
void RimRegularLegendConfig::MappingEnum::setUp()
{
addItem( RimRegularLegendConfig::LINEAR_DISCRETE, "LinearDiscrete", "Discrete Linear" );
addItem( RimRegularLegendConfig::LINEAR_CONTINUOUS, "LinearContinuous", "Continuous Linear" );
addItem( RimRegularLegendConfig::LOG10_CONTINUOUS, "Log10Continuous", "Continuous Logarithmic" );
addItem( RimRegularLegendConfig::LOG10_DISCRETE, "Log10Discrete", "Discrete Logarithmic" );
addItem( RimRegularLegendConfig::CATEGORY_INTEGER, "Category", "Category" );
setDefault( RimRegularLegendConfig::LINEAR_CONTINUOUS );
addItem( RimRegularLegendConfig::MappingType::LINEAR_DISCRETE, "LinearDiscrete", "Discrete Linear" );
addItem( RimRegularLegendConfig::MappingType::LINEAR_CONTINUOUS, "LinearContinuous", "Continuous Linear" );
addItem( RimRegularLegendConfig::MappingType::LOG10_CONTINUOUS, "Log10Continuous", "Continuous Logarithmic" );
addItem( RimRegularLegendConfig::MappingType::LOG10_DISCRETE, "Log10Discrete", "Discrete Logarithmic" );
addItem( RimRegularLegendConfig::MappingType::CATEGORY_INTEGER, "Category", "Category" );
setDefault( RimRegularLegendConfig::MappingType::LINEAR_CONTINUOUS );
}
} // namespace caf
@ -120,10 +120,10 @@ namespace caf
template <>
void AppEnum<RimRegularLegendConfig::NumberFormatType>::setUp()
{
addItem( RimRegularLegendConfig::AUTO, "AUTO", "Automatic" );
addItem( RimRegularLegendConfig::FIXED, "FIXED", "Fixed, decimal" );
addItem( RimRegularLegendConfig::SCIENTIFIC, "SCIENTIFIC", "Scientific notation" );
setDefault( RimRegularLegendConfig::FIXED );
addItem( RimRegularLegendConfig::NumberFormatType::AUTO, "AUTO", "Automatic" );
addItem( RimRegularLegendConfig::NumberFormatType::FIXED, "FIXED", "Fixed, decimal" );
addItem( RimRegularLegendConfig::NumberFormatType::SCIENTIFIC, "SCIENTIFIC", "Scientific notation" );
setDefault( RimRegularLegendConfig::NumberFormatType::FIXED );
}
} // namespace caf
@ -155,23 +155,29 @@ RimRegularLegendConfig::RimRegularLegendConfig()
m_significantDigitsInData = m_precision;
CAF_PDM_InitField( &m_tickNumberFormat,
"TickNumberFormat",
caf::AppEnum<RimRegularLegendConfig::NumberFormatType>( FIXED ),
caf::AppEnum<RimRegularLegendConfig::NumberFormatType>( NumberFormatType::FIXED ),
"Number format",
"",
"",
"" );
CAF_PDM_InitField( &m_colorRangeMode_OBSOLETE, "ColorRangeMode", ColorRangeEnum( UNDEFINED ), "Colors", "", "", "" );
CAF_PDM_InitField( &m_colorRangeMode_OBSOLETE,
"ColorRangeMode",
ColorRangeEnum( ColorRangesType::UNDEFINED ),
"Colors",
"",
"",
"" );
m_colorRangeMode_OBSOLETE.uiCapability()->setUiHidden( true );
m_colorRangeMode_OBSOLETE.xmlCapability()->setIOWritable( false );
CAF_PDM_InitFieldNoDefault( &m_colorLegend, "ColorLegend", "Colors", "", "", "" );
m_colorLegend = mapToColorLegend( ColorRangeEnum( NORMAL ) );
m_colorLegend = mapToColorLegend( ColorRangeEnum( ColorRangesType::NORMAL ) );
CAF_PDM_InitField( &m_mappingMode, "MappingMode", MappingEnum( LINEAR_CONTINUOUS ), "Mapping", "", "", "" );
CAF_PDM_InitField( &m_mappingMode, "MappingMode", MappingEnum( MappingType::LINEAR_CONTINUOUS ), "Mapping", "", "", "" );
CAF_PDM_InitField( &m_rangeMode,
"RangeType",
RangeModeEnum( AUTOMATIC_ALLTIMESTEPS ),
RangeModeEnum( RangeModeType::AUTOMATIC_ALLTIMESTEPS ),
"Range Type",
"",
"Switches between automatic and user defined range on the legend",
@ -247,7 +253,7 @@ void RimRegularLegendConfig::fieldChangedByUi( const caf::PdmFieldHandle* change
}
else if ( changedField == &m_rangeMode || changedField == &m_mappingMode )
{
if ( m_rangeMode == USER_DEFINED )
if ( m_rangeMode == RangeModeType::USER_DEFINED )
{
if ( m_userDefinedMaxValue == m_userDefinedMaxValue.defaultValue() && m_globalAutoMax != cvf::UNDEFINED_DOUBLE )
{
@ -333,7 +339,7 @@ void RimRegularLegendConfig::updateLegend()
double posClosestToZero = cvf::UNDEFINED_DOUBLE;
double negClosestToZero = cvf::UNDEFINED_DOUBLE;
if ( m_rangeMode == AUTOMATIC_ALLTIMESTEPS )
if ( m_rangeMode == RangeModeType::AUTOMATIC_ALLTIMESTEPS )
{
adjustedMin = roundToNumSignificantDigits( m_globalAutoMin, m_precision );
adjustedMax = roundToNumSignificantDigits( m_globalAutoMax, m_precision );
@ -341,7 +347,7 @@ void RimRegularLegendConfig::updateLegend()
posClosestToZero = m_globalAutoPosClosestToZero;
negClosestToZero = m_globalAutoNegClosestToZero;
}
else if ( m_rangeMode == AUTOMATIC_CURRENT_TIMESTEP )
else if ( m_rangeMode == RangeModeType::AUTOMATIC_CURRENT_TIMESTEP )
{
adjustedMin = roundToNumSignificantDigits( m_localAutoMin, m_precision );
adjustedMax = roundToNumSignificantDigits( m_localAutoMax, m_precision );
@ -361,7 +367,7 @@ void RimRegularLegendConfig::updateLegend()
m_linDiscreteScalarMapper->setRange( adjustedMin, adjustedMax );
m_linSmoothScalarMapper->setRange( adjustedMin, adjustedMax );
if ( m_mappingMode == LOG10_CONTINUOUS || m_mappingMode == LOG10_DISCRETE )
if ( m_mappingMode == MappingType::LOG10_CONTINUOUS || m_mappingMode == MappingType::LOG10_DISCRETE )
{
if ( adjustedMin != adjustedMax )
{
@ -417,19 +423,19 @@ void RimRegularLegendConfig::updateLegend()
switch ( m_mappingMode() )
{
case LINEAR_DISCRETE:
case MappingType::LINEAR_DISCRETE:
m_currentScalarMapper = m_linDiscreteScalarMapper.p();
break;
case LINEAR_CONTINUOUS:
case MappingType::LINEAR_CONTINUOUS:
m_currentScalarMapper = m_linSmoothScalarMapper.p();
break;
case LOG10_CONTINUOUS:
case MappingType::LOG10_CONTINUOUS:
m_currentScalarMapper = m_logSmoothScalarMapper.p();
break;
case LOG10_DISCRETE:
case MappingType::LOG10_DISCRETE:
m_currentScalarMapper = m_logDiscreteScalarMapper.p();
break;
case CATEGORY_INTEGER:
case MappingType::CATEGORY_INTEGER:
m_categoryMapper->setCategoriesWithNames( m_categories, m_categoryNames );
if ( m_categoryColors.size() > 0 )
@ -453,7 +459,7 @@ void RimRegularLegendConfig::updateLegend()
}
double decadesInRange = 0;
if ( m_mappingMode == LOG10_CONTINUOUS || m_mappingMode == LOG10_DISCRETE )
if ( m_mappingMode == MappingType::LOG10_CONTINUOUS || m_mappingMode == MappingType::LOG10_DISCRETE )
{
// For log mapping, use the min value as reference for num valid digits
decadesInRange = cvf::Math::abs( adjustedMin ) < cvf::Math::abs( adjustedMax ) ? cvf::Math::abs( adjustedMin )
@ -475,7 +481,7 @@ void RimRegularLegendConfig::updateLegend()
// Set the fixed number of digits after the decimal point to the number needed to show all the significant digits.
int numDecimalDigits = m_precision();
if ( nft != SCIENTIFIC )
if ( nft != NumberFormatType::SCIENTIFIC )
{
numDecimalDigits -= static_cast<int>( decadesInRange );
}
@ -523,12 +529,13 @@ void RimRegularLegendConfig::setTickNumberFormat( NumberFormatType numberFormat
void RimRegularLegendConfig::disableAllTimeStepsRange( bool doDisable )
{
// If we enable AllTimesteps, and we have used current timestep, then "restore" the default
if ( m_isAllTimeStepsRangeDisabled && !doDisable && m_rangeMode == AUTOMATIC_CURRENT_TIMESTEP )
m_rangeMode = AUTOMATIC_ALLTIMESTEPS;
if ( m_isAllTimeStepsRangeDisabled && !doDisable && m_rangeMode == RangeModeType::AUTOMATIC_CURRENT_TIMESTEP )
m_rangeMode = RangeModeType::AUTOMATIC_ALLTIMESTEPS;
m_isAllTimeStepsRangeDisabled = doDisable;
if ( doDisable && m_rangeMode == AUTOMATIC_ALLTIMESTEPS ) m_rangeMode = AUTOMATIC_CURRENT_TIMESTEP;
if ( doDisable && m_rangeMode == RangeModeType::AUTOMATIC_ALLTIMESTEPS )
m_rangeMode = RangeModeType::AUTOMATIC_CURRENT_TIMESTEP;
}
//--------------------------------------------------------------------------------------------------
@ -565,7 +572,7 @@ void RimRegularLegendConfig::initAfterRead()
resultVariableName = RiaDefines::formationAllanResultName();
}
if ( m_colorRangeMode_OBSOLETE() != RimRegularLegendConfig::UNDEFINED )
if ( m_colorRangeMode_OBSOLETE() != RimRegularLegendConfig::ColorRangesType::UNDEFINED )
{
m_colorLegend = RimRegularLegendConfig::mapToColorLegend( m_colorRangeMode_OBSOLETE() );
}
@ -593,14 +600,14 @@ caf::PdmFieldHandle* RimRegularLegendConfig::objectToggleField()
//--------------------------------------------------------------------------------------------------
void RimRegularLegendConfig::updateFieldVisibility()
{
bool showRangeItems = m_mappingMode == CATEGORY_INTEGER ? false : true;
bool showRangeItems = m_mappingMode == MappingType::CATEGORY_INTEGER ? false : true;
m_numLevels.uiCapability()->setUiHidden( !showRangeItems );
m_precision.uiCapability()->setUiHidden( !showRangeItems );
m_tickNumberFormat.uiCapability()->setUiHidden( !showRangeItems );
m_rangeMode.uiCapability()->setUiHidden( !showRangeItems );
if ( showRangeItems && m_rangeMode == USER_DEFINED )
if ( showRangeItems && m_rangeMode == RangeModeType::USER_DEFINED )
{
m_userDefinedMaxValue.uiCapability()->setUiHidden( false );
m_userDefinedMinValue.uiCapability()->setUiHidden( false );
@ -908,43 +915,43 @@ cvf::Color3ubArray RimRegularLegendConfig::colorArrayFromColorType( ColorRangesT
{
switch ( colorType )
{
case RimRegularLegendConfig::NORMAL:
case RimRegularLegendConfig::ColorRangesType::NORMAL:
return RiaColorTables::normalPaletteColors().color3ubArray();
break;
case RimRegularLegendConfig::OPPOSITE_NORMAL:
case RimRegularLegendConfig::ColorRangesType::OPPOSITE_NORMAL:
return RiaColorTables::normalPaletteOppositeOrderingColors().color3ubArray();
break;
case RimRegularLegendConfig::WHITE_PINK:
case RimRegularLegendConfig::ColorRangesType::WHITE_PINK:
return RiaColorTables::whitePinkPaletteColors().color3ubArray();
break;
case RimRegularLegendConfig::PINK_WHITE:
case RimRegularLegendConfig::ColorRangesType::PINK_WHITE:
return RiaColorTables::pinkWhitePaletteColors().color3ubArray();
break;
case RimRegularLegendConfig::WHITE_BLACK:
case RimRegularLegendConfig::ColorRangesType::WHITE_BLACK:
return RiaColorTables::whiteBlackPaletteColors().color3ubArray();
break;
case RimRegularLegendConfig::BLACK_WHITE:
case RimRegularLegendConfig::ColorRangesType::BLACK_WHITE:
return RiaColorTables::blackWhitePaletteColors().color3ubArray();
break;
case RimRegularLegendConfig::BLUE_WHITE_RED:
case RimRegularLegendConfig::ColorRangesType::BLUE_WHITE_RED:
return RiaColorTables::blueWhiteRedPaletteColors().color3ubArray();
break;
case RimRegularLegendConfig::RED_WHITE_BLUE:
case RimRegularLegendConfig::ColorRangesType::RED_WHITE_BLUE:
return RiaColorTables::redWhiteBluePaletteColors().color3ubArray();
break;
case RimRegularLegendConfig::CATEGORY:
case RimRegularLegendConfig::ColorRangesType::CATEGORY:
return RiaColorTables::categoryPaletteColors().color3ubArray();
break;
case RimRegularLegendConfig::ANGULAR:
case RimRegularLegendConfig::ColorRangesType::ANGULAR:
return RiaColorTables::angularPaletteColors().color3ubArray();
break;
case RimRegularLegendConfig::RAINBOW:
case RimRegularLegendConfig::ColorRangesType::RAINBOW:
return RiaColorTables::rainbowPaletteColors().color3ubArray();
break;
case RimRegularLegendConfig::STIMPLAN:
case RimRegularLegendConfig::ColorRangesType::STIMPLAN:
return RiaColorTables::stimPlanPaletteColors().color3ubArray();
break;
case RimRegularLegendConfig::CORRELATION:
case RimRegularLegendConfig::ColorRangesType::CORRELATION:
return RiaColorTables::correlationPaletteColors().color3ubArray();
break;
default:
@ -1060,17 +1067,17 @@ QList<caf::PdmOptionItemInfo>
std::vector<MappingType> mappingTypes;
if ( !isAllanDiagram )
{
mappingTypes.push_back( LINEAR_DISCRETE );
mappingTypes.push_back( MappingType::LINEAR_DISCRETE );
if ( !crossPlotCurveSet )
{
mappingTypes.push_back( LINEAR_CONTINUOUS );
mappingTypes.push_back( LOG10_CONTINUOUS );
mappingTypes.push_back( MappingType::LINEAR_CONTINUOUS );
mappingTypes.push_back( MappingType::LOG10_CONTINUOUS );
}
mappingTypes.push_back( LOG10_DISCRETE );
mappingTypes.push_back( MappingType::LOG10_DISCRETE );
}
mappingTypes.push_back( CATEGORY_INTEGER );
mappingTypes.push_back( MappingType::CATEGORY_INTEGER );
for ( MappingType mapType : mappingTypes )
{
@ -1097,20 +1104,23 @@ QList<caf::PdmOptionItemInfo>
{
QString uiText;
if ( !hasEnsembleCurveSetParent )
uiText = RangeModeEnum::uiText( RimRegularLegendConfig::AUTOMATIC_ALLTIMESTEPS );
uiText = RangeModeEnum::uiText( RimRegularLegendConfig::RangeModeType::AUTOMATIC_ALLTIMESTEPS );
else
uiText = "Auto Range";
options.push_back( caf::PdmOptionItemInfo( uiText, RimRegularLegendConfig::AUTOMATIC_ALLTIMESTEPS ) );
options.push_back(
caf::PdmOptionItemInfo( uiText, RimRegularLegendConfig::RangeModeType::AUTOMATIC_ALLTIMESTEPS ) );
}
if ( !hasStimPlanParent && !hasEnsembleCurveSetParent && !hasRftPlotParent )
{
options.push_back(
caf::PdmOptionItemInfo( RangeModeEnum::uiText( RimRegularLegendConfig::AUTOMATIC_CURRENT_TIMESTEP ),
RimRegularLegendConfig::AUTOMATIC_CURRENT_TIMESTEP ) );
caf::PdmOptionItemInfo( RangeModeEnum::uiText(
RimRegularLegendConfig::RangeModeType::AUTOMATIC_CURRENT_TIMESTEP ),
RimRegularLegendConfig::RangeModeType::AUTOMATIC_CURRENT_TIMESTEP ) );
}
options.push_back( caf::PdmOptionItemInfo( RangeModeEnum::uiText( RimRegularLegendConfig::USER_DEFINED ),
RimRegularLegendConfig::USER_DEFINED ) );
options.push_back(
caf::PdmOptionItemInfo( RangeModeEnum::uiText( RimRegularLegendConfig::RangeModeType::USER_DEFINED ),
RimRegularLegendConfig::RangeModeType::USER_DEFINED ) );
}
return options;

View File

@ -67,7 +67,7 @@ public:
caf::PdmField<QString> resultVariableName; // Used internally to describe the variable this legend setup is used for
enum ColorRangesType
enum class ColorRangesType
{
NORMAL,
OPPOSITE_NORMAL,
@ -95,7 +95,7 @@ public:
typedef caf::AppEnum<ColorRangesType> ColorRangeEnum;
enum MappingType
enum class MappingType
{
LINEAR_DISCRETE,
LINEAR_CONTINUOUS,
@ -103,7 +103,7 @@ public:
LOG10_DISCRETE,
CATEGORY_INTEGER
};
enum NumberFormatType
enum class NumberFormatType
{
AUTO,
SCIENTIFIC,

View File

@ -147,8 +147,9 @@ void RimStimPlanColors::loadDataAndUpdate()
{
RimRegularLegendConfig* legendConfig = new RimRegularLegendConfig();
legendConfig->resultVariableName = resultNameUnitString;
legendConfig->setMappingMode( RimRegularLegendConfig::LINEAR_DISCRETE );
legendConfig->setColorLegend( RimRegularLegendConfig::mapToColorLegend( RimRegularLegendConfig::STIMPLAN ) );
legendConfig->setMappingMode( RimRegularLegendConfig::MappingType::LINEAR_DISCRETE );
legendConfig->setColorLegend(
RimRegularLegendConfig::mapToColorLegend( RimRegularLegendConfig::ColorRangesType::STIMPLAN ) );
m_legendConfigurations.push_back( legendConfig );
}

View File

@ -85,7 +85,7 @@ RimTensorResults::RimTensorResults()
CAF_PDM_InitField( &m_sizeScale, "SizeScale", 1.0f, "Size Scale", "", "", "" );
CAF_PDM_InitField( &m_rangeMode,
"RangeType",
RimRegularLegendConfig::RangeModeEnum( RimRegularLegendConfig::AUTOMATIC_ALLTIMESTEPS ),
RimRegularLegendConfig::RangeModeEnum( RimRegularLegendConfig::RangeModeType::AUTOMATIC_ALLTIMESTEPS ),
"Range Type",
"",
"Switches between automatic and user defined range",
@ -204,11 +204,11 @@ void RimTensorResults::mappingRange( double* min, double* max ) const
RigFemPartResultsCollection* resultCollection = geoMechView->geoMechCase()->geoMechData()->femPartResults();
if ( !resultCollection ) return;
if ( m_rangeMode == RimRegularLegendConfig::AUTOMATIC_ALLTIMESTEPS )
if ( m_rangeMode == RimRegularLegendConfig::RangeModeType::AUTOMATIC_ALLTIMESTEPS )
{
resultCollection->minMaxScalarValuesOverAllTensorComponents( selectedTensorResult(), min, max );
}
else if ( m_rangeMode == RimRegularLegendConfig::AUTOMATIC_CURRENT_TIMESTEP )
else if ( m_rangeMode == RimRegularLegendConfig::RangeModeType::AUTOMATIC_CURRENT_TIMESTEP )
{
resultCollection->minMaxScalarValuesOverAllTensorComponents( selectedTensorResult(), currentTimeStep, min, max );
}
@ -308,11 +308,11 @@ QList<caf::PdmOptionItemInfo> RimTensorResults::calculateValueOptions( const caf
else if ( fieldNeedingOptions == &m_rangeMode )
{
options.push_back( caf::PdmOptionItemInfo( RimRegularLegendConfig::RangeModeEnum::uiText(
RimRegularLegendConfig::AUTOMATIC_ALLTIMESTEPS ),
RimRegularLegendConfig::AUTOMATIC_ALLTIMESTEPS ) );
RimRegularLegendConfig::RangeModeType::AUTOMATIC_ALLTIMESTEPS ),
RimRegularLegendConfig::RangeModeType::AUTOMATIC_ALLTIMESTEPS ) );
options.push_back( caf::PdmOptionItemInfo( RimRegularLegendConfig::RangeModeEnum::uiText(
RimRegularLegendConfig::AUTOMATIC_CURRENT_TIMESTEP ),
RimRegularLegendConfig::AUTOMATIC_CURRENT_TIMESTEP ) );
RimRegularLegendConfig::RangeModeType::AUTOMATIC_CURRENT_TIMESTEP ),
RimRegularLegendConfig::RangeModeType::AUTOMATIC_CURRENT_TIMESTEP ) );
}
return options;

View File

@ -56,7 +56,7 @@ RimTernaryLegendConfig::RimTernaryLegendConfig()
"" );
CAF_PDM_InitField( &rangeMode,
"RangeType",
RangeModeEnum( USER_DEFINED ),
RangeModeEnum( RangeModeType::USER_DEFINED ),
"Range type",
"",
"Switches between automatic and user defined range on the legend",
@ -299,7 +299,7 @@ void RimTernaryLegendConfig::defineUiOrdering( QString uiConfigName, caf::PdmUiO
formatGr->add( &precision );
formatGr->add( &rangeMode );
if ( rangeMode == USER_DEFINED )
if ( rangeMode == RangeModeType::USER_DEFINED )
{
caf::PdmUiOrdering* ternaryGroupContainer = uiOrdering.addNewGroup( "Ternary " );
{
@ -392,7 +392,7 @@ void RimTernaryLegendConfig::ternaryRanges( double& soilLower,
double& swatLower,
double& swatUpper ) const
{
if ( rangeMode() == AUTOMATIC_CURRENT_TIMESTEP )
if ( rangeMode() == RangeModeType::AUTOMATIC_CURRENT_TIMESTEP )
{
soilLower = m_localAutoMin[TERNARY_SOIL_IDX];
soilUpper = m_localAutoMax[TERNARY_SOIL_IDX];
@ -401,7 +401,7 @@ void RimTernaryLegendConfig::ternaryRanges( double& soilLower,
swatLower = m_localAutoMin[TERNARY_SWAT_IDX];
swatUpper = m_localAutoMax[TERNARY_SWAT_IDX];
}
else if ( rangeMode() == AUTOMATIC_ALLTIMESTEPS )
else if ( rangeMode() == RangeModeType::AUTOMATIC_ALLTIMESTEPS )
{
soilLower = m_globalAutoMin[TERNARY_SOIL_IDX];
soilUpper = m_globalAutoMax[TERNARY_SOIL_IDX];
@ -477,7 +477,7 @@ void RimTernaryLegendConfig::updateLabelText()
}
}
if ( rangeMode == AUTOMATIC_ALLTIMESTEPS )
if ( rangeMode == RangeModeType::AUTOMATIC_ALLTIMESTEPS )
{
QString tmpString;
tmpString = QString( "SOIL : " ) + QString::number( m_globalAutoMin[TERNARY_SOIL_IDX], 'g', precision ) +
@ -489,7 +489,7 @@ void RimTernaryLegendConfig::updateLabelText()
ternaryRangeSummary = tmpString;
}
else if ( rangeMode == AUTOMATIC_CURRENT_TIMESTEP )
else if ( rangeMode == RangeModeType::AUTOMATIC_CURRENT_TIMESTEP )
{
QString tmpString;
tmpString = QString( "SOIL : " ) + QString::number( m_localAutoMin[TERNARY_SOIL_IDX], 'g', precision ) + " - " +

View File

@ -209,11 +209,11 @@ RimWellLogTrack::RimWellLogTrack()
CAF_PDM_InitFieldNoDefault( &m_colorShadingPalette_OBSOLETE, "ColorShadingPalette", "Colors", "", "", "" );
m_colorShadingPalette_OBSOLETE.xmlCapability()->setIOWritable( false );
m_colorShadingPalette_OBSOLETE = RimRegularLegendConfig::UNDEFINED;
m_colorShadingPalette_OBSOLETE = RimRegularLegendConfig::ColorRangesType::UNDEFINED;
m_colorShadingPalette_OBSOLETE.uiCapability()->setUiHidden( true );
CAF_PDM_InitFieldNoDefault( &m_colorShadingLegend, "ColorShadingLegend", "Colors", "", "", "" );
m_colorShadingLegend = RimRegularLegendConfig::mapToColorLegend( RimRegularLegendConfig::NORMAL );
m_colorShadingLegend = RimRegularLegendConfig::mapToColorLegend( RimRegularLegendConfig::ColorRangesType::NORMAL );
CAF_PDM_InitField( &m_colorShadingTransparency, "ColorShadingTransparency", 50, "Color Transparency", "", "", "" );
m_colorShadingTransparency.uiCapability()->setUiEditorTypeName( caf::PdmUiSliderEditor::uiEditorTypeName() );
@ -1876,7 +1876,7 @@ void RimWellLogTrack::initAfterRead()
m_showWindow = true;
}
if ( m_colorShadingPalette_OBSOLETE() != RimRegularLegendConfig::UNDEFINED )
if ( m_colorShadingPalette_OBSOLETE() != RimRegularLegendConfig::ColorRangesType::UNDEFINED )
{
m_colorShadingLegend = RimRegularLegendConfig::mapToColorLegend( m_colorShadingPalette_OBSOLETE() );
}

View File

@ -232,7 +232,7 @@ bool RimWellMeasurementInView::updateLegendData()
categories.push_back( std::make_tuple( measurementKind(), 0, color ) );
m_legendConfig->setCategoryItems( categories );
m_legendConfig->setTitle( QString( "Well Measurement: \n" ) + measurementKind() );
m_legendConfig->setMappingMode( RimRegularLegendConfig::CATEGORY_INTEGER );
m_legendConfig->setMappingMode( RimRegularLegendConfig::MappingType::CATEGORY_INTEGER );
return true;
}
else

View File

@ -44,15 +44,15 @@ void AppEnum<RimEnsembleCurveSetColorManager::ColorMode>::setUp()
//--------------------------------------------------------------------------------------------------
const std::map<RimRegularLegendConfig::ColorRangesType, cvf::Color3ubArray>
RimEnsembleCurveSetColorManager::m_ensembleColorRanges(
{{RimRegularLegendConfig::GREEN_RED,
{{RimRegularLegendConfig::ColorRangesType::GREEN_RED,
cvf::Color3ubArray( {cvf::Color3ub( 0x00, 0xff, 0x00 ), cvf::Color3ub( 0xff, 0x00, 0x00 )} )},
{RimRegularLegendConfig::BLUE_MAGENTA,
{RimRegularLegendConfig::ColorRangesType::BLUE_MAGENTA,
cvf::Color3ubArray( {cvf::Color3ub( 0x00, 0x00, 0xff ), cvf::Color3ub( 0xff, 0x00, 0xff )} )},
{RimRegularLegendConfig::RED_LIGHT_DARK,
{RimRegularLegendConfig::ColorRangesType::RED_LIGHT_DARK,
cvf::Color3ubArray( {cvf::Color3ub( 0xff, 0xcc, 0xcc ), cvf::Color3ub( 0x99, 0x00, 0x00 )} )},
{RimRegularLegendConfig::GREEN_LIGHT_DARK,
{RimRegularLegendConfig::ColorRangesType::GREEN_LIGHT_DARK,
cvf::Color3ubArray( {cvf::Color3ub( 0xcc, 0xff, 0xcc ), cvf::Color3ub( 0x00, 0x99, 0x00 )} )},
{RimRegularLegendConfig::BLUE_LIGHT_DARK,
{RimRegularLegendConfig::ColorRangesType::BLUE_LIGHT_DARK,
cvf::Color3ubArray( {cvf::Color3ub( 0xcc, 0xcc, 0xff ), cvf::Color3ub( 0x00, 0x00, 0x99 )} )}} );
//--------------------------------------------------------------------------------------------------
@ -68,7 +68,7 @@ const std::map<RimRegularLegendConfig::ColorRangesType, cvf::Color3ubArray>&
///
//--------------------------------------------------------------------------------------------------
const RimRegularLegendConfig::ColorRangesType RimEnsembleCurveSetColorManager::DEFAULT_ENSEMBLE_COLOR_RANGE =
RimRegularLegendConfig::GREEN_RED;
RimRegularLegendConfig::ColorRangesType::GREEN_RED;
//--------------------------------------------------------------------------------------------------
///

View File

@ -31,7 +31,7 @@ RiuScalarMapperLegendFrame::RiuScalarMapperLegendFrame( QWidget* parent, const Q
: RiuAbstractLegendFrame( parent, title )
, m_scalarMapper( scalarMapper )
, m_tickNumberPrecision( 4 )
, m_numberFormat( RimRegularLegendConfig::AUTO )
, m_numberFormat( RimRegularLegendConfig::NumberFormatType::AUTO )
{
if ( m_scalarMapper.notNull() )
{
@ -125,10 +125,10 @@ QString RiuScalarMapperLegendFrame::label( int index ) const
QString valueString;
switch ( m_numberFormat )
{
case RimRegularLegendConfig::FIXED:
case RimRegularLegendConfig::NumberFormatType::FIXED:
valueString = QString::number( tickValue, 'f', m_tickNumberPrecision );
break;
case RimRegularLegendConfig::SCIENTIFIC:
case RimRegularLegendConfig::NumberFormatType::SCIENTIFIC:
valueString = QString::number( tickValue, 'e', m_tickNumberPrecision );
break;
default: