]> gerrit.simantics Code Review - simantics/3d.git/commitdiff
git-svn-id: https://www.simantics.org/svn/simantics/3d/branches/dev@9343 ac1ea38d...
authorluukkainen <luukkainen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Fri, 13 Feb 2009 08:59:40 +0000 (08:59 +0000)
committerluukkainen <luukkainen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Fri, 13 Feb 2009 08:59:40 +0000 (08:59 +0000)
org.simantics.proconf.processeditor/src/org/simantics/processeditor/animations/PipeFlowAnimation.java
org.simantics.proconf.processeditor/src/org/simantics/processeditor/common/ControlPointTools.java
org.simantics.proconf.processeditor/src/org/simantics/processeditor/dialogs/ConfigureAnimationDialog.java
org.simantics.proconf.processeditor/src/org/simantics/processeditor/dialogs/ConfigureMonitorDialog.java

index e37cfa9eaa3ef15bddb2f06634a223d66149d9e4..b1f4281eac9287258aa877892f5261ab58778b9b 100644 (file)
@@ -18,11 +18,9 @@ import javax.vecmath.Vector3d;
 import org.simantics.db.Graph;\r
 import org.simantics.db.Resource;\r
 import org.simantics.processeditor.common.ControlPointTools;\r
-import org.simantics.processeditor.common.PipingTools2;\r
 import org.simantics.processeditor.stubs.PipeControlPoint;\r
 import org.simantics.processeditor.stubs.VariableLengthInlineComponent;\r
 import org.simantics.proconf.g3d.animation.Animatable;\r
-import org.simantics.proconf.g3d.base.G3DTools;\r
 import org.simantics.proconf.g3d.base.VecmathJmeTools;\r
 \r
 import com.jme.renderer.ColorRGBA;\r
@@ -78,7 +76,7 @@ public class PipeFlowAnimation implements Animatable{
        if (numParticles < 2)\r
                numParticles = 2;\r
        \r
-       particle = ParticleFactory.buildParticles("Animation of " + s.getResource().getResourceId(),numParticles, ParticleGeometry.PT_QUAD);//new ParticleMesh("Animation of " + r.getId(),40);\r
+       particle = ParticleFactory.buildParticles("Animation of " + s.getResource().getResourceId(s.getGraph().getSession()),numParticles, ParticleGeometry.PT_QUAD);//new ParticleMesh("Animation of " + r.getId(),40);\r
        particle.setEmissionDirection(VecmathJmeTools.get(dir).normalize());\r
        particle.setLocalTranslation(VecmathJmeTools.get(p1));\r
        particle.setEmitType(ParticleGeometry.ET_POINT);\r
index c8e906c4faf1ea94c95fa36f44653b778a1c8b04..7584374f333e86468540c714c02de1b639b8c11d 100644 (file)
@@ -14,6 +14,7 @@ import javax.vecmath.Vector3d;
 \r
 import org.simantics.db.Graph;\r
 import org.simantics.db.Resource;\r
+import org.simantics.db.Session;\r
 import org.simantics.layer0.utils.EntityFactory;\r
 import org.simantics.layer0.utils.IEntity;\r
 import org.simantics.processeditor.ProcessResource;\r
@@ -1039,21 +1040,23 @@ public class ControlPointTools {
     }\r
     \r
     static boolean isControlPointChanged(PipeControlPoint node) {\r
-       long id = node.getResource().getResourceId();\r
+       Session session = node.getGraph().getSession();\r
+       long id = node.getResource().getResourceId(session);\r
+       \r
        boolean changed = updatePosition(node);\r
         //if (!changed) {\r
                if (node.isInstanceOf(ProcessResource.plant3Dresource.PathLegEndControlPoint)) {\r
                        if (node.isInstanceOf(ProcessResource.plant3Dresource.TurnControlPoint)) {\r
-                               Pair<Long,Long> connected = (Pair<Long,Long>)getProperty(node.getResource().getResourceId());\r
+                               Pair<Long,Long> connected = (Pair<Long,Long>)getProperty(node.getResource().getResourceId(session));\r
                     PipeControlPoint next = node.getNext();\r
                     PipeControlPoint prev = node.getPrevious();\r
                     if ((next != null && prev != null) && (\r
                         connected == null || \r
                        (connected.first == null && prev != null) ||\r
                        (connected.second == null && next != null) ||\r
-                        !connected.first.equals(prev.getResource().getResourceId()) ||\r
-                        !connected.second.equals(next.getResource().getResourceId()))) {\r
-                       storeProperty(id, new Pair<Long,Long>(prev.getResource().getResourceId(),next.getResource().getResourceId()));\r
+                        !connected.first.equals(prev.getResource().getResourceId(session)) ||\r
+                        !connected.second.equals(next.getResource().getResourceId(session)))) {\r
+                       storeProperty(id, new Pair<Long,Long>(prev.getResource().getResourceId(session),next.getResource().getResourceId(session)));\r
                         changed = true;  \r
                     }\r
                     if (node.isInstanceOf(ProcessResource.plant3Dresource.VariableAngleTurnControlPoint)) {\r
index 4ef225bbfb396e60e38102f81b01bed4885165c5..421bdd55405a508eef891862f0a293e9c8c9de36 100644 (file)
@@ -189,7 +189,7 @@ public class ConfigureAnimationDialog extends Dialog {
                                IEntity t = EntityFactory.create(g,type);\r
                                if (t.getRelatedObjects(ProcessResource.plant3Dresource.HasGraphics).size() > 0) {\r
                                        String key = t.getName();\r
-                               if (key.equals("")) key = "ERROR (" + type.getResourceId() + ")";\r
+                               if (key.equals("")) key = "ERROR (" + type.getResourceId(g.getSession()) + ")";\r
                                sorter.put(key, type);\r
                                }\r
                        }\r
@@ -366,7 +366,7 @@ public class ConfigureAnimationDialog extends Dialog {
                Collection<Animation> animations = model.getAnimation();\r
                for (Animation a : animations) {\r
                        String key = a.getName();\r
-               if (key.equals("")) key = "ERROR (" + a.getResource().getResourceId() + ")";\r
+               if (key.equals("")) key = "ERROR (" + a.getResource().getResourceId(model.getGraph().getSession()) + ")";\r
                sorter.put(key, a);\r
                }\r
                \r
index b1147f4abb45f27c219c0de1c882e2895b2e2759..c778c0e8c4260d8c3a3f080494e1fbebc7864253 100644 (file)
@@ -126,7 +126,7 @@ public class ConfigureMonitorDialog extends Dialog {
                 for (Resource type : types) {\r
                        IEntity t = EntityFactory.create(g, type);\r
                     String key = t.getName();\r
-                    if (key.equals("")) key = "ERROR (" + type.getResourceId() + ")";\r
+                    if (key.equals("")) key = "ERROR (" + type.getResourceId(g.getSession()) + ")";\r
                     sorter.put(key, type);\r
                 }\r
                 \r
@@ -198,7 +198,7 @@ public class ConfigureMonitorDialog extends Dialog {
         for (IEntity model : models) {\r
                \r
                        String key = model.getName();\r
-               if (key.equals("")) key = "ERROR (" + model.getResource().getResourceId() + ")";\r
+               if (key.equals("")) key = "ERROR (" + model.getResource().getResourceId(resource.getGraph().getSession()) + ")";\r
                sorter.put(key, new G3DModel(model));\r
         }\r
         \r