#2136 PLT plot curve appearance improved. First group gets solid fill. If Observed data is available, it will be first. The other groups are drawn with a gentle transparency on the last curve to "connect" the groups visually.

This commit is contained in:
Jacob Støren 2017-11-17 13:52:29 +01:00
parent 84c63e7df8
commit 8c95975054
2 changed files with 38 additions and 14 deletions

View File

@ -156,29 +156,45 @@ void RimWellFlowRateCurve::updateCurveAppearance()
{
RimWellLogCurve::updateCurveAppearance();
bool isLastCurveInGroup = false;
{
RimWellLogTrack* wellLogTrack;
firstAncestorOrThisOfTypeAsserted(wellLogTrack);
std::map<int, std::vector<RimWellFlowRateCurve*>> stackedCurveGroups = wellLogTrack->visibleStackedCurves();
const std::vector<RimWellFlowRateCurve*>& curveGroup = stackedCurveGroups[this->m_groupId];
isLastCurveInGroup = (curveGroup.back() == this);
}
if ( isUsingConnectionNumberDepthType() )
{
m_qwtPlotCurve->setStyle(QwtPlotCurve::Steps);
}
if (m_doFillCurve)
if (m_doFillCurve || isLastCurveInGroup) // Fill the last curve in group with a transparent color to "tie" the group together
{
QColor curveQColor = QColor (m_curveColor.value().rByte(), m_curveColor.value().gByte(), m_curveColor.value().bByte());
m_qwtPlotCurve->setBrush(QBrush( curveQColor));
QColor fillColor = curveQColor;
QColor lineColor = curveQColor.darker();
if (!m_doFillCurve && isLastCurveInGroup)
{
fillColor = QColor(24, 16, 10, 50);
lineColor = curveQColor;
}
QLinearGradient gradient;
gradient.setCoordinateMode(QGradient::StretchToDeviceMode);
gradient.setColorAt(0, curveQColor.darker(110));
gradient.setColorAt(0.15, curveQColor);
gradient.setColorAt(0.25, curveQColor);
gradient.setColorAt(0.4, curveQColor.darker(110));
gradient.setColorAt(0.6, curveQColor);
gradient.setColorAt(0.8, curveQColor.darker(110));
gradient.setColorAt(1, curveQColor);
gradient.setColorAt(0, fillColor.darker(110));
gradient.setColorAt(0.15, fillColor);
gradient.setColorAt(0.25, fillColor);
gradient.setColorAt(0.4, fillColor.darker(110));
gradient.setColorAt(0.6, fillColor);
gradient.setColorAt(0.8, fillColor.darker(110));
gradient.setColorAt(1, fillColor);
m_qwtPlotCurve->setBrush(gradient);
QPen curvePen = m_qwtPlotCurve->pen();
curvePen.setColor(curveQColor.darker());
curvePen.setColor(lineColor);
m_qwtPlotCurve->setPen(curvePen);
m_qwtPlotCurve->setOrientation(Qt::Horizontal);
m_qwtPlotCurve->setBaseline(0.0);

View File

@ -613,12 +613,20 @@ void RimWellPltPlot::addStackedCurve(const QString& curveName,
curve->setColor(color);
curve->setGroupId(curveGroupId);
curve->setDoFillCurve(doFillCurve);
curve->setSymbol(RimSummaryCurveAppearanceCalculator::cycledSymbol(curveGroupId));
if (curveGroupId == 0)
{
curve->setDoFillCurve(true);
curve->setSymbol(RimPlotCurve::SYMBOL_NONE);
}
else
{
curve->setDoFillCurve(false);
curve->setSymbol(RimSummaryCurveAppearanceCalculator::cycledSymbol(curveGroupId));
}
curve->setSymbolSkipDinstance(10);
plotTrack->addCurve(curve);
curve->loadDataAndUpdate(true);
}
//--------------------------------------------------------------------------------------------------