ZOffsetDecorator.py 614 B

12345678910111213141516171819
  1. from UM.Scene.SceneNodeDecorator import SceneNodeDecorator
  2. ## A decorator that stores the amount an object has been moved below the platform.
  3. class ZOffsetDecorator(SceneNodeDecorator):
  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