#1182 Added a dummy point on first branch to better show the resulting alloaction

This commit is contained in:
Jacob Støren 2017-02-03 16:35:45 +01:00
parent 4a3ffb9238
commit 1f184837f1

View File

@ -134,9 +134,14 @@ void RimWellFlowRateCurve::updateCurveAppearance()
//--------------------------------------------------------------------------------------------------
void RimWellFlowRateCurve::updateStackedPlotData()
{
RimWellLogPlot* wellLogPlot;
firstAncestorOrThisOfType(wellLogPlot);
RimWellLogTrack* wellLogTrack;
firstAncestorOrThisOfType(wellLogTrack);
bool isFirstTrack = (wellLogTrack == wellLogPlot->trackByIndex(0));
RimDefines::DepthUnitType displayUnit = RimDefines::UNIT_METER;
std::vector<double> depthValues = m_curveData->measuredDepthPlotValues(displayUnit);
@ -156,12 +161,18 @@ void RimWellFlowRateCurve::updateStackedPlotData()
if ( stCurve == this ) break;
zPos -= 1.0;
}
// Add a dummy point for the zeroth connection to make the "end" distribution show better.
stackedValues.push_back(stackedValues.back());
depthValues.push_back(0.0);
std::vector< std::pair<size_t, size_t> > polyLineStartStopIndices = m_curveData->polylineStartStopIndices();
if ( isFirstTrack ) polyLineStartStopIndices.front().second += 2;
else polyLineStartStopIndices.front().second += 1;
m_qwtPlotCurve->setSamples(stackedValues.data(), depthValues.data(), static_cast<int>(depthValues.size()));
std::vector< std::pair<size_t, size_t> > polyLineStartStopIndices = m_curveData->polylineStartStopIndices();
polyLineStartStopIndices.front().second += 1;
m_qwtPlotCurve->setLineSegmentStartStopIndices(polyLineStartStopIndices);
m_qwtPlotCurve->setZ(zPos);