diff --git a/ApplicationCode/Commands/WellLogCommands/RicNewWellLogCurveExtractionFeature.cpp b/ApplicationCode/Commands/WellLogCommands/RicNewWellLogCurveExtractionFeature.cpp index dcd67a303f..1c0fcdbffa 100644 --- a/ApplicationCode/Commands/WellLogCommands/RicNewWellLogCurveExtractionFeature.cpp +++ b/ApplicationCode/Commands/WellLogCommands/RicNewWellLogCurveExtractionFeature.cpp @@ -28,6 +28,7 @@ #include "RimWellPathCollection.h" #include "RiuMainWindow.h" +#include "RiaApplication.h" #include "cafSelectionManager.h" @@ -54,7 +55,7 @@ void RicNewWellLogCurveExtractionFeature::onActionTriggered(bool isChecked) RimWellLogPlotTrack* wellLogPlotTrack = selectedWellLogPlotTrack(); if (wellLogPlotTrack) { - addCurve(wellLogPlotTrack); + addCurve(wellLogPlotTrack, NULL, NULL); } else { @@ -62,8 +63,9 @@ void RicNewWellLogCurveExtractionFeature::onActionTriggered(bool isChecked) if (wellPath) { RimWellLogPlotTrack* wellLogPlotTrack = RicNewWellLogPlotFeatureImpl::createWellLogPlotTrack(); - RimWellLogExtractionCurve* plotCurve = addCurve(wellLogPlotTrack); - plotCurve->setWellPath(wellPath); + RimWellLogExtractionCurve* plotCurve = addCurve(wellLogPlotTrack, RiaApplication::instance()->activeReservoirView(), wellPath); + + plotCurve->updatePlotData(); plotCurve->updateConnectedEditors(); } } @@ -100,7 +102,7 @@ RimWellPath* RicNewWellLogCurveExtractionFeature::selectedWellPath() //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RimWellLogExtractionCurve* RicNewWellLogCurveExtractionFeature::addCurve(RimWellLogPlotTrack* plotTrack) +RimWellLogExtractionCurve* RicNewWellLogCurveExtractionFeature::addCurve(RimWellLogPlotTrack* plotTrack, RimView* view, RimWellPath* wellPath) { CVF_ASSERT(plotTrack); @@ -111,9 +113,10 @@ RimWellLogExtractionCurve* RicNewWellLogCurveExtractionFeature::addCurve(RimWell cvf::Color3f curveColor = RicWellLogPlotCurveFeatureImpl::curveColorFromIndex(curveIndex); curve->setColor(curveColor); + curve->setWellPath(wellPath); + curve->setPropertiesFromView(view); plotTrack->updateConnectedEditors(); - RiuMainWindow::instance()->setCurrentObjectInTreeView(curve); return curve; diff --git a/ApplicationCode/Commands/WellLogCommands/RicNewWellLogCurveExtractionFeature.h b/ApplicationCode/Commands/WellLogCommands/RicNewWellLogCurveExtractionFeature.h index 5bb6a8498a..3f9bba8903 100644 --- a/ApplicationCode/Commands/WellLogCommands/RicNewWellLogCurveExtractionFeature.h +++ b/ApplicationCode/Commands/WellLogCommands/RicNewWellLogCurveExtractionFeature.h @@ -24,6 +24,7 @@ class RimWellLogExtractionCurve; class RimWellLogPlotTrack; class RimWellPath; +class RimView; //================================================================================================== /// @@ -33,7 +34,7 @@ class RicNewWellLogCurveExtractionFeature : public caf::CmdFeature CAF_CMD_HEADER_INIT; public: - static RimWellLogExtractionCurve* addCurve(RimWellLogPlotTrack* plotTrack); + static RimWellLogExtractionCurve* addCurve(RimWellLogPlotTrack* plotTrack, RimView* view, RimWellPath* wellPath); protected: diff --git a/ApplicationCode/Commands/WellLogCommands/RicNewWellLogPlotFeature.cpp b/ApplicationCode/Commands/WellLogCommands/RicNewWellLogPlotFeature.cpp index 5fc487545c..3f90c9d037 100644 --- a/ApplicationCode/Commands/WellLogCommands/RicNewWellLogPlotFeature.cpp +++ b/ApplicationCode/Commands/WellLogCommands/RicNewWellLogPlotFeature.cpp @@ -51,7 +51,7 @@ bool RicNewWellLogPlotFeature::isCommandEnabled() void RicNewWellLogPlotFeature::onActionTriggered(bool isChecked) { RimWellLogPlotTrack* plotTrack = RicNewWellLogPlotFeatureImpl::createWellLogPlotTrack(); - RicNewWellLogCurveExtractionFeature::addCurve(plotTrack); + RicNewWellLogCurveExtractionFeature::addCurve(plotTrack, NULL, NULL); } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/Commands/WellLogCommands/RicNewWellLogPlotTrackFeature.cpp b/ApplicationCode/Commands/WellLogCommands/RicNewWellLogPlotTrackFeature.cpp index 334400b86c..f988a934bb 100644 --- a/ApplicationCode/Commands/WellLogCommands/RicNewWellLogPlotTrackFeature.cpp +++ b/ApplicationCode/Commands/WellLogCommands/RicNewWellLogPlotTrackFeature.cpp @@ -54,7 +54,7 @@ void RicNewWellLogPlotTrackFeature::onActionTriggered(bool isChecked) plotTrack->setDescription(QString("Track %1").arg(wellLogPlot->trackCount())); wellLogPlot->updateConnectedEditors(); - RicNewWellLogCurveExtractionFeature::addCurve(plotTrack); + RicNewWellLogCurveExtractionFeature::addCurve(plotTrack, NULL, NULL); } } diff --git a/ApplicationCode/ProjectDataModel/RimWellLogExtractionCurve.cpp b/ApplicationCode/ProjectDataModel/RimWellLogExtractionCurve.cpp index 6aa33ad504..c915b8f7e6 100644 --- a/ApplicationCode/ProjectDataModel/RimWellLogExtractionCurve.cpp +++ b/ApplicationCode/ProjectDataModel/RimWellLogExtractionCurve.cpp @@ -41,6 +41,10 @@ #include "RimWellLogPlotTrack.h" #include "RimWellPath.h" #include "RimWellPathCollection.h" +#include "RimEclipseView.h" +#include "RimEclipseCellColors.h" +#include "RimGeoMechView.h" +#include "RimGeoMechCellColors.h" #include "RiuWellLogPlotCurve.h" #include "RiuWellLogTrackPlot.h" @@ -107,6 +111,33 @@ void RimWellLogExtractionCurve::setWellPath(RimWellPath* wellPath) m_wellPath = wellPath; } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimWellLogExtractionCurve::setPropertiesFromView(RimView* view) +{ + m_case = view ? view->ownerCase() : NULL; + + RimGeoMechCase* geomCase = dynamic_cast(m_case.value()); + RimEclipseCase* eclipseCase = dynamic_cast(m_case.value()); + m_eclipseResultDefinition->setEclipseCase(eclipseCase); + m_geomResultDefinition->setGeoMechCase(geomCase); + + RimEclipseView* eclipseView = dynamic_cast(view); + if (eclipseView) + { + m_eclipseResultDefinition->setResultType(eclipseView->cellResult()->resultType()); + m_eclipseResultDefinition->setResultVariable(eclipseView->cellResult()->resultVariable()); + } + + RimGeoMechView* geoMechView = dynamic_cast(view); + if (geoMechView) + { + m_geomResultDefinition->setResultAddress(geoMechView->cellResult()->resultAddress()); + } +} + + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/ProjectDataModel/RimWellLogExtractionCurve.h b/ApplicationCode/ProjectDataModel/RimWellLogExtractionCurve.h index 2026285412..fbee4bb43d 100644 --- a/ApplicationCode/ProjectDataModel/RimWellLogExtractionCurve.h +++ b/ApplicationCode/ProjectDataModel/RimWellLogExtractionCurve.h @@ -28,6 +28,7 @@ class RimCase; class RimEclipseResultDefinition; class RimGeoMechResultDefinition; class RimWellPath; +class RimView; //================================================================================================== /// @@ -43,6 +44,7 @@ public: virtual void updatePlotData(); void setWellPath(RimWellPath* wellPath); + void setPropertiesFromView(RimView* view); protected: virtual QString createCurveName();