From aa45dd5fcd8803c11e2de0e4410adf4c00a2b218 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacob=20St=C3=B8ren?= Date: Wed, 8 Nov 2017 11:58:14 +0100 Subject: [PATCH] #2035 Fix crash when bottom of well path ends after last well cell Add symbols to curves --- .../ProjectDataModel/Flow/RimWellPltPlot.cpp | 22 ++++++++++++++++--- .../RimSummaryCurveAppearanceCalculator.h | 2 +- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/ApplicationCode/ProjectDataModel/Flow/RimWellPltPlot.cpp b/ApplicationCode/ProjectDataModel/Flow/RimWellPltPlot.cpp index e5fc2674f0..27ecac257d 100644 --- a/ApplicationCode/ProjectDataModel/Flow/RimWellPltPlot.cpp +++ b/ApplicationCode/ProjectDataModel/Flow/RimWellPltPlot.cpp @@ -55,6 +55,7 @@ #include "RigMainGrid.h" #include "cafVecIjk.h" #include "RigAccWellFlowCalculator.h" +#include "RimSummaryCurveAppearanceCalculator.h" CAF_PDM_SOURCE_INIT(RimWellPltPlot, "WellPltPlot"); @@ -924,8 +925,14 @@ public: size_t globCellIdx = intersections[wpExIdx].globCellIndex; auto it = globCellIdxToIdxInRftFile.find(globCellIdx); - if (it == globCellIdxToIdxInRftFile.end()) continue; - + if (it == globCellIdxToIdxInRftFile.end()) + { + if (wpExIdx == (intersections.size() - 1)) + { + m_pipeBranchWellResultPoints.pop_back(); + } + continue; + } m_pipeBranchCLCoords.push_back(intersections[wpExIdx].startPoint); m_pipeBranchMeasuredDepths.push_back(intersections[wpExIdx].startMD); @@ -1009,7 +1016,14 @@ public: size_t globCellIdx = intersections[wpExIdx].globCellIndex; auto it = globCellIdxToIdxInSimWellBranch.find(globCellIdx); - if (it == globCellIdxToIdxInSimWellBranch.end()) continue; + if (it == globCellIdxToIdxInSimWellBranch.end()) + { + if (wpExIdx == (intersections.size() - 1)) + { + m_pipeBranchWellResultPoints.pop_back(); + } + continue; + } m_pipeBranchCLCoords.push_back(intersections[wpExIdx].startPoint); m_pipeBranchMeasuredDepths.push_back(intersections[wpExIdx].startMD); @@ -1173,6 +1187,8 @@ void RimWellPltPlot::addStackedCurve(const QString& curveName, curve->setColor(color); curve->setGroupId(curveGroupId); curve->setDoFillCurve(doFillCurve); + curve->setSymbol(RimSummaryCurveAppearanceCalculator::cycledSymbol(curveGroupId)); + plotTrack->addCurve(curve); curve->loadDataAndUpdate(true); diff --git a/ApplicationCode/ProjectDataModel/Summary/RimSummaryCurveAppearanceCalculator.h b/ApplicationCode/ProjectDataModel/Summary/RimSummaryCurveAppearanceCalculator.h index 3d482e6c9e..ebb2005c87 100644 --- a/ApplicationCode/ProjectDataModel/Summary/RimSummaryCurveAppearanceCalculator.h +++ b/ApplicationCode/ProjectDataModel/Summary/RimSummaryCurveAppearanceCalculator.h @@ -64,6 +64,7 @@ public: static cvf::Color3f cycledBlueColor(int colorIndex); static cvf::Color3f cycledRedColor(int colorIndex); static cvf::Color3f cycledBrownColor(int colorIndex); + static RimPlotCurve::PointSymbolEnum cycledSymbol(int index); private: void setOneCurveAppearance(CurveAppearanceType appeaType, size_t totalCount, int appeaIdx, RimSummaryCurve* curve); @@ -72,7 +73,6 @@ private: RimPlotCurve::LineStyleEnum cycledLineStyle(int index); - RimPlotCurve::PointSymbolEnum cycledSymbol(int index); int cycledLineThickness(int index); float gradient(size_t totalCount, int index);