Skip to content

Commit

Permalink
#1306 Use general delete sub items for well path collection
Browse files Browse the repository at this point in the history
  • Loading branch information
magnesj committed Mar 8, 2017
1 parent d547079 commit 84f76e5
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 124 deletions.
21 changes: 19 additions & 2 deletions ApplicationCode/Commands/RicDeleteSubItemsFeature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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();
}
}
}

Expand All @@ -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;
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,13 @@ endif()

set (SOURCE_GROUP_HEADER_FILES
${CEE_CURRENT_LIST_DIR}RicWellPathDeleteFeature.h
${CEE_CURRENT_LIST_DIR}RicWellPathsDeleteAllFeature.h
${CEE_CURRENT_LIST_DIR}RicWellPathsImportFileFeature.h
${CEE_CURRENT_LIST_DIR}RicWellPathsImportSsihubFeature.h
${CEE_CURRENT_LIST_DIR}RicWellPathViewerEventHandler.h
)

set (SOURCE_GROUP_SOURCE_FILES
${CEE_CURRENT_LIST_DIR}RicWellPathDeleteFeature.cpp
${CEE_CURRENT_LIST_DIR}RicWellPathsDeleteAllFeature.cpp
${CEE_CURRENT_LIST_DIR}RicWellPathsImportFileFeature.cpp
${CEE_CURRENT_LIST_DIR}RicWellPathsImportSsihubFeature.cpp
${CEE_CURRENT_LIST_DIR}RicWellPathViewerEventHandler.cpp
Expand Down

This file was deleted.

This file was deleted.

2 changes: 0 additions & 2 deletions ApplicationCode/ProjectDataModel/RimContextCommandBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,6 @@ QStringList RimContextCommandBuilder::commandsFromSelection()
commandIds << "RicWellPathsImportFileFeature";
commandIds << "RicWellPathsImportSsihubFeature";
commandIds << "RicWellLogsImportFileFeature";
commandIds << "Separator";
commandIds << "RicWellPathsDeleteAllFeature";
}
else if (dynamic_cast<RimWellPath*>(uiItem))
{
Expand Down

0 comments on commit 84f76e5

Please sign in to comment.