diff --git a/cura/LayerPolygon.py b/cura/LayerPolygon.py index 577de9e40b..242bb25d56 100644 --- a/cura/LayerPolygon.py +++ b/cura/LayerPolygon.py @@ -69,9 +69,20 @@ class LayerPolygon: self._vertex_begin = 0 self._vertex_end = numpy.sum( self._build_cache_needed_points ) - + + ## Set all the arrays provided by the function caller, representing the LayerPolygon + # The arrays are either by vertex or by indices. + # + # \param vertex_offset : determines where to start and end filling the arrays + # \param index_offset : determines where to start and end filling the arrays + # \param vertices : vertex numpy array to be filled + # \param colors : vertex numpy array to be filled + # \param line_dimensions : vertex numpy array to be filled + # \param extruders : vertex numpy array to be filled + # \param line_types : vertex numpy array to be filled + # \param indices : index numpy array to be filled def build(self, vertex_offset, index_offset, vertices, colors, line_dimensions, extruders, line_types, indices): - if (self._build_cache_line_mesh_mask is None) or (self._build_cache_needed_points is None ): + if self._build_cache_line_mesh_mask is None or self._build_cache_needed_points is None: self.buildCache() line_mesh_mask = self._build_cache_line_mesh_mask diff --git a/plugins/CuraEngineBackend/ProcessSlicedLayersJob.py b/plugins/CuraEngineBackend/ProcessSlicedLayersJob.py index 0f46cc96bf..0d706f59b8 100644 --- a/plugins/CuraEngineBackend/ProcessSlicedLayersJob.py +++ b/plugins/CuraEngineBackend/ProcessSlicedLayersJob.py @@ -27,6 +27,9 @@ from time import time catalog = i18nCatalog("cura") +## Return a 4-tuple with floats 0-1 representing the html color code +# +# \param color_code html color code, i.e. "#FF0000" -> red def colorCodeToRGBA(color_code): return [ int(color_code[1:3], 16) / 255, diff --git a/plugins/LayerView/LayerView.py b/plugins/LayerView/LayerView.py index 6217ebdad2..c75c2eac0c 100644 --- a/plugins/LayerView/LayerView.py +++ b/plugins/LayerView/LayerView.py @@ -168,13 +168,21 @@ class LayerView(View): self.currentLayerNumChanged.emit() + ## Set the layer view type + # + # \param layer_view_type integer as in LayerView.qml and this class def setLayerViewType(self, layer_view_type): self._layer_view_type = layer_view_type self.currentLayerNumChanged.emit() + ## Return the layer view type, integer as in LayerView.qml and this class def getLayerViewType(self): return self._layer_view_type + ## Set the extruder opacity + # + # \param extruder_nr 0..3 + # \param opacity 0.0 .. 1.0 def setExtruderOpacity(self, extruder_nr, opacity): self._extruder_opacity[extruder_nr] = opacity self.currentLayerNumChanged.emit() diff --git a/plugins/LayerView/LayerView.qml b/plugins/LayerView/LayerView.qml index c2b2fb3559..ac85d6ccb2 100644 --- a/plugins/LayerView/LayerView.qml +++ b/plugins/LayerView/LayerView.qml @@ -15,7 +15,7 @@ Item Slider { - id: slider2 + id: sliderMinimumLayer width: UM.Theme.getSize("slider_layerview_size").width height: UM.Theme.getSize("slider_layerview_size").height anchors.left: parent.left @@ -151,7 +151,6 @@ Item anchors.verticalCenter: parent.verticalCenter anchors.top: slider_background.bottom anchors.topMargin: UM.Theme.getSize("default_margin").height - //anchors.leftMargin: UM.Theme.getSize("default_margin").width width: UM.Theme.getSize("slider_layerview_background").width * 3 height: slider.height + UM.Theme.getSize("default_margin").height * 2 color: UM.Theme.getColor("tool_panel_background"); @@ -203,7 +202,8 @@ Item id: view_settings anchors.top: UM.LayerView.compatibilityMode ? compatibilityModeLabel.bottom : layerTypeCombobox.bottom anchors.topMargin: UM.Theme.getSize("default_margin").height - x: UM.Theme.getSize("default_margin").width + anchors.left: parent.left + anchors.leftMargin: UM.Theme.getSize("default_margin").width CheckBox { checked: true