LayerDataDecorator.py 840 B

1234567891011121314151617181920212223242526
  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. class LayerDataDecorator(SceneNodeDecorator):
  7. """Simple decorator to indicate a scene node holds layer data."""
  8. def __init__(self) -> None:
  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