Cura/cura/LayerDataDecorator.py
Ghostkeeper 12d3af8d93
Fix type error
The typing was added by Nallath just now but it is giving an error for me.
The private access is allowed here because we're implementing it in the same class, even though it is a different instance.

This fixes the type error a bit more strictly than what lfei just did at the same time as me.
2019-01-28 13:50:32 +01:00

26 lines
824 B
Python

# Copyright (c) 2019 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
from typing import Optional
from UM.Scene.SceneNodeDecorator import SceneNodeDecorator
from cura.LayerData import LayerData
## Simple decorator to indicate a scene node holds layer data.
class LayerDataDecorator(SceneNodeDecorator):
def __init__(self):
super().__init__()
self._layer_data = None # type: Optional[LayerData]
def getLayerData(self) -> Optional["LayerData"]:
return self._layer_data
def setLayerData(self, layer_data: LayerData) -> None:
self._layer_data = layer_data
def __deepcopy__(self, memo) -> "LayerDataDecorator":
copied_decorator = LayerDataDecorator()
copied_decorator._layer_data = self._layer_data
return copied_decorator