#2421 RelPerm: Remove invalid points on transparent curve

This commit is contained in:
Rebecca Cox
2018-01-30 13:30:05 +01:00
parent 9f08f1264a
commit 4094fd1861
2 changed files with 6 additions and 3 deletions

View File

@@ -22,6 +22,7 @@
#include "RiuLineSegmentQwtPlotCurve.h"
#include "RiuTextDialog.h"
#include "RigCurveDataTools.h"
#include "RigFlowDiagSolverInterface.h"
#include "cvfBase.h"
@@ -232,7 +233,7 @@ void RiuRelativePermeabilityPlotPanel::plotUiSelectedCurves()
//--------------------------------------------------------------------------------------------------
/// Add a transparent curve to make tooltip available on given points.
//--------------------------------------------------------------------------------------------------
void RiuRelativePermeabilityPlotPanel::addTransparentCurve(QwtPlot* plot, const std::vector<QPointF>& points, const std::vector<WhichYAxis>& axes)
void RiuRelativePermeabilityPlotPanel::addTransparentCurve(QwtPlot* plot, const std::vector<QPointF>& points, const std::vector<WhichYAxis>& axes, bool logScaleLeftAxis)
{
QwtPlotCurve* curveLeftAxis = new QwtPlotCurve();
QwtPlotCurve* curveRightAxis = new QwtPlotCurve();
@@ -245,6 +246,8 @@ void RiuRelativePermeabilityPlotPanel::addTransparentCurve(QwtPlot* plot, const
for (size_t i = 0; i < points.size(); i++)
{
if (!RigCurveDataTools::isValidValue(points[i].y(), logScaleLeftAxis)) continue;
if (axes[i] == LEFT_YAXIS)
{
pointsOnLeftAxis.push_back(points[i]);
@@ -382,7 +385,7 @@ void RiuRelativePermeabilityPlotPanel::plotCurvesInQwt(RiaEclipseUnitTools::Unit
plot->enableAxis(QwtPlot::yRight, shouldEnableRightYAxis);
addTransparentCurve(plot, points, axes);
addTransparentCurve(plot, points, axes, logScaleLeftAxis);
// Add vertical marker lines to indicate cell SWAT and/or SGAS saturations
if (swat != HUGE_VAL)

View File

@@ -103,7 +103,7 @@ private:
static double interpolatedCurveYValue(const std::vector<double>& xVals, const std::vector<double>& yVals, double x);
static void addTransparentCurve(QwtPlot* plot, const std::vector<QPointF>& points, const std::vector<WhichYAxis>& axes);
static void addTransparentCurve(QwtPlot* plot, const std::vector<QPointF>& points, const std::vector<WhichYAxis>& axes, bool logScaleLeftAxis);
std::vector<RigFlowDiagSolverInterface::RelPermCurve> gatherUiSelectedCurves() const;
QString asciiDataForUiSelectedCurves() const;