mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-21 21:58:01 -06:00
review comments fixed
Co-authored-by: Casper Lamboo <c.lamboo@ultimaker.com> CURA-7951
This commit is contained in:
parent
4096fc864b
commit
118f49a052
7 changed files with 76 additions and 90 deletions
|
@ -1442,13 +1442,13 @@ class CuraApplication(QtApplication):
|
|||
# Single build plate
|
||||
@pyqtSlot()
|
||||
def arrangeAll(self) -> None:
|
||||
self._arrangeAll(False)
|
||||
self._arrangeAll(grid_arrangement = False)
|
||||
|
||||
@pyqtSlot()
|
||||
def arrangeAllInGrid(self) -> None:
|
||||
self._arrangeAll(True)
|
||||
self._arrangeAll(grid_arrangement = True)
|
||||
|
||||
def _arrangeAll(self, grid_arrangement: bool) -> None:
|
||||
def _arrangeAll(self, *, grid_arrangement: bool) -> None:
|
||||
nodes_to_arrange = []
|
||||
active_build_plate = self.getMultiBuildPlateModel().activeBuildPlate
|
||||
locked_nodes = []
|
||||
|
@ -1478,18 +1478,17 @@ class CuraApplication(QtApplication):
|
|||
locked_nodes.append(node)
|
||||
else:
|
||||
nodes_to_arrange.append(node)
|
||||
self.arrange(nodes_to_arrange, locked_nodes, grid_arrangement)
|
||||
self.arrange(nodes_to_arrange, locked_nodes, grid_arrangement = grid_arrangement)
|
||||
|
||||
def arrange(self, nodes: List[SceneNode], fixed_nodes: List[SceneNode], grid_arrangement: bool = False) -> None:
|
||||
def arrange(self, nodes: List[SceneNode], fixed_nodes: List[SceneNode], *, grid_arrangement: bool = False) -> None:
|
||||
"""Arrange a set of nodes given a set of fixed nodes
|
||||
|
||||
:param nodes: nodes that we have to place
|
||||
:param fixed_nodes: nodes that are placed in the arranger before finding spots for nodes
|
||||
:param grid_arrangement: If set to true if objects are to be placed in a grid
|
||||
"""
|
||||
|
||||
min_offset = self.getBuildVolume().getEdgeDisallowedSize() + 2 # Allow for some rounding errors
|
||||
job = ArrangeObjectsJob(nodes, fixed_nodes, min_offset=max(min_offset, 8), grid_arrange =grid_arrangement)
|
||||
job = ArrangeObjectsJob(nodes, fixed_nodes, min_offset = max(min_offset, 8), grid_arrange = grid_arrangement)
|
||||
job.start()
|
||||
|
||||
@pyqtSlot()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue