]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.modeling/scl/Simantics/Diagram.scl
Added Simantics/Diagram function positionToVector.
[simantics/platform.git] / bundles / org.simantics.modeling / scl / Simantics / Diagram.scl
index 6e04a6f6d6f4c6e21cbc9e94d3fae840786838ae..bf5c589e85f8f2a248d55a71c5244bc1332b2fae 100644 (file)
@@ -57,6 +57,17 @@ flipY (Position xx xy yx yy x y) = Position xx (-xy) yx (-yy) x y
 
 positionToDoubleArray (Position a b c d e f) = toDoubleArray [a,b,c,d,e,f]
 
+positionToVector :: Position -> Vector Double
+positionToVector (Position a b c d e f) = runProc
+    (do r = createMVector 6
+        setMVector r 0 a
+        setMVector r 1 b
+        setMVector r 2 c
+        setMVector r 3 d
+        setMVector r 4 e
+        setMVector r 5 f
+        freezeMVector r)
+
 // --- Diagram element data types -----------------------------------
 
 data Property res = Property res Dynamic