]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.modeling/scl/Simantics/Diagram.scl
Merge "JsonNode support with Data/Json"
[simantics/platform.git] / bundles / org.simantics.modeling / scl / Simantics / Diagram.scl
index 6e04a6f6d6f4c6e21cbc9e94d3fae840786838ae..554a25edad081a50f4388688d19820b359440942 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
@@ -794,8 +805,10 @@ setTransform element transform = claimRelatedValueWithType element DIA.HasTransf
     
 importJava "org.simantics.modeling.svg.CreateSVGElement" where
     createSVGElement :: Resource -> String -> ByteArray -> Double -> Double -> <WriteGraph> ()
+    createSVGElementR :: Resource -> String -> ByteArray -> Double -> Double -> <WriteGraph> Resource
     
     importSVGElement :: Resource -> File -> Double -> Double -> <WriteGraph> ()
+    importSVGElementR :: Resource -> File -> Double -> Double -> <WriteGraph> Resource
     
 importJava "org.simantics.diagram.synchronization.graph.RemoveElement" where
     removeElement :: Resource -> Resource -> <WriteGraph> ()