From 85753568b6bd30acd06ae86be1f44cda531369c8 Mon Sep 17 00:00:00 2001 From: Kristian Bendiksen Date: Wed, 14 Feb 2024 08:54:41 +0100 Subject: [PATCH] WBS Plot: Improve initial placement of curve, and add better default colors. --- .../Application/RiaResultNames.cpp | 4 ++ .../RicNewWellBoreStabilityPlotFeature.cpp | 67 +++++++++++++++++-- .../RicNewWellBoreStabilityPlotFeature.h | 12 ++++ .../ReservoirDataModel/RigWbsParameter.cpp | 1 + 4 files changed, 80 insertions(+), 4 deletions(-) diff --git a/ApplicationLibCode/Application/RiaResultNames.cpp b/ApplicationLibCode/Application/RiaResultNames.cpp index 9752c9ff31..cac4338ada 100644 --- a/ApplicationLibCode/Application/RiaResultNames.cpp +++ b/ApplicationLibCode/Application/RiaResultNames.cpp @@ -595,5 +595,9 @@ std::vector RiaResultNames::wbsDerivedResultNames() wbsSHMkMaxResult(), wbsFGMkExpResult(), wbsFGMkMinResult(), + wbsPPMinResult(), + wbsPPMaxResult(), + wbsPPExpResult(), + wbsPPInitialResult(), }; } diff --git a/ApplicationLibCode/Commands/WellLogCommands/RicNewWellBoreStabilityPlotFeature.cpp b/ApplicationLibCode/Commands/WellLogCommands/RicNewWellBoreStabilityPlotFeature.cpp index e8b7d53233..b7f465dfc0 100644 --- a/ApplicationLibCode/Commands/WellLogCommands/RicNewWellBoreStabilityPlotFeature.cpp +++ b/ApplicationLibCode/Commands/WellLogCommands/RicNewWellBoreStabilityPlotFeature.cpp @@ -56,6 +56,7 @@ #include "cafProgressInfo.h" #include "cafSelectionManager.h" #include "cvfAssert.h" +#include "cvfColor3.h" #include "cvfMath.h" #include @@ -63,6 +64,7 @@ #include #include +#include CAF_CMD_SOURCE_INIT( RicNewWellBoreStabilityPlotFeature, "RicNewWellBoreStabilityPlotFeature" ); @@ -262,7 +264,7 @@ void RicNewWellBoreStabilityPlotFeature::createParametersTrack( RimWellBoreStabi paramCurvesTrack->setFormationCase( geoMechCase ); paramCurvesTrack->setShowRegionLabels( true ); paramCurvesTrack->setShowWindow( false ); - std::set parameters = RigWbsParameter::allParameters(); + std::set parameters = parametersForTrack(); caf::ColorTable colors = RiaColorTables::contrastCategoryPaletteColors(); std::vector lineStyles = { RiuQwtPlotCurveDefines::LineStyleEnum::STYLE_SOLID, @@ -321,6 +323,15 @@ void RicNewWellBoreStabilityPlotFeature::createStabilityCurvesTrack( RimWellBore std::vector lineStyles( resultNames.size(), RiuQwtPlotCurveDefines::LineStyleEnum::STYLE_SOLID ); lineStyles.back() = RiuQwtPlotCurveDefines::LineStyleEnum::STYLE_DASH; + std::set defaultOffResults = { + RiaResultNames::wbsSHMkResult(), + RiaResultNames::wbsSHMkExpResult(), + RiaResultNames::wbsSHMkMinResult(), + RiaResultNames::wbsSHMkMaxResult(), + RiaResultNames::wbsFGMkExpResult(), + RiaResultNames::wbsFGMkMinResult(), + }; + for ( size_t i = 0; i < resultNames.size(); ++i ) { const QString& resultName = resultNames[i]; @@ -330,13 +341,14 @@ void RicNewWellBoreStabilityPlotFeature::createStabilityCurvesTrack( RimWellBore curve->setGeoMechResultAddress( resAddr ); curve->setCurrentTimeStep( timeStep ); curve->setAutoNameComponents( false, true, false, false, false ); - curve->setColor( colors[i % colors.size()] ); - curve->setLineStyle( lineStyles[i] ); + auto [color, lineStyle] = getColorAndLineStyle( resultName, i, colors ); + curve->setColor( color ); + curve->setLineStyle( lineStyle ); curve->setLineThickness( 2 ); curve->loadDataAndUpdate( false ); curve->setSmoothCurve( true ); curve->setSmoothingThreshold( 0.002 ); - if ( resultNames[i] == RiaResultNames::wbsSHMkResult() ) + if ( defaultOffResults.count( resultNames[i] ) ) { curve->setCheckState( false ); } @@ -361,6 +373,34 @@ void RicNewWellBoreStabilityPlotFeature::createStabilityCurvesTrack( RimWellBore stabilityCurvesTrack->setAutoScalePropertyValuesEnabled( true ); } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +std::pair + RicNewWellBoreStabilityPlotFeature::getColorAndLineStyle( const QString& resultName, size_t i, const std::vector& colors ) +{ + if ( resultName == RiaResultNames::wbsSHMkResult() ) return { cvf::Color3f::GREEN, RiuQwtPlotCurveDefines::LineStyleEnum::STYLE_SOLID }; + if ( resultName == RiaResultNames::wbsSHMkExpResult() ) + return { cvf::Color3f::GREEN, RiuQwtPlotCurveDefines::LineStyleEnum::STYLE_DASH }; + if ( resultName == RiaResultNames::wbsSHMkMinResult() ) + return { cvf::Color3f::GREEN, RiuQwtPlotCurveDefines::LineStyleEnum::STYLE_DOT }; + if ( resultName == RiaResultNames::wbsSHMkMaxResult() ) + return { cvf::Color3f::GREEN, RiuQwtPlotCurveDefines::LineStyleEnum::STYLE_DASH_DOT }; + + if ( resultName == RiaResultNames::wbsFGMkExpResult() ) + return { cvf::Color3f::BLUE, RiuQwtPlotCurveDefines::LineStyleEnum::STYLE_DASH }; + if ( resultName == RiaResultNames::wbsFGMkMinResult() ) return { cvf::Color3f::BLUE, RiuQwtPlotCurveDefines::LineStyleEnum::STYLE_DOT }; + + if ( resultName == RiaResultNames::wbsPPInitialResult() ) + return { cvf::Color3f::RED, RiuQwtPlotCurveDefines::LineStyleEnum::STYLE_SOLID }; + if ( resultName == RiaResultNames::wbsPPExpResult() ) return { cvf::Color3f::RED, RiuQwtPlotCurveDefines::LineStyleEnum::STYLE_DASH }; + if ( resultName == RiaResultNames::wbsPPMinResult() ) return { cvf::Color3f::RED, RiuQwtPlotCurveDefines::LineStyleEnum::STYLE_DOT }; + if ( resultName == RiaResultNames::wbsPPMaxResult() ) + return { cvf::Color3f::RED, RiuQwtPlotCurveDefines::LineStyleEnum::STYLE_DASH_DOT }; + + return { colors[i % colors.size()], RiuQwtPlotCurveDefines::LineStyleEnum::STYLE_SOLID }; +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -408,3 +448,22 @@ void RicNewWellBoreStabilityPlotFeature::createAnglesTrack( RimWellBoreStability wellPathAnglesTrack->setAnnotationDisplay( RiaDefines::LIGHT_LINES ); wellPathAnglesTrack->setShowRegionLabels( false ); } + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +std::set RicNewWellBoreStabilityPlotFeature::parametersForTrack() +{ + return { RigWbsParameter::PP_Reservoir(), + RigWbsParameter::PP_NonReservoir(), + RigWbsParameter::poissonRatio(), + RigWbsParameter::UCS(), + RigWbsParameter::OBG(), + RigWbsParameter::OBG0(), + RigWbsParameter::SH(), + RigWbsParameter::DF(), + RigWbsParameter::K0_FG(), + RigWbsParameter::K0_SH(), + RigWbsParameter::FG_Shale(), + RigWbsParameter::waterDensity() }; +} diff --git a/ApplicationLibCode/Commands/WellLogCommands/RicNewWellBoreStabilityPlotFeature.h b/ApplicationLibCode/Commands/WellLogCommands/RicNewWellBoreStabilityPlotFeature.h index e9fd749ae0..9fc6dd4162 100644 --- a/ApplicationLibCode/Commands/WellLogCommands/RicNewWellBoreStabilityPlotFeature.h +++ b/ApplicationLibCode/Commands/WellLogCommands/RicNewWellBoreStabilityPlotFeature.h @@ -20,6 +20,14 @@ #include "cafCmdFeature.h" +#include "RigWbsParameter.h" + +#include "RimPlotCurveAppearance.h" + +#include "cvfColor3.h" + +#include + class RimGeoMechCase; class RimGeoMechView; class RimWbsParameters; @@ -48,4 +56,8 @@ private: static void createParametersTrack( RimWellBoreStabilityPlot* plot, RimWellPath* wellPath, RimGeoMechCase* geoMechCase, int timeStep ); static void createStabilityCurvesTrack( RimWellBoreStabilityPlot* plot, RimWellPath* wellPath, RimGeoMechCase* geoMechCase, int timeStep ); static void createAnglesTrack( RimWellBoreStabilityPlot* plot, RimWellPath* wellPath, RimGeoMechCase* geoMechCase, int timeStep ); + + static std::set parametersForTrack(); + static std::pair + getColorAndLineStyle( const QString& resultName, size_t i, const std::vector& colors ); }; diff --git a/ApplicationLibCode/ReservoirDataModel/RigWbsParameter.cpp b/ApplicationLibCode/ReservoirDataModel/RigWbsParameter.cpp index 0535752604..e010a3d6ab 100644 --- a/ApplicationLibCode/ReservoirDataModel/RigWbsParameter.cpp +++ b/ApplicationLibCode/ReservoirDataModel/RigWbsParameter.cpp @@ -438,6 +438,7 @@ RigWbsParameter RigWbsParameter::waterDensity() { LAS_FILE, SourceAddress( "RHO_INP", "", RiaWellLogUnitTools::gPerCm3UnitString() ) } } ); return param; } + //-------------------------------------------------------------------------------------------------- /// //--------------------------------------------------------------------------------------------------