mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-16 11:17:49 -06:00
Added comments, changed small layout and id thing. CURA-3273
This commit is contained in:
parent
50ba236e66
commit
47ab49795f
4 changed files with 27 additions and 5 deletions
|
@ -70,8 +70,19 @@ class LayerPolygon:
|
||||||
self._vertex_begin = 0
|
self._vertex_begin = 0
|
||||||
self._vertex_end = numpy.sum( self._build_cache_needed_points )
|
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):
|
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()
|
self.buildCache()
|
||||||
|
|
||||||
line_mesh_mask = self._build_cache_line_mesh_mask
|
line_mesh_mask = self._build_cache_line_mesh_mask
|
||||||
|
|
|
@ -27,6 +27,9 @@ from time import time
|
||||||
catalog = i18nCatalog("cura")
|
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):
|
def colorCodeToRGBA(color_code):
|
||||||
return [
|
return [
|
||||||
int(color_code[1:3], 16) / 255,
|
int(color_code[1:3], 16) / 255,
|
||||||
|
|
|
@ -168,13 +168,21 @@ class LayerView(View):
|
||||||
|
|
||||||
self.currentLayerNumChanged.emit()
|
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):
|
def setLayerViewType(self, layer_view_type):
|
||||||
self._layer_view_type = layer_view_type
|
self._layer_view_type = layer_view_type
|
||||||
self.currentLayerNumChanged.emit()
|
self.currentLayerNumChanged.emit()
|
||||||
|
|
||||||
|
## Return the layer view type, integer as in LayerView.qml and this class
|
||||||
def getLayerViewType(self):
|
def getLayerViewType(self):
|
||||||
return self._layer_view_type
|
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):
|
def setExtruderOpacity(self, extruder_nr, opacity):
|
||||||
self._extruder_opacity[extruder_nr] = opacity
|
self._extruder_opacity[extruder_nr] = opacity
|
||||||
self.currentLayerNumChanged.emit()
|
self.currentLayerNumChanged.emit()
|
||||||
|
|
|
@ -15,7 +15,7 @@ Item
|
||||||
|
|
||||||
Slider
|
Slider
|
||||||
{
|
{
|
||||||
id: slider2
|
id: sliderMinimumLayer
|
||||||
width: UM.Theme.getSize("slider_layerview_size").width
|
width: UM.Theme.getSize("slider_layerview_size").width
|
||||||
height: UM.Theme.getSize("slider_layerview_size").height
|
height: UM.Theme.getSize("slider_layerview_size").height
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
|
@ -151,7 +151,6 @@ Item
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
anchors.top: slider_background.bottom
|
anchors.top: slider_background.bottom
|
||||||
anchors.topMargin: UM.Theme.getSize("default_margin").height
|
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
|
width: UM.Theme.getSize("slider_layerview_background").width * 3
|
||||||
height: slider.height + UM.Theme.getSize("default_margin").height * 2
|
height: slider.height + UM.Theme.getSize("default_margin").height * 2
|
||||||
color: UM.Theme.getColor("tool_panel_background");
|
color: UM.Theme.getColor("tool_panel_background");
|
||||||
|
@ -203,7 +202,8 @@ Item
|
||||||
id: view_settings
|
id: view_settings
|
||||||
anchors.top: UM.LayerView.compatibilityMode ? compatibilityModeLabel.bottom : layerTypeCombobox.bottom
|
anchors.top: UM.LayerView.compatibilityMode ? compatibilityModeLabel.bottom : layerTypeCombobox.bottom
|
||||||
anchors.topMargin: UM.Theme.getSize("default_margin").height
|
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 {
|
CheckBox {
|
||||||
checked: true
|
checked: true
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue