mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-06-04 11:14:21 +08:00
Document layer view navigation functions
This commit is contained in:
parent
e9d3ba9b74
commit
2cdb025adb
@ -248,6 +248,12 @@ class SimulationView(CuraView):
|
|||||||
renderer.queueNode(node, transparent = True, shader = self._ghost_shader)
|
renderer.queueNode(node, transparent = True, shader = self._ghost_shader)
|
||||||
|
|
||||||
def setLayer(self, value: int) -> None:
|
def setLayer(self, value: int) -> None:
|
||||||
|
"""
|
||||||
|
Set the upper end of the range of visible layers.
|
||||||
|
|
||||||
|
If setting it below the lower end of the range, the lower end is lowered so that 1 layer stays visible.
|
||||||
|
:param value: The new layer number to show, 0-indexed.
|
||||||
|
"""
|
||||||
if self._current_layer_num != value:
|
if self._current_layer_num != value:
|
||||||
self._current_layer_num = min(max(value, 0), self._max_layers)
|
self._current_layer_num = min(max(value, 0), self._max_layers)
|
||||||
self._minimum_layer_num = min(self._current_layer_num, self._minimum_layer_num)
|
self._minimum_layer_num = min(self._current_layer_num, self._minimum_layer_num)
|
||||||
@ -256,6 +262,12 @@ class SimulationView(CuraView):
|
|||||||
self.currentLayerNumChanged.emit()
|
self.currentLayerNumChanged.emit()
|
||||||
|
|
||||||
def setMinimumLayer(self, value: int) -> None:
|
def setMinimumLayer(self, value: int) -> None:
|
||||||
|
"""
|
||||||
|
Set the lower end of the range of visible layers.
|
||||||
|
|
||||||
|
If setting it above the upper end of the range, the upper end is increased so that 1 layer stays visible.
|
||||||
|
:param value: The new lower end of the range of visible layers, 0-indexed.
|
||||||
|
"""
|
||||||
if self._minimum_layer_num != value:
|
if self._minimum_layer_num != value:
|
||||||
self._minimum_layer_num = min(max(value, 0), self._max_layers)
|
self._minimum_layer_num = min(max(value, 0), self._max_layers)
|
||||||
self._current_layer_num = max(self._current_layer_num, self._minimum_layer_num)
|
self._current_layer_num = max(self._current_layer_num, self._minimum_layer_num)
|
||||||
@ -264,6 +276,12 @@ class SimulationView(CuraView):
|
|||||||
self.currentLayerNumChanged.emit()
|
self.currentLayerNumChanged.emit()
|
||||||
|
|
||||||
def setPath(self, value: int) -> None:
|
def setPath(self, value: int) -> None:
|
||||||
|
"""
|
||||||
|
Set the upper end of the range of visible paths on the current layer.
|
||||||
|
|
||||||
|
If setting it below the lower end of the range, the lower end is lowered so that 1 path stays visible.
|
||||||
|
:param value: The new path index to show, 0-indexed.
|
||||||
|
"""
|
||||||
if self._current_path_num != value:
|
if self._current_path_num != value:
|
||||||
self._current_path_num = min(max(value, 0), self._max_paths)
|
self._current_path_num = min(max(value, 0), self._max_paths)
|
||||||
self._minimum_path_num = min(self._minimum_path_num, self._current_path_num)
|
self._minimum_path_num = min(self._minimum_path_num, self._current_path_num)
|
||||||
@ -272,6 +290,12 @@ class SimulationView(CuraView):
|
|||||||
self.currentPathNumChanged.emit()
|
self.currentPathNumChanged.emit()
|
||||||
|
|
||||||
def setMinimumPath(self, value: int) -> None:
|
def setMinimumPath(self, value: int) -> None:
|
||||||
|
"""
|
||||||
|
Set the lower end of the range of visible paths on the current layer.
|
||||||
|
|
||||||
|
If setting it above the upper end of the range, the upper end is increased so that 1 path stays visible.
|
||||||
|
:param value: The new lower end of the range of visible paths, 0-indexed.
|
||||||
|
"""
|
||||||
if self._minimum_path_num != value:
|
if self._minimum_path_num != value:
|
||||||
self._minimum_path_num = min(max(value, 0), self._max_paths)
|
self._minimum_path_num = min(max(value, 0), self._max_paths)
|
||||||
self._current_path_num = max(self._current_path_num, self._minimum_path_num)
|
self._current_path_num = max(self._current_path_num, self._minimum_path_num)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user