mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-16 04:25:52 +08:00
Move deleteAll to Uranium
Because it's used by WorkspaceFileHandler. Contributes to issue CURA-5330.
This commit is contained in:
parent
4e4dc800a7
commit
757824ae93
@ -1153,39 +1153,6 @@ class CuraApplication(QtApplication):
|
|||||||
|
|
||||||
Selection.add(node)
|
Selection.add(node)
|
||||||
|
|
||||||
## Delete all nodes containing mesh data in the scene.
|
|
||||||
# \param only_selectable. Set this to False to delete objects from all build plates
|
|
||||||
@pyqtSlot()
|
|
||||||
def deleteAll(self, only_selectable = True):
|
|
||||||
Logger.log("i", "Clearing scene")
|
|
||||||
if not self.getController().getToolsEnabled():
|
|
||||||
return
|
|
||||||
|
|
||||||
nodes = []
|
|
||||||
for node in DepthFirstIterator(self.getController().getScene().getRoot()):
|
|
||||||
if not isinstance(node, SceneNode):
|
|
||||||
continue
|
|
||||||
if (not node.getMeshData() and not node.callDecoration("getLayerData")) and not node.callDecoration("isGroup"):
|
|
||||||
continue # Node that doesnt have a mesh and is not a group.
|
|
||||||
if only_selectable and not node.isSelectable():
|
|
||||||
continue
|
|
||||||
if not node.callDecoration("isSliceable") and not node.callDecoration("getLayerData") and not node.callDecoration("isGroup"):
|
|
||||||
continue # Only remove nodes that are selectable.
|
|
||||||
if node.getParent() and node.getParent().callDecoration("isGroup"):
|
|
||||||
continue # Grouped nodes don't need resetting as their parent (the group) is resetted)
|
|
||||||
nodes.append(node)
|
|
||||||
if nodes:
|
|
||||||
op = GroupedOperation()
|
|
||||||
|
|
||||||
for node in nodes:
|
|
||||||
op.addOperation(RemoveSceneNodeOperation(node))
|
|
||||||
|
|
||||||
# Reset the print information
|
|
||||||
self.getController().getScene().sceneChanged.emit(node)
|
|
||||||
|
|
||||||
op.push()
|
|
||||||
Selection.clear()
|
|
||||||
|
|
||||||
## Reset all translation on nodes with mesh data.
|
## Reset all translation on nodes with mesh data.
|
||||||
@pyqtSlot()
|
@pyqtSlot()
|
||||||
def resetAllTranslation(self):
|
def resetAllTranslation(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user