diff --git a/ApplicationCode/Commands/RicNewWellLogPlotFeature.cpp b/ApplicationCode/Commands/RicNewWellLogPlotFeature.cpp index c7863d0d55..81e47f6472 100644 --- a/ApplicationCode/Commands/RicNewWellLogPlotFeature.cpp +++ b/ApplicationCode/Commands/RicNewWellLogPlotFeature.cpp @@ -22,8 +22,11 @@ #include "RimProject.h" #include "RimMainPlotCollection.h" #include "RimWellLogPlotCollection.h" +#include "RimWellLogPlot.h" +#include "RimWellLogPlotTrace.h" #include "RiaApplication.h" +#include "RiuMainWindow.h" #include @@ -46,7 +49,14 @@ void RicNewWellLogPlotFeature::onActionTriggered(bool isChecked) RimWellLogPlotCollection* wellLogPlotColl = wellLogPlotCollection(); if (wellLogPlotColl) { - wellLogPlotColl->addWellLogPlot(); + RimWellLogPlot* plot = new RimWellLogPlot(); + RimWellLogPlotTrace* plotrace = new RimWellLogPlotTrace(); + + plot->addTrace(plotrace); + wellLogPlotColl->wellLogPlots().push_back(plot); + + RiaApplication::instance()->project()->updateConnectedEditors(); + RiuMainWindow::instance()->setCurrentObjectInTreeView(plot); } } diff --git a/ApplicationCode/ProjectDataModel/RimWellLogPlotCollection.cpp b/ApplicationCode/ProjectDataModel/RimWellLogPlotCollection.cpp index c5e01642e8..b992858268 100644 --- a/ApplicationCode/ProjectDataModel/RimWellLogPlotCollection.cpp +++ b/ApplicationCode/ProjectDataModel/RimWellLogPlotCollection.cpp @@ -20,11 +20,6 @@ #include "RimWellLogPlotCollection.h" #include "RimWellLogPlot.h" -#include "RimProject.h" - -#include "RiuMainWindow.h" - -#include "RiaApplication.h" #include "cafPdmUiTreeView.h" @@ -48,15 +43,3 @@ RimWellLogPlotCollection::~RimWellLogPlotCollection() { wellLogPlots.deleteAllChildObjects(); } - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RimWellLogPlotCollection::addWellLogPlot() -{ - RimWellLogPlot* plot = new RimWellLogPlot(); - wellLogPlots.push_back(plot); - - RiaApplication::instance()->project()->updateConnectedEditors(); - RiuMainWindow::instance()->setCurrentObjectInTreeView(plot); -} diff --git a/ApplicationCode/ProjectDataModel/RimWellLogPlotCollection.h b/ApplicationCode/ProjectDataModel/RimWellLogPlotCollection.h index bb1db4240e..2c605712fe 100644 --- a/ApplicationCode/ProjectDataModel/RimWellLogPlotCollection.h +++ b/ApplicationCode/ProjectDataModel/RimWellLogPlotCollection.h @@ -38,9 +38,4 @@ public: virtual ~RimWellLogPlotCollection(); caf::PdmChildArrayField wellLogPlots; - - void addWellLogPlot(); - -private: - caf::PdmField show; };