Context menu 'Delete All Well Paths'

p4#: 22354
This commit is contained in:
Magne Sjaastad
2013-09-08 12:11:22 +02:00
parent 7edac904d3
commit 3a77390b0a
4 changed files with 42 additions and 0 deletions

View File

@@ -1057,3 +1057,25 @@ void RimUiTreeModelPdm::setObjectToggleStateForSelection(QModelIndexList selecte
}*/
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimUiTreeModelPdm::deleteAllWellPaths(const QModelIndex& itemIndex)
{
if (!itemIndex.isValid()) return;
caf::PdmUiTreeItem* uiItem = getTreeItemFromIndex(itemIndex);
if (!uiItem) return;
caf::PdmObject* object = uiItem->dataObject().p();
RimWellPathCollection* wellPathCollection = dynamic_cast<RimWellPathCollection*>(object);
if (!wellPathCollection) return;
// Remove item from UI tree model before delete of project data structure
removeRows_special(0, uiItem->childCount(), itemIndex);
wellPathCollection->wellPaths.deleteAllChildObjects();
clearClipboard();
}