From: luukkainen Date: Mon, 10 Nov 2008 15:11:13 +0000 (+0000) Subject: Moved animation stubs for g2d.stubs to animation plug-in X-Git-Tag: simantics-1.19.0~20^2~22 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=54be6a9a0f71bc6c6b4c2584327264fb6053ade9;p=simantics%2F3d.git Moved animation stubs for g2d.stubs to animation plug-in git-svn-id: https://www.simantics.org/svn/simantics/3d/branches/dev@7606 ac1ea38d-2e2b-0410-8846-a27921b304fc --- diff --git a/org.simantics.proconf.g3d/META-INF/MANIFEST.MF b/org.simantics.proconf.g3d/META-INF/MANIFEST.MF index ae81bc87..08657a9c 100644 --- a/org.simantics.proconf.g3d/META-INF/MANIFEST.MF +++ b/org.simantics.proconf.g3d/META-INF/MANIFEST.MF @@ -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, diff --git a/org.simantics.proconf.g3d/src/org/simantics/proconf/g3d/Resources.java b/org.simantics.proconf.g3d/src/org/simantics/proconf/g3d/Resources.java index f0cacb41..fed4f4bc 100644 --- a/org.simantics.proconf.g3d/src/org/simantics/proconf/g3d/Resources.java +++ b/org.simantics.proconf.g3d/src/org/simantics/proconf/g3d/Resources.java @@ -12,7 +12,7 @@ package org.simantics.proconf.g3d; import org.simantics.db.Graph; import org.simantics.equation.stubs.EquationResource; -import org.simantics.g2d.stubs.anim.AnimationResource; +import org.simantics.animation.stubs.AnimationResource; import org.simantics.animation.curve.CurveBuilder; import org.simantics.animation.curve.CurveBuilderImpl; import org.simantics.proconf.g3d.base.G3DTools; diff --git a/org.simantics.proconf.g3d/src/org/simantics/proconf/g3d/scenegraph/ModelNode.java b/org.simantics.proconf.g3d/src/org/simantics/proconf/g3d/scenegraph/ModelNode.java index ff2b6faa..844393aa 100644 --- a/org.simantics.proconf.g3d/src/org/simantics/proconf/g3d/scenegraph/ModelNode.java +++ b/org.simantics.proconf.g3d/src/org/simantics/proconf/g3d/scenegraph/ModelNode.java @@ -175,14 +175,14 @@ public class ModelNode extends AbstractGraphicsNode implements Animatable, IGeom return false; } G3DModel model = getG3DModel(graph); - Collection animations = model.getAnimation(); + Collection animations = model.getAnimation(); int num = animations.size(); if (num == 0) { ErrorLogger.getDefault().logWarning("Cannot set animation for " + shapeResource + " since it has no animations", null); return false; } int random = (int)Math.round(Math.random() * (num-1)); - Iterator i = animations.iterator(); + Iterator i = animations.iterator(); while(random > 0) { i.next(); random--; diff --git a/org.simantics.proconf.g3d/src/org/simantics/proconf/g3d/scenegraph/ParameterizedModelNode.java b/org.simantics.proconf.g3d/src/org/simantics/proconf/g3d/scenegraph/ParameterizedModelNode.java index 579beac2..723b310b 100644 --- a/org.simantics.proconf.g3d/src/org/simantics/proconf/g3d/scenegraph/ParameterizedModelNode.java +++ b/org.simantics.proconf.g3d/src/org/simantics/proconf/g3d/scenegraph/ParameterizedModelNode.java @@ -20,7 +20,7 @@ import org.simantics.db.ContextGraph; import org.simantics.db.Graph; import org.simantics.db.Resource; import org.simantics.equation.solver.Solver; -import org.simantics.g2d.stubs.anim.Animation; +import org.simantics.animation.stubs.Animation; import org.simantics.layer0.utils.Property; import org.simantics.layer0.utils.IEntity; import org.simantics.layer0.utils.EntityFactory; @@ -125,8 +125,8 @@ public class ParameterizedModelNode extends ModelNode { solver.pushToGraph(graph); Collection animations = model.getAnimation(); for (Animation animation : animations) { - Collection interpolators = animation.getInterpolator(); - for (org.simantics.g2d.stubs.anim.Interpolator interpolator : interpolators) { + Collection interpolators = animation.getInterpolator(); + for (org.simantics.animation.stubs.Interpolator interpolator : interpolators) { IEntity target = interpolator.getTarget(); // check all model properties for (Property p : modelProperties) { diff --git a/org.simantics.proconf.g3d/src/org/simantics/proconf/g3d/scenegraph/ShapeNode.java b/org.simantics.proconf.g3d/src/org/simantics/proconf/g3d/scenegraph/ShapeNode.java index b82265e4..3369b5ea 100644 --- a/org.simantics.proconf.g3d/src/org/simantics/proconf/g3d/scenegraph/ShapeNode.java +++ b/org.simantics.proconf.g3d/src/org/simantics/proconf/g3d/scenegraph/ShapeNode.java @@ -17,7 +17,7 @@ import java.util.List; import javax.vecmath.AxisAngle4d; import javax.vecmath.Quat4d; -import org.simantics.g2d.stubs.anim.Interpolator; +import org.simantics.animation.stubs.Interpolator; import org.simantics.animation.curve.SlerpCurve; import org.simantics.animation.curve.TCBCurve; import org.simantics.proconf.g3d.Resources; @@ -461,14 +461,14 @@ public class ShapeNode extends AbstractGraphicsNode implements Animatable, IGeom body.attachChild(mesh); return false; } - org.simantics.g2d.stubs.anim.Animation animation = new org.simantics.g2d.stubs.anim.Animation(graph,res); + org.simantics.animation.stubs.Animation animation = new org.simantics.animation.stubs.Animation(graph,res); G3DNode shape = getG3DNode(graph); G3DNode modelResource = G3DTools.getModelFromResource(graph,shape.getResource()); assert (modelResource != null); G3DModel model = new G3DModel(graph,modelResource.getResource()); - Collection animations = model.getAnimation(); + Collection animations = model.getAnimation(); boolean found = false; - for (org.simantics.g2d.stubs.anim.Animation a : animations) { + for (org.simantics.animation.stubs.Animation a : animations) { if (a.getResource().equals(animation.getResource())) { found = true; break; @@ -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); return false; } - Collection interpolators = animation.getInterpolator(); - List handled = new ArrayList(); - List precalculated = new ArrayList(); - for (org.simantics.g2d.stubs.anim.Interpolator i : interpolators) { + Collection interpolators = animation.getInterpolator(); + List handled = new ArrayList(); + List precalculated = new ArrayList(); + for (org.simantics.animation.stubs.Interpolator i : interpolators) { IEntity target = i.getTarget(); if (G3DTools.hasProperty(graph,shape.getResource(),target.getResource())) handled.add(i); @@ -497,16 +497,16 @@ public class ShapeNode extends AbstractGraphicsNode implements Animatable, IGeom this.animation = new Animation(); - org.simantics.g2d.stubs.anim.Interpolator[] pos = new org.simantics.g2d.stubs.anim.Interpolator[3]; - org.simantics.g2d.stubs.anim.Interpolator[] ambient = new org.simantics.g2d.stubs.anim.Interpolator[3]; - org.simantics.g2d.stubs.anim.Interpolator[] diffuse = new org.simantics.g2d.stubs.anim.Interpolator[3]; - org.simantics.g2d.stubs.anim.Interpolator[] specular = new org.simantics.g2d.stubs.anim.Interpolator[3]; - org.simantics.g2d.stubs.anim.Interpolator[] emissive = new org.simantics.g2d.stubs.anim.Interpolator[3]; + org.simantics.animation.stubs.Interpolator[] pos = new org.simantics.animation.stubs.Interpolator[3]; + org.simantics.animation.stubs.Interpolator[] ambient = new org.simantics.animation.stubs.Interpolator[3]; + org.simantics.animation.stubs.Interpolator[] diffuse = new org.simantics.animation.stubs.Interpolator[3]; + org.simantics.animation.stubs.Interpolator[] specular = new org.simantics.animation.stubs.Interpolator[3]; + org.simantics.animation.stubs.Interpolator[] emissive = new org.simantics.animation.stubs.Interpolator[3]; Builtins builtins = graph.getBuiltins(); - for (org.simantics.g2d.stubs.anim.Interpolator i : handled) { + for (org.simantics.animation.stubs.Interpolator i : handled) { IEntity target = i.getTarget(); //if (target.isInstanceOf(Resources.g3dResource.LocalOrientation)) { if (target.isInstanceOf(Resources.g3dResource.Orientation) && target.getRelatedObjects(Resources.g3dResource.LocalOrientationOf).size() == 1) { @@ -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); } } else if (parent.isInstanceOf(Resources.g3dResource.Color)) { - org.simantics.g2d.stubs.anim.Interpolator[] color = null; + org.simantics.animation.stubs.Interpolator[] color = null; if (parent.isInstanceOf(Resources.g3dResource.Color) && parent.getRelatedObjects(Resources.g3dResource.AmbientColorOf).size() > 0) { color = ambient; } else if (parent.isInstanceOf(Resources.g3dResource.Color)&& parent.getRelatedObjects(Resources.g3dResource.DiffuseColorOf).size() > 0) { @@ -644,7 +644,7 @@ public class ShapeNode extends AbstractGraphicsNode implements Animatable, IGeom return true; } - private void addColorInterpolator(G3DNode shape, org.simantics.g2d.stubs.anim.Interpolator[] color, int type) { + private void addColorInterpolator(G3DNode shape, org.simantics.animation.stubs.Interpolator[] color, int type) { if (color[0] != null || color[1] != null || color[2] != null) { ScalarInterpolator xIp; ScalarInterpolator yIp;