mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
This commit is contained in:
@@ -42,6 +42,7 @@
|
||||
#include <QButtonGroup>
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
|
||||
|
||||
|
||||
@@ -251,26 +252,36 @@ void RiuRelativePermeabilityPlotPanel::plotCurvesInQwt(const std::vector<RigFlow
|
||||
|
||||
qwtCurve->setStyle(QwtPlotCurve::Lines);
|
||||
|
||||
const QColor curveClr = curveColorFromIdent(curve.ident);
|
||||
const QPen curvePen(curveClr);
|
||||
bool plotCurveOnRightAxis = false;
|
||||
Qt::PenStyle penStyle = Qt::SolidLine;
|
||||
QColor clr = Qt::magenta;
|
||||
switch (curve.ident)
|
||||
{
|
||||
case RigFlowDiagSolverInterface::RelPermCurve::KRW: clr = QColor(0, 0, 200); break;
|
||||
case RigFlowDiagSolverInterface::RelPermCurve::KROW: clr = QColor(0, 0, 200); break;
|
||||
case RigFlowDiagSolverInterface::RelPermCurve::PCOW: clr = QColor(0, 130, 175); penStyle = Qt::DashLine; plotCurveOnRightAxis = true; break;
|
||||
case RigFlowDiagSolverInterface::RelPermCurve::KRG: clr = QColor(200, 0, 0); break;
|
||||
case RigFlowDiagSolverInterface::RelPermCurve::KROG: clr = QColor(200, 0, 0); break;
|
||||
case RigFlowDiagSolverInterface::RelPermCurve::PCOG: clr = QColor(225, 110, 0); penStyle = Qt::DashLine; plotCurveOnRightAxis = true; break;
|
||||
}
|
||||
|
||||
const QPen curvePen(clr, 1, penStyle);
|
||||
qwtCurve->setPen(curvePen);
|
||||
|
||||
QwtSymbol* curveSymbol = new QwtSymbol(QwtSymbol::Ellipse);
|
||||
curveSymbol->setSize(6, 6);
|
||||
curveSymbol->setPen(clr);
|
||||
curveSymbol->setBrush(Qt::NoBrush);
|
||||
qwtCurve->setSymbol(curveSymbol);
|
||||
|
||||
qwtCurve->setLegendAttribute(QwtPlotCurve::LegendShowLine, true);
|
||||
qwtCurve->setLegendAttribute(QwtPlotCurve::LegendShowSymbol, true);
|
||||
qwtCurve->setLegendAttribute(QwtPlotCurve::LegendShowBrush, true);
|
||||
|
||||
qwtCurve->setRenderHint(QwtPlotItem::RenderAntialiased, true);
|
||||
|
||||
// Curves containing capillary pressure are plotted on the right y axis and are marked with small circles
|
||||
const bool plotCurveOnRightAxis = (curve.ident == RigFlowDiagSolverInterface::RelPermCurve::PCOW) || (curve.ident == RigFlowDiagSolverInterface::RelPermCurve::PCOG);
|
||||
if (plotCurveOnRightAxis)
|
||||
{
|
||||
QwtSymbol* curveSymbol = new QwtSymbol(QwtSymbol::Ellipse);
|
||||
curveSymbol->setSize(6, 6);
|
||||
curveSymbol->setPen(curvePen);
|
||||
curveSymbol->setBrush(Qt::NoBrush);
|
||||
qwtCurve->setSymbol(curveSymbol);
|
||||
|
||||
qwtCurve->setYAxis(QwtPlot::yRight);
|
||||
shouldEableRightYAxis = true;
|
||||
}
|
||||
@@ -368,7 +379,7 @@ void RiuRelativePermeabilityPlotPanel::addVerticalSaturationMarkerLine(double sa
|
||||
QwtPlotMarker* lineMarker = new QwtPlotMarker;
|
||||
lineMarker->setXValue(saturationValue);
|
||||
lineMarker->setLineStyle(QwtPlotMarker::VLine);
|
||||
lineMarker->setLinePen(QPen(color, 1, Qt::DashLine));
|
||||
lineMarker->setLinePen(QPen(color, 1, Qt::DotLine));
|
||||
lineMarker->setLabel(label);
|
||||
lineMarker->setLabelAlignment(Qt::AlignTop | Qt::AlignRight);
|
||||
lineMarker->setLabelOrientation(Qt::Vertical);
|
||||
@@ -444,25 +455,6 @@ double RiuRelativePermeabilityPlotPanel::interpolatedCurveYValue(const std::vect
|
||||
return y;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QColor RiuRelativePermeabilityPlotPanel::curveColorFromIdent(RigFlowDiagSolverInterface::RelPermCurve::Ident ident)
|
||||
{
|
||||
QColor clr = Qt::magenta;
|
||||
switch (ident)
|
||||
{
|
||||
case RigFlowDiagSolverInterface::RelPermCurve::KRW: clr = Qt::blue; break;
|
||||
case RigFlowDiagSolverInterface::RelPermCurve::KRG: clr = Qt::red; break;
|
||||
case RigFlowDiagSolverInterface::RelPermCurve::KROW: clr = QColor(0, 130, 175); break;
|
||||
case RigFlowDiagSolverInterface::RelPermCurve::KROG: clr = QColor(225, 110, 0); break;
|
||||
case RigFlowDiagSolverInterface::RelPermCurve::PCOW: clr = QColor(0, 130, 175); break;
|
||||
case RigFlowDiagSolverInterface::RelPermCurve::PCOG: clr = QColor(225, 110, 0); break;
|
||||
}
|
||||
|
||||
return clr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -54,7 +54,6 @@ private:
|
||||
void plotUiSelectedCurves();
|
||||
static void setPlotDefaults(QwtPlot* plot);
|
||||
static void plotCurvesInQwt(const std::vector<RigFlowDiagSolverInterface::RelPermCurve>& curveArr, double swat, double sgas, QString cellReferenceText, QwtPlot* plot, std::vector<QwtPlotMarker*>* myPlotMarkers);
|
||||
static QColor curveColorFromIdent(RigFlowDiagSolverInterface::RelPermCurve::Ident ident);
|
||||
static QString determineXAxisTitleFromCurveCollection(const std::vector<RigFlowDiagSolverInterface::RelPermCurve>& curveArr);
|
||||
static void addVerticalSaturationMarkerLine(double saturationValue, QString label, QColor color, QwtPlot* plot, std::vector<QwtPlotMarker*>* myPlotMarkers);
|
||||
static void addCurveConstSaturationIntersectionMarker(const RigFlowDiagSolverInterface::RelPermCurve& curve, double saturationValue, QColor markerColor, bool plotCurveOnRightAxis, QwtPlot* plot, std::vector<QwtPlotMarker*>* myPlotMarkers);
|
||||
|
||||
Reference in New Issue
Block a user