]> gerrit.simantics Code Review - simantics/3d.git/blobdiff - org.simantics.proconf.g3d/src/org/simantics/proconf/g3d/scenegraph/ShapeNode.java
Moved animation stubs for g2d.stubs to animation plug-in
[simantics/3d.git] / org.simantics.proconf.g3d / src / org / simantics / proconf / g3d / scenegraph / ShapeNode.java
index b82265e4fce3653c36e5c4f2ae664c1a8c37560f..3369b5ead95e7afacde03555ca0ac9b7e646e181 100644 (file)
@@ -17,7 +17,7 @@ import java.util.List;
 import javax.vecmath.AxisAngle4d;\r
 import javax.vecmath.Quat4d;\r
 \r
-import org.simantics.g2d.stubs.anim.Interpolator;\r
+import org.simantics.animation.stubs.Interpolator;\r
 import org.simantics.animation.curve.SlerpCurve;\r
 import org.simantics.animation.curve.TCBCurve;\r
 import org.simantics.proconf.g3d.Resources;\r
@@ -461,14 +461,14 @@ public class ShapeNode extends AbstractGraphicsNode implements Animatable, IGeom
                        body.attachChild(mesh);\r
             return false;\r
         }\r
-       org.simantics.g2d.stubs.anim.Animation animation = new org.simantics.g2d.stubs.anim.Animation(graph,res);\r
+       org.simantics.animation.stubs.Animation animation = new org.simantics.animation.stubs.Animation(graph,res);\r
        G3DNode shape = getG3DNode(graph);\r
         G3DNode modelResource = G3DTools.getModelFromResource(graph,shape.getResource());\r
         assert (modelResource != null);\r
         G3DModel model = new G3DModel(graph,modelResource.getResource());\r
-        Collection<org.simantics.g2d.stubs.anim.Animation> animations = model.getAnimation();\r
+        Collection<org.simantics.animation.stubs.Animation> animations = model.getAnimation();\r
         boolean found = false;\r
-        for (org.simantics.g2d.stubs.anim.Animation a : animations) {\r
+        for (org.simantics.animation.stubs.Animation a : animations) {\r
             if (a.getResource().equals(animation.getResource())) {\r
                 found = true;\r
                 break;\r
@@ -478,10 +478,10 @@ public class ShapeNode extends AbstractGraphicsNode implements Animatable, IGeom
             ErrorLogger.getDefault().logWarning("Shape " + shape.getResource() + " cannot handle animation " + animation.getResource() + " because it isn't model's animation", null);\r
             return false;\r
         }\r
-        Collection<org.simantics.g2d.stubs.anim.Interpolator> interpolators = animation.getInterpolator();\r
-        List<org.simantics.g2d.stubs.anim.Interpolator> handled = new ArrayList<org.simantics.g2d.stubs.anim.Interpolator>();\r
-        List<org.simantics.g2d.stubs.anim.Interpolator> precalculated = new ArrayList<org.simantics.g2d.stubs.anim.Interpolator>();\r
-        for (org.simantics.g2d.stubs.anim.Interpolator i : interpolators) {\r
+        Collection<org.simantics.animation.stubs.Interpolator> interpolators = animation.getInterpolator();\r
+        List<org.simantics.animation.stubs.Interpolator> handled = new ArrayList<org.simantics.animation.stubs.Interpolator>();\r
+        List<org.simantics.animation.stubs.Interpolator> precalculated = new ArrayList<org.simantics.animation.stubs.Interpolator>();\r
+        for (org.simantics.animation.stubs.Interpolator i : interpolators) {\r
             IEntity target = i.getTarget();\r
             if (G3DTools.hasProperty(graph,shape.getResource(),target.getResource()))\r
                 handled.add(i);\r
@@ -497,16 +497,16 @@ public class ShapeNode extends AbstractGraphicsNode implements Animatable, IGeom
         \r
         this.animation = new Animation();\r
         \r
-        org.simantics.g2d.stubs.anim.Interpolator[] pos = new org.simantics.g2d.stubs.anim.Interpolator[3];\r
-        org.simantics.g2d.stubs.anim.Interpolator[] ambient = new org.simantics.g2d.stubs.anim.Interpolator[3];\r
-        org.simantics.g2d.stubs.anim.Interpolator[] diffuse = new org.simantics.g2d.stubs.anim.Interpolator[3];\r
-        org.simantics.g2d.stubs.anim.Interpolator[] specular = new org.simantics.g2d.stubs.anim.Interpolator[3];\r
-        org.simantics.g2d.stubs.anim.Interpolator[] emissive = new org.simantics.g2d.stubs.anim.Interpolator[3];\r
+        org.simantics.animation.stubs.Interpolator[] pos = new org.simantics.animation.stubs.Interpolator[3];\r
+        org.simantics.animation.stubs.Interpolator[] ambient = new org.simantics.animation.stubs.Interpolator[3];\r
+        org.simantics.animation.stubs.Interpolator[] diffuse = new org.simantics.animation.stubs.Interpolator[3];\r
+        org.simantics.animation.stubs.Interpolator[] specular = new org.simantics.animation.stubs.Interpolator[3];\r
+        org.simantics.animation.stubs.Interpolator[] emissive = new org.simantics.animation.stubs.Interpolator[3];\r
 \r
         Builtins builtins = graph.getBuiltins();\r
 \r
         \r
-        for (org.simantics.g2d.stubs.anim.Interpolator i : handled) {\r
+        for (org.simantics.animation.stubs.Interpolator i : handled) {\r
             IEntity target = i.getTarget();\r
             //if (target.isInstanceOf(Resources.g3dResource.LocalOrientation)) {\r
             if (target.isInstanceOf(Resources.g3dResource.Orientation) && target.getRelatedObjects(Resources.g3dResource.LocalOrientationOf).size() == 1) {\r
@@ -530,7 +530,7 @@ public class ShapeNode extends AbstractGraphicsNode implements Animatable, IGeom
                             ErrorLogger.getDefault().logWarning("Cannot map animation interpolator " + i.getResource() + " to target (Position ?)" + target.getResource(),  null);\r
                         }\r
                     } else if (parent.isInstanceOf(Resources.g3dResource.Color)) {\r
-                        org.simantics.g2d.stubs.anim.Interpolator[] color = null;\r
+                        org.simantics.animation.stubs.Interpolator[] color = null;\r
                         if (parent.isInstanceOf(Resources.g3dResource.Color) && parent.getRelatedObjects(Resources.g3dResource.AmbientColorOf).size() > 0) {\r
                                 color = ambient;\r
                         } else if (parent.isInstanceOf(Resources.g3dResource.Color)&& parent.getRelatedObjects(Resources.g3dResource.DiffuseColorOf).size() > 0) {\r
@@ -644,7 +644,7 @@ public class ShapeNode extends AbstractGraphicsNode implements Animatable, IGeom
         return true;\r
     }\r
     \r
-    private void addColorInterpolator(G3DNode shape, org.simantics.g2d.stubs.anim.Interpolator[] color, int type) {\r
+    private void addColorInterpolator(G3DNode shape, org.simantics.animation.stubs.Interpolator[] color, int type) {\r
         if (color[0] != null || color[1] != null || color[2] != null) {\r
             ScalarInterpolator xIp;\r
             ScalarInterpolator yIp;\r