WBS Plot: Improve initial placement of curve, and add better default colors.

This commit is contained in:
Kristian Bendiksen committed 2024-02-14 15:16:47 +01:00
1 parent 8fe385adcf
commit 85753568b6
4 files changed
+80 -4

No files matched your search

@@ -595,5 +595,9 @@ std::vector<QString> RiaResultNames::wbsDerivedResultNames()
wbsSHMkMaxResult(), wbsSHMkMaxResult(),
wbsFGMkExpResult(), wbsFGMkExpResult(),
wbsFGMkMinResult(), wbsFGMkMinResult(),
wbsPPMinResult(),
wbsPPMaxResult(),
wbsPPExpResult(),
wbsPPInitialResult(),
}; };
} }
@@ -56,6 +56,7 @@
#include "cafProgressInfo.h" #include "cafProgressInfo.h"
#include "cafSelectionManager.h" #include "cafSelectionManager.h"
#include "cvfAssert.h" #include "cvfAssert.h"
#include "cvfColor3.h"
#include "cvfMath.h" #include "cvfMath.h"
#include <QAction> #include <QAction>
@@ -63,6 +64,7 @@
#include <QString> #include <QString>
#include <algorithm> #include <algorithm>
#include <set>
CAF_CMD_SOURCE_INIT( RicNewWellBoreStabilityPlotFeature, "RicNewWellBoreStabilityPlotFeature" ); CAF_CMD_SOURCE_INIT( RicNewWellBoreStabilityPlotFeature, "RicNewWellBoreStabilityPlotFeature" );
@@ -262,7 +264,7 @@ void RicNewWellBoreStabilityPlotFeature::createParametersTrack( RimWellBoreStabi
paramCurvesTrack->setFormationCase( geoMechCase ); paramCurvesTrack->setFormationCase( geoMechCase );
paramCurvesTrack->setShowRegionLabels( true ); paramCurvesTrack->setShowRegionLabels( true );
paramCurvesTrack->setShowWindow( false ); paramCurvesTrack->setShowWindow( false );
std::set<RigWbsParameter> parameters = RigWbsParameter::allParameters(); std::set<RigWbsParameter> parameters = parametersForTrack();
caf::ColorTable colors = RiaColorTables::contrastCategoryPaletteColors(); caf::ColorTable colors = RiaColorTables::contrastCategoryPaletteColors();
std::vector<RiuQwtPlotCurveDefines::LineStyleEnum> lineStyles = { RiuQwtPlotCurveDefines::LineStyleEnum::STYLE_SOLID, std::vector<RiuQwtPlotCurveDefines::LineStyleEnum> lineStyles = { RiuQwtPlotCurveDefines::LineStyleEnum::STYLE_SOLID,
@@ -321,6 +323,15 @@ void RicNewWellBoreStabilityPlotFeature::createStabilityCurvesTrack( RimWellBore
std::vector<RiuQwtPlotCurveDefines::LineStyleEnum> lineStyles( resultNames.size(), RiuQwtPlotCurveDefines::LineStyleEnum::STYLE_SOLID ); std::vector<RiuQwtPlotCurveDefines::LineStyleEnum> lineStyles( resultNames.size(), RiuQwtPlotCurveDefines::LineStyleEnum::STYLE_SOLID );
lineStyles.back() = RiuQwtPlotCurveDefines::LineStyleEnum::STYLE_DASH; lineStyles.back() = RiuQwtPlotCurveDefines::LineStyleEnum::STYLE_DASH;
std::set<QString> defaultOffResults = {
RiaResultNames::wbsSHMkResult(),
RiaResultNames::wbsSHMkExpResult(),
RiaResultNames::wbsSHMkMinResult(),
RiaResultNames::wbsSHMkMaxResult(),
RiaResultNames::wbsFGMkExpResult(),
RiaResultNames::wbsFGMkMinResult(),
};
for ( size_t i = 0; i < resultNames.size(); ++i ) for ( size_t i = 0; i < resultNames.size(); ++i )
{ {
const QString& resultName = resultNames[i]; const QString& resultName = resultNames[i];
@@ -330,13 +341,14 @@ void RicNewWellBoreStabilityPlotFeature::createStabilityCurvesTrack( RimWellBore
curve->setGeoMechResultAddress( resAddr ); curve->setGeoMechResultAddress( resAddr );
curve->setCurrentTimeStep( timeStep ); curve->setCurrentTimeStep( timeStep );
curve->setAutoNameComponents( false, true, false, false, false ); curve->setAutoNameComponents( false, true, false, false, false );
curve->setColor( colors[i % colors.size()] ); auto [color, lineStyle] = getColorAndLineStyle( resultName, i, colors );
curve->setLineStyle( lineStyles[i] ); curve->setColor( color );
curve->setLineStyle( lineStyle );
curve->setLineThickness( 2 ); curve->setLineThickness( 2 );
curve->loadDataAndUpdate( false ); curve->loadDataAndUpdate( false );
curve->setSmoothCurve( true ); curve->setSmoothCurve( true );
curve->setSmoothingThreshold( 0.002 ); curve->setSmoothingThreshold( 0.002 );
if ( resultNames[i] == RiaResultNames::wbsSHMkResult() ) if ( defaultOffResults.count( resultNames[i] ) )
{ {
curve->setCheckState( false ); curve->setCheckState( false );
} }
@@ -361,6 +373,34 @@ void RicNewWellBoreStabilityPlotFeature::createStabilityCurvesTrack( RimWellBore
stabilityCurvesTrack->setAutoScalePropertyValuesEnabled( true ); stabilityCurvesTrack->setAutoScalePropertyValuesEnabled( true );
} }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::pair<cvf::Color3f, RiuQwtPlotCurveDefines::LineStyleEnum>
RicNewWellBoreStabilityPlotFeature::getColorAndLineStyle( const QString& resultName, size_t i, const std::vector<cvf::Color3f>& 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->setAnnotationDisplay( RiaDefines::LIGHT_LINES );
wellPathAnglesTrack->setShowRegionLabels( false ); wellPathAnglesTrack->setShowRegionLabels( false );
} }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::set<RigWbsParameter> 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() };
}
@@ -20,6 +20,14 @@
#include "cafCmdFeature.h" #include "cafCmdFeature.h"
#include "RigWbsParameter.h"
#include "RimPlotCurveAppearance.h"
#include "cvfColor3.h"
#include <set>
class RimGeoMechCase; class RimGeoMechCase;
class RimGeoMechView; class RimGeoMechView;
class RimWbsParameters; class RimWbsParameters;
@@ -48,4 +56,8 @@ private:
static void createParametersTrack( RimWellBoreStabilityPlot* plot, RimWellPath* wellPath, RimGeoMechCase* geoMechCase, int timeStep ); static void createParametersTrack( RimWellBoreStabilityPlot* plot, RimWellPath* wellPath, RimGeoMechCase* geoMechCase, int timeStep );
static void createStabilityCurvesTrack( 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 void createAnglesTrack( RimWellBoreStabilityPlot* plot, RimWellPath* wellPath, RimGeoMechCase* geoMechCase, int timeStep );
static std::set<RigWbsParameter> parametersForTrack();
static std::pair<cvf::Color3f, RiuQwtPlotCurveDefines::LineStyleEnum>
getColorAndLineStyle( const QString& resultName, size_t i, const std::vector<cvf::Color3f>& colors );
}; };
@@ -438,6 +438,7 @@ RigWbsParameter RigWbsParameter::waterDensity()
{ LAS_FILE, SourceAddress( "RHO_INP", "", RiaWellLogUnitTools<double>::gPerCm3UnitString() ) } } ); { LAS_FILE, SourceAddress( "RHO_INP", "", RiaWellLogUnitTools<double>::gPerCm3UnitString() ) } } );
return param; return param;
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------