#5874 Allow user defined color legends in result objects.

This commit is contained in:
Kristian Bendiksen
2020-05-22 09:01:08 +02:00
committed by Magne Sjaastad
parent 8da32eddc1
commit 5295dbe299
8 changed files with 136 additions and 88 deletions

View File

@@ -105,3 +105,17 @@ void RimColorLegend::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
const QVariant& newValue ) const QVariant& newValue )
{ {
} }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
cvf::Color3ubArray RimColorLegend::colorArray() const
{
std::vector<RimColorLegendItem*> legendItems = colorLegendItems();
cvf::Color3ubArray colorArray( legendItems.size() );
for ( size_t i = 0; i < legendItems.size(); i++ )
{
colorArray.set( i, cvf::Color3ub( legendItems[i]->color() ) );
}
return colorArray;
}

View File

@@ -22,6 +22,8 @@
#include "cafPdmField.h" #include "cafPdmField.h"
#include "cafPdmObject.h" #include "cafPdmObject.h"
#include "cvfArray.h"
class RimColorLegendItem; class RimColorLegendItem;
namespace caf namespace caf
@@ -52,6 +54,8 @@ public:
std::vector<RimColorLegendItem*> colorLegendItems() const; std::vector<RimColorLegendItem*> colorLegendItems() const;
cvf::Color3ubArray colorArray() const;
public: public:
caf::PdmFieldHandle* userDescriptionField() override; caf::PdmFieldHandle* userDescriptionField() override;

View File

@@ -88,26 +88,29 @@ void RimColorLegendCollection::createStandardColorLegends()
for ( size_t typeIdx = 0; typeIdx < ColorRangeEnum::size(); typeIdx++ ) for ( size_t typeIdx = 0; typeIdx < ColorRangeEnum::size(); typeIdx++ )
{ {
QString legendName = ColorRangeEnum::uiTextFromIndex( typeIdx ); if ( ColorRangeEnum::fromIndex( typeIdx ) != RimRegularLegendConfig::ColorRangesType::UNDEFINED )
cvf::Color3ubArray colorArray =
RimRegularLegendConfig::colorArrayFromColorType( ColorRangeEnum::fromIndex( typeIdx ) );
RimColorLegend* colorLegend = new RimColorLegend;
colorLegend->setColorLegendName( legendName );
for ( int i = (int)colorArray.size() - 1; i > -1; i-- ) // reverse to assign last color to top of legend
{ {
cvf::Color3f color3f( colorArray[i] ); QString legendName = ColorRangeEnum::uiTextFromIndex( typeIdx );
QColor colorQ( colorArray[i].r(), colorArray[i].g(), colorArray[i].b() ); cvf::Color3ubArray colorArray =
RimRegularLegendConfig::colorArrayFromColorType( ColorRangeEnum::fromIndex( typeIdx ) );
RimColorLegendItem* colorLegendItem = new RimColorLegendItem; RimColorLegend* colorLegend = new RimColorLegend;
colorLegendItem->setValues( colorQ.name(), i, color3f ); colorLegend->setColorLegendName( legendName );
colorLegend->appendColorLegendItem( colorLegendItem ); for ( int i = (int)colorArray.size() - 1; i > -1; i-- ) // reverse to assign last color to top of legend
colorLegend->setReadOnly( true ); {
cvf::Color3f color3f( colorArray[i] );
QColor colorQ( colorArray[i].r(), colorArray[i].g(), colorArray[i].b() );
RimColorLegendItem* colorLegendItem = new RimColorLegendItem;
colorLegendItem->setValues( colorQ.name(), i, color3f );
colorLegend->appendColorLegendItem( colorLegendItem );
colorLegend->setReadOnly( true );
}
m_standardColorLegends.push_back( colorLegend );
} }
m_standardColorLegends.push_back( colorLegend );
} }
this->updateConnectedEditors(); this->updateConnectedEditors();
@@ -143,3 +146,20 @@ void RimColorLegendCollection::fieldChangedByUi( const caf::PdmFieldHandle* chan
const QVariant& newValue ) const QVariant& newValue )
{ {
} }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimColorLegend* RimColorLegendCollection::findByName( const QString& name ) const
{
std::vector<RimColorLegend*> allLegends = customColorLegends();
for ( auto legend : allLegends )
{
if ( legend->colorLegendName() == name )
{
return legend;
}
}
return nullptr;
}

View File

@@ -53,6 +53,8 @@ public:
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;
RimColorLegend* findByName( const QString& name ) const;
private: private:
caf::PdmChildArrayField<RimColorLegend*> m_standardColorLegends; // ResInsight standard (built-in) legends caf::PdmChildArrayField<RimColorLegend*> m_standardColorLegends; // ResInsight standard (built-in) legends
caf::PdmChildArrayField<RimColorLegend*> m_customColorLegends; // user specified legends caf::PdmChildArrayField<RimColorLegend*> m_customColorLegends; // user specified legends

View File

@@ -25,6 +25,9 @@
#include "RiaPreferences.h" #include "RiaPreferences.h"
#include "RimCellEdgeColors.h" #include "RimCellEdgeColors.h"
#include "RimColorLegend.h"
#include "RimColorLegendCollection.h"
#include "RimColorLegendItem.h"
#include "RimEclipseCellColors.h" #include "RimEclipseCellColors.h"
#include "RimEclipseView.h" #include "RimEclipseView.h"
#include "RimEnsembleCurveSet.h" #include "RimEnsembleCurveSet.h"
@@ -33,11 +36,13 @@
#include "RimGeoMechResultDefinition.h" #include "RimGeoMechResultDefinition.h"
#include "RimGridCrossPlotDataSet.h" #include "RimGridCrossPlotDataSet.h"
#include "RimIntersectionCollection.h" #include "RimIntersectionCollection.h"
#include "RimProject.h"
#include "RimStimPlanColors.h" #include "RimStimPlanColors.h"
#include "RimViewLinker.h" #include "RimViewLinker.h"
#include "RimWellMeasurementInView.h" #include "RimWellMeasurementInView.h"
#include "RimWellRftEnsembleCurveSet.h" #include "RimWellRftEnsembleCurveSet.h"
#include "RimWellRftPlot.h" #include "RimWellRftPlot.h"
#include "RiuCategoryLegendFrame.h" #include "RiuCategoryLegendFrame.h"
#include "RiuScalarMapperLegendFrame.h" #include "RiuScalarMapperLegendFrame.h"
@@ -89,7 +94,8 @@ void RimRegularLegendConfig::ColorRangeEnum::setUp()
addItem( RimRegularLegendConfig::BLUE_LIGHT_DARK, "BLUE_DARK_LIGHT", "Blue 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::GREEN_RED, "GREEN_RED", "Green to Red" );
addItem( RimRegularLegendConfig::BLUE_MAGENTA, "BLUE_MAGENTA", "Blue to Magenta" ); addItem( RimRegularLegendConfig::BLUE_MAGENTA, "BLUE_MAGENTA", "Blue to Magenta" );
setDefault( RimRegularLegendConfig::NORMAL ); addItem( RimRegularLegendConfig::UNDEFINED, "UNDEFINED", "Undefined" );
setDefault( RimRegularLegendConfig::UNDEFINED );
} }
} // namespace caf } // namespace caf
@@ -153,7 +159,13 @@ RimRegularLegendConfig::RimRegularLegendConfig()
"", "",
"" ); "" );
CAF_PDM_InitField( &m_colorRangeMode, "ColorRangeMode", ColorRangeEnum( NORMAL ), "Colors", "", "", "" ); CAF_PDM_InitField( &m_colorRangeMode_OBSOLETE, "ColorRangeMode", ColorRangeEnum( 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 ) );
CAF_PDM_InitField( &m_mappingMode, "MappingMode", MappingEnum( LINEAR_CONTINUOUS ), "Mapping", "", "", "" ); CAF_PDM_InitField( &m_mappingMode, "MappingMode", MappingEnum( LINEAR_CONTINUOUS ), "Mapping", "", "", "" );
CAF_PDM_InitField( &m_rangeMode, CAF_PDM_InitField( &m_rangeMode,
"RangeType", "RangeType",
@@ -389,7 +401,7 @@ void RimRegularLegendConfig::updateLegend()
m_logDiscreteScalarMapper->setRange( adjustedMin, adjustedMax ); m_logDiscreteScalarMapper->setRange( adjustedMin, adjustedMax );
m_logSmoothScalarMapper->setRange( adjustedMin, adjustedMax ); m_logSmoothScalarMapper->setRange( adjustedMin, adjustedMax );
cvf::Color3ubArray legendColors = colorArrayFromColorType( m_colorRangeMode() ); cvf::Color3ubArray legendColors = m_colorLegend()->colorArray();
m_linDiscreteScalarMapper->setColors( legendColors ); m_linDiscreteScalarMapper->setColors( legendColors );
m_logDiscreteScalarMapper->setColors( legendColors ); m_logDiscreteScalarMapper->setColors( legendColors );
@@ -550,6 +562,11 @@ void RimRegularLegendConfig::initAfterRead()
resultVariableName = RiaDefines::formationAllanResultName(); resultVariableName = RiaDefines::formationAllanResultName();
} }
if ( m_colorRangeMode_OBSOLETE() != RimRegularLegendConfig::UNDEFINED )
{
m_colorLegend = RimRegularLegendConfig::mapToColorLegend( m_colorRangeMode_OBSOLETE() );
}
updateFieldVisibility(); updateFieldVisibility();
this->updateUiIconFromToggleField(); this->updateUiIconFromToggleField();
@@ -592,7 +609,8 @@ void RimRegularLegendConfig::updateFieldVisibility()
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RimRegularLegendConfig::setColorRange( ColorRangesType colorMode ) void RimRegularLegendConfig::setColorRange( ColorRangesType colorMode )
{ {
m_colorRangeMode = colorMode; m_colorRangeMode_OBSOLETE = colorMode;
m_colorLegend = mapToColorLegend( colorMode );
updateLegend(); updateLegend();
} }
@@ -907,10 +925,18 @@ cvf::Color3ubArray RimRegularLegendConfig::colorArrayFromColorType( ColorRangesT
return ColorManager::EnsembleColorRanges().at( colorType ); return ColorManager::EnsembleColorRanges().at( colorType );
break; break;
} }
return RiaColorTables::normalPaletteColors().color3ubArray(); return RiaColorTables::normalPaletteColors().color3ubArray();
} }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimColorLegend* RimRegularLegendConfig::mapToColorLegend( ColorRangesType colorType )
{
RimProject* project = RimProject::current();
return project->colorLegendCollection()->findByName( RimRegularLegendConfig::ColorRangeEnum::uiText( colorType ) );
}
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@@ -933,7 +959,7 @@ void RimRegularLegendConfig::defineUiOrdering( QString uiConfigName, caf::PdmUiO
formatGr->add( &m_numLevels ); formatGr->add( &m_numLevels );
formatGr->add( &m_precision ); formatGr->add( &m_precision );
formatGr->add( &m_tickNumberFormat ); formatGr->add( &m_tickNumberFormat );
formatGr->add( &m_colorRangeMode ); formatGr->add( &m_colorLegend );
caf::PdmUiOrdering* mappingGr = uiOrdering.addNewGroup( "Mapping" ); caf::PdmUiOrdering* mappingGr = uiOrdering.addNewGroup( "Mapping" );
mappingGr->add( &m_mappingMode ); mappingGr->add( &m_mappingMode );
@@ -1027,44 +1053,15 @@ QList<caf::PdmOptionItemInfo>
options.push_back( caf::PdmOptionItemInfo( MappingEnum::uiText( mapType ), mapType ) ); options.push_back( caf::PdmOptionItemInfo( MappingEnum::uiText( mapType ), mapType ) );
} }
} }
else if ( fieldNeedingOptions == &m_colorRangeMode ) else if ( fieldNeedingOptions == &m_colorLegend )
{ {
// This is an app enum field, see cafInternalPdmFieldTypeSpecializations.h for the default specialization of RimProject* project = RimProject::current();
// this type RimColorLegendCollection* colorLegendCollection = project->colorLegendCollection();
std::vector<ColorRangesType> rangeTypes; std::vector<RimColorLegend*> colorLegends = colorLegendCollection->customColorLegends();
if ( !isAllanDiagram )
{
if ( !hasEnsembleCurveSetParent && !hasRftPlotParent )
{
rangeTypes.push_back( NORMAL );
rangeTypes.push_back( OPPOSITE_NORMAL );
rangeTypes.push_back( WHITE_PINK );
rangeTypes.push_back( PINK_WHITE );
rangeTypes.push_back( BLUE_WHITE_RED );
rangeTypes.push_back( RED_WHITE_BLUE );
rangeTypes.push_back( WHITE_BLACK );
rangeTypes.push_back( BLACK_WHITE );
rangeTypes.push_back( ANGULAR );
}
else
{
for ( const auto& col : ColorManager::EnsembleColorRanges() )
{
rangeTypes.push_back( col.first );
}
}
if ( hasStimPlanParent ) rangeTypes.push_back( STIMPLAN ); for ( RimColorLegend* colorLegend : colorLegends )
}
if ( isCategoryResult )
{ {
rangeTypes.push_back( CATEGORY ); options.push_back( caf::PdmOptionItemInfo( colorLegend->colorLegendName(), colorLegend ) );
}
for ( ColorRangesType colType : rangeTypes )
{
options.push_back( caf::PdmOptionItemInfo( ColorRangeEnum::uiText( colType ), colType ) );
} }
} }
else if ( fieldNeedingOptions == &m_rangeMode ) else if ( fieldNeedingOptions == &m_rangeMode )

View File

@@ -25,6 +25,8 @@
#include "cvfArray.h" #include "cvfArray.h"
#include "cvfObject.h" #include "cvfObject.h"
#include "cafPdmPtrField.h"
#include <tuple> #include <tuple>
namespace cvf namespace cvf
@@ -49,6 +51,7 @@ class OverlayScalarMapperLegend;
class Rim3dView; class Rim3dView;
class RimEnsembleCurveSet; class RimEnsembleCurveSet;
class RiuAbstractLegendFrame; class RiuAbstractLegendFrame;
class RimColorLegend;
//================================================================================================== //==================================================================================================
/// ///
@@ -82,7 +85,8 @@ public:
BLUE_MAGENTA, BLUE_MAGENTA,
RED_LIGHT_DARK, RED_LIGHT_DARK,
GREEN_LIGHT_DARK, GREEN_LIGHT_DARK,
BLUE_LIGHT_DARK BLUE_LIGHT_DARK,
UNDEFINED
}; };
typedef caf::AppEnum<ColorRangesType> ColorRangeEnum; typedef caf::AppEnum<ColorRangesType> ColorRangeEnum;
@@ -106,7 +110,9 @@ public:
void recreateLegend(); void recreateLegend();
void setColorRange( ColorRangesType colorMode ); void setColorRange( ColorRangesType colorMode );
ColorRangesType colorRange() { return m_colorRangeMode(); } ColorRangesType colorRange() { return m_colorRangeMode_OBSOLETE(); }
void setColorLegend( RimColorLegend* colorLegend );
RimColorLegend* colorLegend() const;
void setMappingMode( MappingType mappingType ); void setMappingMode( MappingType mappingType );
MappingType mappingMode() { return m_mappingMode(); } MappingType mappingMode() { return m_mappingMode(); }
void setTickNumberFormat( NumberFormatType numberFormat ); void setTickNumberFormat( NumberFormatType numberFormat );
@@ -141,6 +147,7 @@ public:
RangeModeType rangeMode() const; RangeModeType rangeMode() const;
static cvf::Color3ubArray colorArrayFromColorType( ColorRangesType colorType ); static cvf::Color3ubArray colorArrayFromColorType( ColorRangesType colorType );
static RimColorLegend* mapToColorLegend( ColorRangesType colorType );
private: private:
void setNamedCategories( const std::vector<QString>& categoryNames, bool inverse ); void setNamedCategories( const std::vector<QString>& categoryNames, bool inverse );
@@ -194,8 +201,9 @@ private:
caf::PdmField<RangeModeEnum> m_rangeMode; caf::PdmField<RangeModeEnum> m_rangeMode;
caf::PdmField<double> m_userDefinedMaxValue; caf::PdmField<double> m_userDefinedMaxValue;
caf::PdmField<double> m_userDefinedMinValue; caf::PdmField<double> m_userDefinedMinValue;
caf::PdmField<caf::AppEnum<ColorRangesType>> m_colorRangeMode; caf::PdmField<caf::AppEnum<ColorRangesType>> m_colorRangeMode_OBSOLETE;
caf::PdmField<caf::AppEnum<MappingType>> m_mappingMode; caf::PdmField<caf::AppEnum<MappingType>> m_mappingMode;
caf::PdmPtrField<RimColorLegend*> m_colorLegend;
QString m_title; QString m_title;
int m_significantDigitsInData; int m_significantDigitsInData;

View File

@@ -201,8 +201,13 @@ RimWellLogTrack::RimWellLogTrack()
CAF_PDM_InitFieldNoDefault( &m_regionAnnotationType, "AnnotationType", "Region Annotations", "", "", "" ); CAF_PDM_InitFieldNoDefault( &m_regionAnnotationType, "AnnotationType", "Region Annotations", "", "", "" );
CAF_PDM_InitFieldNoDefault( &m_regionAnnotationDisplay, "RegionDisplay", "Region Display", "", "", "" ); CAF_PDM_InitFieldNoDefault( &m_regionAnnotationDisplay, "RegionDisplay", "Region Display", "", "", "" );
CAF_PDM_InitFieldNoDefault( &m_colorShadingPalette, "ColorShadingPalette", "Colors", "", "", "" ); CAF_PDM_InitFieldNoDefault( &m_colorShadingPalette_OBSOLETE, "ColorShadingPalette", "Colors", "", "", "" );
m_colorShadingPalette = RimRegularLegendConfig::CATEGORY; m_colorShadingPalette_OBSOLETE.xmlCapability()->setIOWritable( false );
m_colorShadingPalette_OBSOLETE = RimRegularLegendConfig::UNDEFINED;
m_colorShadingPalette_OBSOLETE.uiCapability()->setUiHidden( true );
CAF_PDM_InitFieldNoDefault( &m_colorShadingLegend, "ColorShadingLegend", "Colors", "", "", "" );
m_colorShadingLegend = RimRegularLegendConfig::mapToColorLegend( RimRegularLegendConfig::NORMAL );
CAF_PDM_InitField( &m_colorShadingTransparency, "ColorShadingTransparency", 50, "Color Transparency", "", "", "" ); CAF_PDM_InitField( &m_colorShadingTransparency, "ColorShadingTransparency", 50, "Color Transparency", "", "", "" );
m_colorShadingTransparency.uiCapability()->setUiEditorTypeName( caf::PdmUiSliderEditor::uiEditorTypeName() ); m_colorShadingTransparency.uiCapability()->setUiEditorTypeName( caf::PdmUiSliderEditor::uiEditorTypeName() );
@@ -583,7 +588,7 @@ void RimWellLogTrack::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
} }
else if ( changedField == &m_regionAnnotationType || changedField == &m_regionAnnotationDisplay || else if ( changedField == &m_regionAnnotationType || changedField == &m_regionAnnotationDisplay ||
changedField == &m_formationSource || changedField == &m_colorShadingTransparency || changedField == &m_formationSource || changedField == &m_colorShadingTransparency ||
changedField == &m_colorShadingPalette ) changedField == &m_colorShadingPalette_OBSOLETE || changedField == &m_colorShadingLegend )
{ {
if ( changedField == &m_formationSource && m_formationSource == WELL_PICK_FILTER ) if ( changedField == &m_formationSource && m_formationSource == WELL_PICK_FILTER )
{ {
@@ -1029,24 +1034,15 @@ QList<caf::PdmOptionItemInfo> RimWellLogTrack::calculateValueOptions( const caf:
RimTools::wellPathOptionItems( &options ); RimTools::wellPathOptionItems( &options );
options.push_front( caf::PdmOptionItemInfo( "None", nullptr ) ); options.push_front( caf::PdmOptionItemInfo( "None", nullptr ) );
} }
else if ( fieldNeedingOptions == &m_colorShadingPalette ) else if ( fieldNeedingOptions == &m_colorShadingLegend )
{ {
std::vector<RimRegularLegendConfig::ColorRangesType> rangeTypes; RimProject* project = RimProject::current();
rangeTypes.push_back( RimRegularLegendConfig::NORMAL ); RimColorLegendCollection* colorLegendCollection = project->colorLegendCollection();
rangeTypes.push_back( RimRegularLegendConfig::OPPOSITE_NORMAL ); std::vector<RimColorLegend*> colorLegends = colorLegendCollection->customColorLegends();
rangeTypes.push_back( RimRegularLegendConfig::WHITE_PINK );
rangeTypes.push_back( RimRegularLegendConfig::PINK_WHITE );
rangeTypes.push_back( RimRegularLegendConfig::BLUE_WHITE_RED );
rangeTypes.push_back( RimRegularLegendConfig::RED_WHITE_BLUE );
rangeTypes.push_back( RimRegularLegendConfig::WHITE_BLACK );
rangeTypes.push_back( RimRegularLegendConfig::BLACK_WHITE );
rangeTypes.push_back( RimRegularLegendConfig::ANGULAR );
rangeTypes.push_back( RimRegularLegendConfig::CATEGORY );
for ( RimRegularLegendConfig::ColorRangesType colType : rangeTypes ) for ( RimColorLegend* colorLegend : colorLegends )
{ {
options.push_back( options.push_back( caf::PdmOptionItemInfo( colorLegend->colorLegendName(), colorLegend ) );
caf::PdmOptionItemInfo( RimRegularLegendConfig::ColorRangeEnum::uiText( colType ), colType ) );
} }
} }
@@ -1732,7 +1728,7 @@ void RimWellLogTrack::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering
if ( m_regionAnnotationDisplay() & RiuPlotAnnotationTool::COLOR_SHADING || if ( m_regionAnnotationDisplay() & RiuPlotAnnotationTool::COLOR_SHADING ||
m_regionAnnotationDisplay() & RiuPlotAnnotationTool::COLORED_LINES ) m_regionAnnotationDisplay() & RiuPlotAnnotationTool::COLORED_LINES )
{ {
annotationGroup->add( &m_colorShadingPalette ); annotationGroup->add( &m_colorShadingLegend );
if ( m_regionAnnotationDisplay() & RiuPlotAnnotationTool::COLOR_SHADING ) if ( m_regionAnnotationDisplay() & RiuPlotAnnotationTool::COLOR_SHADING )
{ {
annotationGroup->add( &m_colorShadingTransparency ); annotationGroup->add( &m_colorShadingTransparency );
@@ -1829,6 +1825,11 @@ void RimWellLogTrack::initAfterRead()
{ {
m_showWindow = true; m_showWindow = true;
} }
if ( m_colorShadingPalette_OBSOLETE() != RimRegularLegendConfig::UNDEFINED )
{
m_colorShadingLegend = RimRegularLegendConfig::mapToColorLegend( m_colorShadingPalette_OBSOLETE() );
}
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@@ -2298,7 +2299,8 @@ void RimWellLogTrack::setFormationFieldsUiReadOnly( bool readOnly /*= true*/ )
m_formationLevel.uiCapability()->setUiReadOnly( readOnly ); m_formationLevel.uiCapability()->setUiReadOnly( readOnly );
m_showformationFluids.uiCapability()->setUiReadOnly( readOnly ); m_showformationFluids.uiCapability()->setUiReadOnly( readOnly );
m_colorShadingTransparency.uiCapability()->setUiReadOnly( readOnly ); m_colorShadingTransparency.uiCapability()->setUiReadOnly( readOnly );
m_colorShadingPalette.uiCapability()->setUiReadOnly( readOnly ); m_colorShadingPalette_OBSOLETE.uiCapability()->setUiReadOnly( readOnly );
m_colorShadingLegend.uiCapability()->setUiReadOnly( readOnly );
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@@ -2463,8 +2465,7 @@ void RimWellLogTrack::updateFormationNamesOnPlot()
&formationNamesToPlot, &formationNamesToPlot,
&yValues ); &yValues );
caf::ColorTable colorTable( RimRegularLegendConfig::colorArrayFromColorType( m_colorShadingPalette() ) ); caf::ColorTable colorTable( m_colorShadingLegend->colorArray() );
m_annotationTool->attachNamedRegions( m_plotWidget, m_annotationTool->attachNamedRegions( m_plotWidget,
formationNamesToPlot, formationNamesToPlot,
xRange, xRange,
@@ -2609,7 +2610,7 @@ void RimWellLogTrack::updateCurveDataRegionsOnPlot()
std::vector<double> ucsSourceRegions = geoMechWellLogExtractor->ucsSourceRegions( timeStep ); std::vector<double> ucsSourceRegions = geoMechWellLogExtractor->ucsSourceRegions( timeStep );
{ {
caf::ColorTable colorTable( RimRegularLegendConfig::colorArrayFromColorType( m_colorShadingPalette() ) ); caf::ColorTable colorTable( m_colorShadingLegend->colorArray() );
std::vector<QString> sourceNames = std::vector<QString> sourceNames =
RigWbsParameter::PP_Reservoir().allSourceUiLabels( "\n", RigWbsParameter::PP_Reservoir().allSourceUiLabels( "\n",
@@ -2635,7 +2636,7 @@ void RimWellLogTrack::updateCurveDataRegionsOnPlot()
RiuPlotAnnotationTool::TrackSpan::LEFT_COLUMN ); RiuPlotAnnotationTool::TrackSpan::LEFT_COLUMN );
} }
{ {
caf::ColorTable colorTable( RimRegularLegendConfig::colorArrayFromColorType( m_colorShadingPalette() ) ); caf::ColorTable colorTable( m_colorShadingLegend->colorArray() );
std::vector<QString> sourceNames = std::vector<QString> sourceNames =
RigWbsParameter::poissonRatio().allSourceUiLabels( "\n", RigWbsParameter::poissonRatio().allSourceUiLabels( "\n",
@@ -2661,7 +2662,7 @@ void RimWellLogTrack::updateCurveDataRegionsOnPlot()
RiuPlotAnnotationTool::TrackSpan::CENTRE_COLUMN ); RiuPlotAnnotationTool::TrackSpan::CENTRE_COLUMN );
} }
{ {
caf::ColorTable colorTable( RimRegularLegendConfig::colorArrayFromColorType( m_colorShadingPalette() ) ); caf::ColorTable colorTable( m_colorShadingLegend->colorArray() );
std::vector<QString> sourceNames = std::vector<QString> sourceNames =
RigWbsParameter::UCS().allSourceUiLabels( "\n", wbsPlot->userDefinedValue( RigWbsParameter::UCS() ) ); RigWbsParameter::UCS().allSourceUiLabels( "\n", wbsPlot->userDefinedValue( RigWbsParameter::UCS() ) );

View File

@@ -56,6 +56,7 @@ class RigResultAccessor;
class RigFemResultAddress; class RigFemResultAddress;
class RigWellLogExtractor; class RigWellLogExtractor;
class RimEclipseResultDefinition; class RimEclipseResultDefinition;
class RimColorLegend;
class QwtPlotCurve; class QwtPlotCurve;
@@ -309,7 +310,7 @@ private:
caf::PdmField<RegionAnnotationTypeEnum> m_regionAnnotationType; caf::PdmField<RegionAnnotationTypeEnum> m_regionAnnotationType;
caf::PdmField<RegionAnnotationDisplayEnum> m_regionAnnotationDisplay; caf::PdmField<RegionAnnotationDisplayEnum> m_regionAnnotationDisplay;
caf::PdmField<RimRegularLegendConfig::ColorRangeEnum> m_colorShadingPalette; caf::PdmPtrField<RimColorLegend*> m_colorShadingLegend;
caf::PdmField<int> m_colorShadingTransparency; caf::PdmField<int> m_colorShadingTransparency;
caf::PdmField<bool> m_showRegionLabels; caf::PdmField<bool> m_showRegionLabels;
caf::PdmField<caf::AppEnum<FormationSource>> m_formationSource; caf::PdmField<caf::AppEnum<FormationSource>> m_formationSource;
@@ -332,8 +333,9 @@ private:
caf::PdmPtrField<RimWellPathAttributeCollection*> m_wellPathAttributeCollection; caf::PdmPtrField<RimWellPathAttributeCollection*> m_wellPathAttributeCollection;
caf::PdmChildField<RimEclipseResultDefinition*> m_resultDefinition; caf::PdmChildField<RimEclipseResultDefinition*> m_resultDefinition;
caf::PdmField<bool> m_showFormations_OBSOLETE; caf::PdmField<bool> m_showFormations_OBSOLETE;
caf::PdmField<bool> m_show_OBSOLETE; caf::PdmField<bool> m_show_OBSOLETE;
caf::PdmField<RimRegularLegendConfig::ColorRangeEnum> m_colorShadingPalette_OBSOLETE;
std::vector<std::unique_ptr<RiuWellPathComponentPlotItem>> m_wellPathAttributePlotObjects; std::vector<std::unique_ptr<RiuWellPathComponentPlotItem>> m_wellPathAttributePlotObjects;