From 2cdb025adb1f4e90e3727d543499f2641570f483 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Sat, 6 Mar 2021 14:21:38 +0100 Subject: [PATCH] Document layer view navigation functions --- plugins/SimulationView/SimulationView.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/plugins/SimulationView/SimulationView.py b/plugins/SimulationView/SimulationView.py index 48269aae8c..e307df3f1e 100644 --- a/plugins/SimulationView/SimulationView.py +++ b/plugins/SimulationView/SimulationView.py @@ -248,6 +248,12 @@ class SimulationView(CuraView): renderer.queueNode(node, transparent = True, shader = self._ghost_shader) 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: self._current_layer_num = min(max(value, 0), self._max_layers) self._minimum_layer_num = min(self._current_layer_num, self._minimum_layer_num) @@ -256,6 +262,12 @@ class SimulationView(CuraView): self.currentLayerNumChanged.emit() 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: self._minimum_layer_num = min(max(value, 0), self._max_layers) self._current_layer_num = max(self._current_layer_num, self._minimum_layer_num) @@ -264,6 +276,12 @@ class SimulationView(CuraView): self.currentLayerNumChanged.emit() 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: self._current_path_num = min(max(value, 0), self._max_paths) self._minimum_path_num = min(self._minimum_path_num, self._current_path_num) @@ -272,6 +290,12 @@ class SimulationView(CuraView): self.currentPathNumChanged.emit() 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: self._minimum_path_num = min(max(value, 0), self._max_paths) self._current_path_num = max(self._current_path_num, self._minimum_path_num)