]> gerrit.simantics Code Review - simantics/3d.git/commitdiff
Moved animation stubs for g2d.stubs to animation plug-in
authorluukkainen <luukkainen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Mon, 10 Nov 2008 15:11:13 +0000 (15:11 +0000)
committerluukkainen <luukkainen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Mon, 10 Nov 2008 15:11:13 +0000 (15:11 +0000)
git-svn-id: https://www.simantics.org/svn/simantics/3d/branches/dev@7606 ac1ea38d-2e2b-0410-8846-a27921b304fc

org.simantics.proconf.g3d/META-INF/MANIFEST.MF
org.simantics.proconf.g3d/src/org/simantics/proconf/g3d/Resources.java
org.simantics.proconf.g3d/src/org/simantics/proconf/g3d/scenegraph/ModelNode.java
org.simantics.proconf.g3d/src/org/simantics/proconf/g3d/scenegraph/ParameterizedModelNode.java
org.simantics.proconf.g3d/src/org/simantics/proconf/g3d/scenegraph/ShapeNode.java

index ae81bc874ef884dc2706a68ab4a1663216fb705d..08657a9c7aace2690723ec9d8761f139e37cad57 100644 (file)
@@ -7,7 +7,6 @@ Bundle-Activator: org.simantics.proconf.g3d.Activator
 Bundle-Vendor: VTT
 Require-Bundle: org.eclipse.ui,
  org.eclipse.core.runtime,
- org.simantics.g2d.stubs,
  javax.vecmath,
  com.jme.eclipse,
  org.simantics.proconf.image,
index f0cacb41a13d193c3a2997e16249557bd1d14dfb..fed4f4bc3a9c0ab44540ae4ea91683875158a619 100644 (file)
@@ -12,7 +12,7 @@ package org.simantics.proconf.g3d;
 \r
 import org.simantics.db.Graph;\r
 import org.simantics.equation.stubs.EquationResource;\r
-import org.simantics.g2d.stubs.anim.AnimationResource;\r
+import org.simantics.animation.stubs.AnimationResource;\r
 import org.simantics.animation.curve.CurveBuilder;\r
 import org.simantics.animation.curve.CurveBuilderImpl;\r
 import org.simantics.proconf.g3d.base.G3DTools;\r
index ff2b6faa59ed212a14067e0be5e9372cafea8dd2..844393aa76ef8ca24ace66a72be700372378348d 100644 (file)
@@ -175,14 +175,14 @@ public class ModelNode extends AbstractGraphicsNode implements Animatable, IGeom
             return false;    \r
         }\r
         G3DModel model = getG3DModel(graph);\r
-        Collection<org.simantics.g2d.stubs.anim.Animation> animations = model.getAnimation();\r
+        Collection<org.simantics.animation.stubs.Animation> animations = model.getAnimation();\r
         int num = animations.size();\r
         if (num == 0) {\r
             ErrorLogger.getDefault().logWarning("Cannot set animation for " + shapeResource + " since it has no animations", null);\r
             return false;            \r
         }\r
         int random = (int)Math.round(Math.random() * (num-1));\r
-        Iterator<org.simantics.g2d.stubs.anim.Animation> i = animations.iterator();\r
+        Iterator<org.simantics.animation.stubs.Animation> i = animations.iterator();\r
         while(random > 0) {\r
             i.next();\r
             random--;\r
index 579beac26abd2056feaa66ebf8bbf9cf31c8c0ac..723b310b0680ecac3ef10306981b07a5f30f80e8 100644 (file)
@@ -20,7 +20,7 @@ import org.simantics.db.ContextGraph;
 import org.simantics.db.Graph;\r
 import org.simantics.db.Resource;\r
 import org.simantics.equation.solver.Solver;\r
-import org.simantics.g2d.stubs.anim.Animation;\r
+import org.simantics.animation.stubs.Animation;\r
 import org.simantics.layer0.utils.Property;\r
 import org.simantics.layer0.utils.IEntity;\r
 import org.simantics.layer0.utils.EntityFactory;\r
@@ -125,8 +125,8 @@ public class ParameterizedModelNode extends ModelNode {
                solver.pushToGraph(graph);\r
                Collection<Animation> animations = model.getAnimation();\r
         for (Animation animation : animations) {\r
-               Collection<org.simantics.g2d.stubs.anim.Interpolator> interpolators = animation.getInterpolator();\r
-               for (org.simantics.g2d.stubs.anim.Interpolator interpolator : interpolators) {\r
+               Collection<org.simantics.animation.stubs.Interpolator> interpolators = animation.getInterpolator();\r
+               for (org.simantics.animation.stubs.Interpolator interpolator : interpolators) {\r
                        IEntity target = interpolator.getTarget();\r
                        // check all model properties\r
                        for (Property p : modelProperties) {\r
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