#5125 Use category legend for well measurements without values.

This commit is contained in:
Kristian Bendiksen
2019-12-02 22:07:49 +01:00
parent 6efceea597
commit 66ac8fee1d
7 changed files with 125 additions and 58 deletions

View File

@@ -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 )