ZOffsetDecorator.py 621 B

1234567891011121314151617181920
  1. from UM.Scene.SceneNodeDecorator import SceneNodeDecorator
  2. class ZOffsetDecorator(SceneNodeDecorator):
  3. """A decorator that stores the amount an object has been moved below the platform."""
  4. def __init__(self) -> None:
  5. super().__init__()
  6. self._z_offset = 0.
  7. def setZOffset(self, offset: float) -> None:
  8. self._z_offset = offset
  9. def getZOffset(self) -> float:
  10. return self._z_offset
  11. def __deepcopy__(self, memo) -> "ZOffsetDecorator":
  12. copied_decorator = ZOffsetDecorator()
  13. copied_decorator.setZOffset(self.getZOffset())
  14. return copied_decorator