]> gerrit.simantics Code Review - simantics/platform.git/commitdiff
Added Simantics/Diagram function positionToVector. 66/566/1
authorTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Mon, 29 May 2017 09:58:32 +0000 (12:58 +0300)
committerTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Mon, 29 May 2017 10:26:31 +0000 (13:26 +0300)
This function complements the existing positionToDoubleArray and is
required to support for instance diagram template scenegraph node
transform property definition with SCL formulas.

Also fixes:
* Potential NPE in ExperimentUtil.scheduleShutdownActiveExperiment
* MANIFEST.MF warnings from org.simantics.document.server

refs #7246

Change-Id: Icfe41a33824c91e5be76940bbf4d46d34c8d0334

bundles/org.simantics.document.server/META-INF/MANIFEST.MF
bundles/org.simantics.modeling/scl/Simantics/Diagram.scl
bundles/org.simantics.simulation/src/org/simantics/simulation/experiment/ExperimentUtil.java

index 184361779afe2cee78c99351fab38ebdf212a8ce..016ed9189530fa547d9cbf1d91c4f7fe11b6b256 100644 (file)
@@ -33,11 +33,4 @@ Export-Package: org.simantics.document.server,
  org.simantics.document.server.request,
  org.simantics.document.server.serverResponse
 Import-Package: org.simantics.layer0.utils.direct
-Bundle-ClassPath: .,
- batik/batik-dom.jar,
- batik/batik-svg-dom.jar,
- batik/batik-svggen.jar,
- batik/batik-awt-util.jar,
- batik/batik-util.jar,
- batik/batik-ext.jar,
- batik/batik-xml.jar
+Bundle-ClassPath: .
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
index ecf7f0a9ae82ee8d42cce99e67c996dbab2ed446..449afe59f3209d26e229b57c0da30bb4c05ccc95 100644 (file)
@@ -148,7 +148,8 @@ public final class ExperimentUtil {
             job.setUser(true);
             job.schedule();
         } else {
-            callback.accept(null);
+            if (callback != null)
+                callback.accept(null);
         }
     }