mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#5125 Use category legend for well measurements without values.
This commit is contained in:
@@ -256,32 +256,6 @@ void RivWellPathPartMgr::appendWellPathAttributesToModel( cvf::ModelBasicList*
|
||||
}
|
||||
}
|
||||
|
||||
cvf::Color3f RivWellPathPartMgr::mapWellMeasurementToColor( const QString& measurementKind, double value )
|
||||
{
|
||||
if ( measurementKind == "TH" ) return cvf::Color3f::RED;
|
||||
if ( measurementKind == "LE" ) return cvf::Color3f::BLUE;
|
||||
if ( measurementKind == "BA" ) return cvf::Color3f::GREEN;
|
||||
if ( measurementKind == "CORE" ) return cvf::Color3f::BLACK;
|
||||
|
||||
QStringList rangeBasedMeasurements;
|
||||
rangeBasedMeasurements << "XLOT"
|
||||
<< "LOT"
|
||||
<< "FIT"
|
||||
<< "MCF"
|
||||
<< "MNF"
|
||||
<< "PPG";
|
||||
if ( rangeBasedMeasurements.contains( measurementKind ) )
|
||||
{
|
||||
cvf::ScalarMapperContinuousLinear mapper;
|
||||
mapper.setColors( RiaColorTables::normalPaletteColors().color3ubArray() );
|
||||
mapper.setRange( 1.0, 3.0 );
|
||||
cvf::Color3ub color = mapper.mapToColor( value );
|
||||
return cvf::Color3f( color );
|
||||
}
|
||||
|
||||
return cvf::Color3f::RED;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -341,14 +315,10 @@ void RivWellPathPartMgr::appendWellMeasurementsToModel( cvf::ModelBasicList*
|
||||
cvf::ref<RivObjectSourceInfo> objectSourceInfo = new RivObjectSourceInfo( wellMeasurement );
|
||||
|
||||
cvf::Collection<cvf::Part> parts;
|
||||
cvf::Color3f color = mapWellMeasurementToColor( wellMeasurement->kind(), wellMeasurement->value() );
|
||||
|
||||
// Use the view legend config to find color, if only one type of measurement is selected.
|
||||
if ( measurementKinds.size() == 1 )
|
||||
{
|
||||
color = cvf::Color3f(
|
||||
wellMeasurementInView->legendConfig()->scalarMapper()->mapToColor( wellMeasurement->value() ) );
|
||||
}
|
||||
cvf::Color3f color = cvf::Color3f(
|
||||
wellMeasurementInView->legendConfig()->scalarMapper()->mapToColor( wellMeasurement->value() ) );
|
||||
|
||||
geoGenerator.tubeWithCenterLinePartsAndVariableWidth( &parts, displayCoords, radii, color );
|
||||
for ( auto part : parts )
|
||||
|
||||
Reference in New Issue
Block a user