ZOffsetDecorator.py 558 B

123456789101112131415161718
  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):
  5. super().__init__()
  6. self._z_offset = 0
  7. def setZOffset(self, offset):
  8. self._z_offset = offset
  9. def getZOffset(self):
  10. return self._z_offset
  11. def __deepcopy__(self, memo):
  12. copied_decorator = ZOffsetDecorator()
  13. copied_decorator.setZOffset(self.getZOffset())
  14. return copied_decorator