mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
WBS Plot: Improve initial placement of curve, and add better default colors.
This commit is contained in:
@@ -595,5 +595,9 @@ std::vector<QString> RiaResultNames::wbsDerivedResultNames()
|
||||
wbsSHMkMaxResult(),
|
||||
wbsFGMkExpResult(),
|
||||
wbsFGMkMinResult(),
|
||||
wbsPPMinResult(),
|
||||
wbsPPMaxResult(),
|
||||
wbsPPExpResult(),
|
||||
wbsPPInitialResult(),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -56,6 +56,7 @@
|
||||
#include "cafProgressInfo.h"
|
||||
#include "cafSelectionManager.h"
|
||||
#include "cvfAssert.h"
|
||||
#include "cvfColor3.h"
|
||||
#include "cvfMath.h"
|
||||
|
||||
#include <QAction>
|
||||
@@ -63,6 +64,7 @@
|
||||
#include <QString>
|
||||
|
||||
#include <algorithm>
|
||||
#include <set>
|
||||
|
||||
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<RigWbsParameter> parameters = RigWbsParameter::allParameters();
|
||||
std::set<RigWbsParameter> parameters = parametersForTrack();
|
||||
|
||||
caf::ColorTable colors = RiaColorTables::contrastCategoryPaletteColors();
|
||||
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 );
|
||||
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 )
|
||||
{
|
||||
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<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->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 "RigWbsParameter.h"
|
||||
|
||||
#include "RimPlotCurveAppearance.h"
|
||||
|
||||
#include "cvfColor3.h"
|
||||
|
||||
#include <set>
|
||||
|
||||
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<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() ) } } );
|
||||
return param;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user