Use a decorator to track Z offset

This makes it much easier to correct for Z offset after operations

CURA-196 #Ready-for-Review
This commit is contained in:
Arjen Hiemstra 2015-10-23 14:03:43 +02:00
parent d0b5fe84b8
commit 07c9ecc931
3 changed files with 36 additions and 10 deletions

13
cura/ZOffsetDecorator.py Normal file
View file

@ -0,0 +1,13 @@
from UM.Scene.SceneNodeDecorator import SceneNodeDecorator
## A decorator that stores the amount an object has been moved below the platform.
class ZOffsetDecorator(SceneNodeDecorator):
def __init__(self):
self._z_offset = 0
def setZOffset(self, offset):
print("setZOffset", offset)
self._z_offset = offset
def getZOffset(self):
return self._z_offset