mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 22:47:29 -06:00
D6: Changed Decorator
This commit is contained in:
parent
90f7cebbbb
commit
647c2f15ba
3 changed files with 7 additions and 16 deletions
|
@ -594,9 +594,9 @@ class CuraApplication(QtApplication):
|
||||||
scene_bounding_box = None
|
scene_bounding_box = None
|
||||||
should_pause = False
|
should_pause = False
|
||||||
for node in DepthFirstIterator(self.getController().getScene().getRoot()):
|
for node in DepthFirstIterator(self.getController().getScene().getRoot()):
|
||||||
if type(node) is not SceneNode or (not node.getMeshData() and not node.callDecoration("shouldBlockSlicing")):
|
if type(node) is not SceneNode or (not node.getMeshData() and node.callDecoration("isSliceable") is None):
|
||||||
continue
|
continue
|
||||||
if node.callDecoration("shouldBlockSlicing"):
|
if node.callDecoration("isSliceable") is False:
|
||||||
should_pause = True
|
should_pause = True
|
||||||
gcode_list = node.callDecoration("gCodeList")
|
gcode_list = node.callDecoration("gCodeList")
|
||||||
if gcode_list is not None:
|
if gcode_list is not None:
|
||||||
|
@ -613,7 +613,8 @@ class CuraApplication(QtApplication):
|
||||||
print_information = self.getPrintInformation()
|
print_information = self.getPrintInformation()
|
||||||
if should_pause:
|
if should_pause:
|
||||||
self.getBackend().pauseSlicing()
|
self.getBackend().pauseSlicing()
|
||||||
print_information.setPreSliced(True)
|
if print_information:
|
||||||
|
print_information.setPreSliced(True)
|
||||||
else:
|
else:
|
||||||
self.getBackend().continueSlicing()
|
self.getBackend().continueSlicing()
|
||||||
if print_information:
|
if print_information:
|
||||||
|
@ -739,7 +740,7 @@ class CuraApplication(QtApplication):
|
||||||
for node in DepthFirstIterator(self.getController().getScene().getRoot()):
|
for node in DepthFirstIterator(self.getController().getScene().getRoot()):
|
||||||
if type(node) is not SceneNode:
|
if type(node) is not SceneNode:
|
||||||
continue
|
continue
|
||||||
if (not node.getMeshData() and node.callDecoration("isSliceable")) and not node.callDecoration("isGroup"):
|
if (not node.getMeshData() and node.callDecoration("isSliceable") is None) and not node.callDecoration("isGroup"):
|
||||||
continue # Node that doesnt have a mesh and is not a group.
|
continue # Node that doesnt have a mesh and is not a group.
|
||||||
if node.getParent() and node.getParent().callDecoration("isGroup"):
|
if node.getParent() and node.getParent().callDecoration("isGroup"):
|
||||||
continue # Grouped nodes don't need resetting as their parent (the group) is resetted)
|
continue # Grouped nodes don't need resetting as their parent (the group) is resetted)
|
||||||
|
@ -1046,7 +1047,7 @@ class CuraApplication(QtApplication):
|
||||||
scene = self.getController().getScene()
|
scene = self.getController().getScene()
|
||||||
|
|
||||||
for node in DepthFirstIterator(scene.getRoot()):
|
for node in DepthFirstIterator(scene.getRoot()):
|
||||||
if node.callDecoration("shouldBlockSlicing"):
|
if node.callDecoration("isSliceable") is False:
|
||||||
self.deleteAll()
|
self.deleteAll()
|
||||||
break
|
break
|
||||||
|
|
||||||
|
@ -1093,13 +1094,10 @@ class CuraApplication(QtApplication):
|
||||||
if extension.lower() in self.non_sliceable_extensions:
|
if extension.lower() in self.non_sliceable_extensions:
|
||||||
self.changeLayerViewSignal.emit()
|
self.changeLayerViewSignal.emit()
|
||||||
sliceable_decorator = SliceableObjectDecorator()
|
sliceable_decorator = SliceableObjectDecorator()
|
||||||
sliceable_decorator.setBlockSlicing(True)
|
|
||||||
sliceable_decorator.setSliceable(False)
|
sliceable_decorator.setSliceable(False)
|
||||||
node.addDecorator(sliceable_decorator)
|
node.addDecorator(sliceable_decorator)
|
||||||
else:
|
else:
|
||||||
sliceable_decorator = SliceableObjectDecorator()
|
sliceable_decorator = SliceableObjectDecorator()
|
||||||
sliceable_decorator.setBlockSlicing(False)
|
|
||||||
sliceable_decorator.setSliceable(True)
|
|
||||||
node.addDecorator(sliceable_decorator)
|
node.addDecorator(sliceable_decorator)
|
||||||
|
|
||||||
scene = self.getController().getScene()
|
scene = self.getController().getScene()
|
||||||
|
|
|
@ -6,16 +6,9 @@ class SliceableObjectDecorator(SceneNodeDecorator):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
self._sliceable = True
|
self._sliceable = True
|
||||||
self._block_slicing = False
|
|
||||||
|
|
||||||
def isSliceable(self):
|
def isSliceable(self):
|
||||||
return self._sliceable
|
return self._sliceable
|
||||||
|
|
||||||
def setSliceable(self, sliceable):
|
def setSliceable(self, sliceable):
|
||||||
self._sliceable = sliceable
|
self._sliceable = sliceable
|
||||||
|
|
||||||
def shouldBlockSlicing(self):
|
|
||||||
return self._block_slicing
|
|
||||||
|
|
||||||
def setBlockSlicing(self, block_slicing):
|
|
||||||
self._block_slicing = block_slicing
|
|
||||||
|
|
|
@ -49,7 +49,7 @@ class LayerPass(RenderPass):
|
||||||
if isinstance(node, ToolHandle):
|
if isinstance(node, ToolHandle):
|
||||||
tool_handle_batch.addItem(node.getWorldTransformation(), mesh = node.getSolidMesh())
|
tool_handle_batch.addItem(node.getWorldTransformation(), mesh = node.getSolidMesh())
|
||||||
|
|
||||||
elif isinstance(node, SceneNode) and (node.getMeshData() or not node.callDecoration("isSliceable")) and node.isVisible():
|
elif isinstance(node, SceneNode) and (node.getMeshData() or node.callDecoration("isSliceable") is False) and node.isVisible():
|
||||||
layer_data = node.callDecoration("getLayerData")
|
layer_data = node.callDecoration("getLayerData")
|
||||||
if not layer_data:
|
if not layer_data:
|
||||||
continue
|
continue
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue