mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1306 Use general delete sub items for well path collection
This commit is contained in:
@@ -18,11 +18,14 @@
|
||||
|
||||
#include "RicDeleteSubItemsFeature.h"
|
||||
|
||||
#include <QAction>
|
||||
#include "RimSummaryPlotCollection.h"
|
||||
#include "RimWellPathCollection.h"
|
||||
|
||||
#include "cafAssert.h"
|
||||
#include "cafPdmUiItem.h"
|
||||
#include "cafSelectionManager.h"
|
||||
#include "cafAssert.h"
|
||||
|
||||
#include <QAction>
|
||||
|
||||
|
||||
CAF_CMD_SOURCE_INIT(RicDeleteSubItemsFeature, "RicDeleteSubItemsFeature");
|
||||
@@ -68,6 +71,15 @@ void RicDeleteSubItemsFeature::onActionTriggered(bool isChecked)
|
||||
|
||||
summaryPlotColl->updateConnectedEditors();
|
||||
}
|
||||
|
||||
RimWellPathCollection* wellPathColl = dynamic_cast<RimWellPathCollection*>(item);
|
||||
if (wellPathColl)
|
||||
{
|
||||
wellPathColl->deleteAllWellPaths();
|
||||
|
||||
wellPathColl->updateConnectedEditors();
|
||||
wellPathColl->scheduleGeometryRegenAndRedrawViews();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -91,6 +103,11 @@ bool RicDeleteSubItemsFeature::hasDeletableSubItems(caf::PdmUiItem* uiItem)
|
||||
return true;
|
||||
}
|
||||
|
||||
RimWellPathCollection* wellPathColl = dynamic_cast<RimWellPathCollection*>(uiItem);
|
||||
if (wellPathColl && wellPathColl->wellPaths().size() > 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user