diff options
author | Jaime van Kessel <nallath@gmail.com> | 2020-01-10 16:25:35 +0300 |
---|---|---|
committer | Jaime van Kessel <nallath@gmail.com> | 2020-01-10 16:58:53 +0300 |
commit | 81b33b864959610ea5a367d3149706d35ca499e2 (patch) | |
tree | e828e6e8950529d318d2f77e4be007d48a1d3e5b /cura/LayerPolygon.py | |
parent | 3e07105edfa12651980abe61e0141127d60598f0 (diff) |
Add some missing typing
Diffstat (limited to 'cura/LayerPolygon.py')
-rw-r--r-- | cura/LayerPolygon.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/cura/LayerPolygon.py b/cura/LayerPolygon.py index 0d6489aaa2..ca752e35ee 100644 --- a/cura/LayerPolygon.py +++ b/cura/LayerPolygon.py @@ -149,17 +149,17 @@ class LayerPolygon: def getColors(self): return self._colors - def mapLineTypeToColor(self, line_types): + def mapLineTypeToColor(self, line_types: numpy.ndarray) -> numpy.ndarray: return self._color_map[line_types] - def isInfillOrSkinType(self, line_types): + def isInfillOrSkinType(self, line_types: numpy.ndarray) -> numpy.ndarray: return self._isInfillOrSkinTypeMap[line_types] - def lineMeshVertexCount(self): - return (self._vertex_end - self._vertex_begin) + def lineMeshVertexCount(self) -> int: + return self._vertex_end - self._vertex_begin - def lineMeshElementCount(self): - return (self._index_end - self._index_begin) + def lineMeshElementCount(self) -> int: + return self._index_end - self._index_begin @property def extruder(self): @@ -202,7 +202,7 @@ class LayerPolygon: return self._jump_count # Calculate normals for the entire polygon using numpy. - def getNormals(self): + def getNormals(self) -> numpy.ndarray: normals = numpy.copy(self._data) normals[:, 1] = 0.0 # We are only interested in 2D normals @@ -226,11 +226,11 @@ class LayerPolygon: return normals - __color_map = None # type: numpy.ndarray[Any] + __color_map = None # type: numpy.ndarray ## Gets the instance of the VersionUpgradeManager, or creates one. @classmethod - def getColorMap(cls): + def getColorMap(cls) -> numpy.ndarray: if cls.__color_map is None: theme = QtApplication.getInstance().getTheme() cls.__color_map = numpy.array([ |