From a3a2aac9b6ad6ad5e45a83548c29a8f67270f39f Mon Sep 17 00:00:00 2001 From: Kristian Bendiksen Date: Wed, 8 Sep 2021 11:14:07 +0200 Subject: [PATCH] Add method to remove plot in Well Log Plot Collection. --- .../WellLog/RimWellLogPlotCollection.cpp | 9 +++++++++ .../WellLog/RimWellLogPlotCollection.h | 10 ++++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogPlotCollection.cpp b/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogPlotCollection.cpp index 85663e4682..b34174bfbb 100644 --- a/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogPlotCollection.cpp +++ b/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogPlotCollection.cpp @@ -166,6 +166,15 @@ void RimWellLogPlotCollection::deleteAllPlots() m_wellLogPlots.deleteAllChildObjects(); } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimWellLogPlotCollection::removePlot( gsl::not_null plot ) +{ + m_wellLogPlots.removeChildObject( plot ); + updateAllRequiredEditors(); +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogPlotCollection.h b/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogPlotCollection.h index c00e47076b..cacbe501f1 100644 --- a/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogPlotCollection.h +++ b/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogPlotCollection.h @@ -59,10 +59,12 @@ public: RigGeoMechWellLogExtractor* findOrCreateExtractor( RimWellPath* wellPath, RimGeoMechCase* geoMechCase ); std::vector wellLogPlots() const; - void addWellLogPlot( gsl::not_null wellLogPlot ); - void deleteAllPlots() override; - void loadDataAndUpdateAllPlots() override; - size_t plotCount() const override; + + void addWellLogPlot( gsl::not_null wellLogPlot ); + void removePlot( gsl::not_null plot ); + void deleteAllPlots() override; + void loadDataAndUpdateAllPlots() override; + size_t plotCount() const override; void deleteAllExtractors(); void removeExtractors( const RigWellPath* wellPathGeometry );