LayerDataDecorator.py 824 B

12345678910111213141516171819202122232425
  1. # Copyright (c) 2019 Ultimaker B.V.
  2. # Cura is released under the terms of the LGPLv3 or higher.
  3. from typing import Optional
  4. from UM.Scene.SceneNodeDecorator import SceneNodeDecorator
  5. from cura.LayerData import LayerData
  6. ## Simple decorator to indicate a scene node holds layer data.
  7. class LayerDataDecorator(SceneNodeDecorator):
  8. def __init__(self):
  9. super().__init__()
  10. self._layer_data = None # type: Optional[LayerData]
  11. def getLayerData(self) -> Optional["LayerData"]:
  12. return self._layer_data
  13. def setLayerData(self, layer_data: LayerData) -> None:
  14. self._layer_data = layer_data
  15. def __deepcopy__(self, memo) -> "LayerDataDecorator":
  16. copied_decorator = LayerDataDecorator()
  17. copied_decorator._layer_data = self._layer_data
  18. return copied_decorator