diff options
Diffstat (limited to 'cura/Scene')
-rw-r--r-- | cura/Scene/BuildPlateDecorator.py | 8 | ||||
-rw-r--r-- | cura/Scene/ConvexHullNode.py | 7 |
2 files changed, 9 insertions, 6 deletions
diff --git a/cura/Scene/BuildPlateDecorator.py b/cura/Scene/BuildPlateDecorator.py index dfb465b7ad..cff9f88f62 100644 --- a/cura/Scene/BuildPlateDecorator.py +++ b/cura/Scene/BuildPlateDecorator.py @@ -4,12 +4,12 @@ from cura.Scene.CuraSceneNode import CuraSceneNode ## Make a SceneNode build plate aware CuraSceneNode objects all have this decorator. class BuildPlateDecorator(SceneNodeDecorator): - def __init__(self, build_plate_number = -1): + def __init__(self, build_plate_number: int = -1) -> None: super().__init__() - self._build_plate_number = None + self._build_plate_number = build_plate_number self.setBuildPlateNumber(build_plate_number) - def setBuildPlateNumber(self, nr): + def setBuildPlateNumber(self, nr: int) -> None: # Make sure that groups are set correctly # setBuildPlateForSelection in CuraActions makes sure that no single childs are set. self._build_plate_number = nr @@ -19,7 +19,7 @@ class BuildPlateDecorator(SceneNodeDecorator): for child in self._node.getChildren(): child.callDecoration("setBuildPlateNumber", nr) - def getBuildPlateNumber(self): + def getBuildPlateNumber(self) -> int: return self._build_plate_number def __deepcopy__(self, memo): diff --git a/cura/Scene/ConvexHullNode.py b/cura/Scene/ConvexHullNode.py index 6aa71223e5..da2713a522 100644 --- a/cura/Scene/ConvexHullNode.py +++ b/cura/Scene/ConvexHullNode.py @@ -1,6 +1,6 @@ # Copyright (c) 2015 Ultimaker B.V. # Cura is released under the terms of the LGPLv3 or higher. -from typing import Optional +from typing import Optional, TYPE_CHECKING from UM.Application import Application from UM.Math.Polygon import Polygon @@ -11,6 +11,9 @@ from UM.Math.Color import Color from UM.Mesh.MeshBuilder import MeshBuilder # To create a mesh to display the convex hull with. from UM.View.GL.OpenGL import OpenGL +if TYPE_CHECKING: + from UM.Mesh.MeshData import MeshData + class ConvexHullNode(SceneNode): shader = None # To prevent the shader from being re-built over and over again, only load it once. @@ -44,7 +47,7 @@ class ConvexHullNode(SceneNode): # The node this mesh is "watching" self._node = node # Area of the head + fans for display as a shadow on the buildplate - self._convex_hull_head_mesh = None + self._convex_hull_head_mesh = None # type: Optional[MeshData] self._node.decoratorsChanged.connect(self._onNodeDecoratorsChanged) self._onNodeDecoratorsChanged(self._node) |