Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Ultimaker/Cura.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArjen Hiemstra <a.hiemstra@ultimaker.com>2015-05-18 16:03:42 +0300
committerArjen Hiemstra <a.hiemstra@ultimaker.com>2015-05-18 16:03:42 +0300
commitae71c309ace41d3c5c25e9b5a53579ae5ae7409b (patch)
treee8150155c75abbbe5c0b89cae9a142d7eb0160cb /cura/CameraAnimation.py
parent70f5dede95fbf5f7c4760fe7748175f0ba984f01 (diff)
Move src to cura so we can use the same package for installed and source
Contributes to #41 Contributes to #42
Diffstat (limited to 'cura/CameraAnimation.py')
-rw-r--r--cura/CameraAnimation.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/cura/CameraAnimation.py b/cura/CameraAnimation.py
new file mode 100644
index 0000000000..e31cbb93a4
--- /dev/null
+++ b/cura/CameraAnimation.py
@@ -0,0 +1,27 @@
+# Copyright (c) 2015 Ultimaker B.V.
+# Cura is released under the terms of the AGPLv3 or higher.
+
+
+from PyQt5.QtCore import QVariantAnimation, QEasingCurve
+from PyQt5.QtGui import QVector3D
+
+from UM.Math.Vector import Vector
+
+class CameraAnimation(QVariantAnimation):
+ def __init__(self, parent = None):
+ super().__init__(parent)
+ self._camera_tool = None
+ self.setDuration(500)
+ self.setEasingCurve(QEasingCurve.InOutQuad)
+
+ def setCameraTool(self, camera_tool):
+ self._camera_tool = camera_tool
+
+ def setStart(self, start):
+ self.setStartValue(QVector3D(start.x, start.y, start.z))
+
+ def setTarget(self, target):
+ self.setEndValue(QVector3D(target.x, target.y, target.z))
+
+ def updateCurrentValue(self, value):
+ self._camera_tool.setOrigin(Vector(value.x(), value.y(), value.z()))