diff --git a/ApplicationCode/Commands/RicWellLogTools.cpp b/ApplicationCode/Commands/RicWellLogTools.cpp index 06f90441b7..c83d69ad83 100644 --- a/ApplicationCode/Commands/RicWellLogTools.cpp +++ b/ApplicationCode/Commands/RicWellLogTools.cpp @@ -24,6 +24,7 @@ #include "RimEclipseResultCase.h" #include "RimProject.h" #include "RimSimWellInView.h" +#include "RimView.h" #include "RimWellLogExtractionCurve.h" #include "RimWellLogFileChannel.h" #include "RimWellLogFileCurve.h" @@ -156,8 +157,24 @@ RimWellLogExtractionCurve* RicWellLogTools::addExtractionCurve(RimWellLogTrack* cvf::Color3f curveColor = RicWellLogPlotCurveFeatureImpl::curveColorFromTable(plotTrack->curveCount()); curve->setColor(curveColor); - if (wellPath) curve->setWellPath(wellPath); - if (simWell) curve->setFromSimulationWellName(simWell->name(), branchIndex); + if (wellPath) + { + curve->setWellPath(wellPath); + plotTrack->setFormationWellPath(wellPath); + plotTrack->setFormationTrajectoryType(RimWellLogTrack::WELL_PATH); + } + if (simWell) + { + curve->setFromSimulationWellName(simWell->name(), branchIndex); + plotTrack->setFormationSimWellName(simWell->name()); + plotTrack->setFormationBranchIndex(branchIndex); + plotTrack->setFormationTrajectoryType(RimWellLogTrack::SIMULATION_WELL); + } + + if (view) + { + plotTrack->setFormationCase(view->ownerCase()); + } curve->setPropertiesFromView(view); @@ -184,7 +201,7 @@ RimWellLogRftCurve* RicWellLogTools::addRftCurve(RimWellLogTrack* plotTrack, con RimWellLogRftCurve* curve = new RimWellLogRftCurve(); - RimEclipseResultCase* resultCase; + RimEclipseResultCase* resultCase = nullptr; std::vector cases; RiaApplication::instance()->project()->allCases(cases); @@ -201,12 +218,17 @@ RimWellLogRftCurve* RicWellLogTools::addRftCurve(RimWellLogTrack* plotTrack, con { curve->setEclipseResultCase(resultCase); curve->setDefaultAddress(simWell->name()); + + plotTrack->setFormationCase(resultCase); + plotTrack->setFormationSimWellName(simWell->name()); } + cvf::Color3f curveColor = RicWellLogPlotCurveFeatureImpl::curveColorFromTable(plotTrack->curveCount()); curve->setColor(curveColor); plotTrack->addCurve(curve); + plotTrack->setFormationTrajectoryType(RimWellLogTrack::SIMULATION_WELL); plotTrack->updateConnectedEditors(); RiuMainPlotWindow* plotwindow = RiaApplication::instance()->getOrCreateAndShowMainPlotWindow(); diff --git a/ApplicationCode/ProjectDataModel/RimWellLogTrack.cpp b/ApplicationCode/ProjectDataModel/RimWellLogTrack.cpp index 44813bbd15..33b0d6d8b9 100644 --- a/ApplicationCode/ProjectDataModel/RimWellLogTrack.cpp +++ b/ApplicationCode/ProjectDataModel/RimWellLogTrack.cpp @@ -474,7 +474,7 @@ void RimWellLogTrack::availableDepthRange(double* minimumDepth, double* maximumD //-------------------------------------------------------------------------------------------------- void RimWellLogTrack::loadDataAndUpdate() { - RimWellLogPlot* wellLogPlot; + RimWellLogPlot* wellLogPlot = nullptr; firstAncestorOrThisOfType(wellLogPlot); if (wellLogPlot && m_wellLogTrackPlotWidget) @@ -552,6 +552,22 @@ void RimWellLogTrack::setXAxisTitle(const QString& text) m_xAxisTitle = text; } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimWellLogTrack::setFormationWellPath(RimWellPath* wellPath) +{ + m_formationWellPath = wellPath; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimWellLogTrack::setFormationSimWellName(const QString& simWellName) +{ + m_formationSimWellName = simWellName; +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -560,6 +576,22 @@ void RimWellLogTrack::setFormationBranchIndex(int branchIndex) m_formationBranchIndex = branchIndex; } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimWellLogTrack::setFormationCase(RimCase* rimCase) +{ + m_formationCase = rimCase; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimWellLogTrack::setFormationTrajectoryType(TrajectoryType trajectoryType) +{ + m_formationTrajectoryType = trajectoryType; +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/ProjectDataModel/RimWellLogTrack.h b/ApplicationCode/ProjectDataModel/RimWellLogTrack.h index 79a773d5a1..83a3d48170 100644 --- a/ApplicationCode/ProjectDataModel/RimWellLogTrack.h +++ b/ApplicationCode/ProjectDataModel/RimWellLogTrack.h @@ -80,7 +80,12 @@ public: size_t curveIndex(RimWellLogCurve* curve); size_t curveCount() { return curves.size(); } void setXAxisTitle(const QString& text); + + void setFormationWellPath(RimWellPath* wellPath); + void setFormationSimWellName(const QString& simWellName); void setFormationBranchIndex(int branchIndex); + void setFormationCase(RimCase* rimCase); + void setFormationTrajectoryType(TrajectoryType trajectoryType); int formationBranchIndex() const; RimCase* formationNamesCase() const;