From: luukkainen Date: Fri, 13 Feb 2009 08:59:40 +0000 (+0000) Subject: git-svn-id: https://www.simantics.org/svn/simantics/3d/branches/dev@9343 ac1ea38d... X-Git-Tag: simantics-1.19.0~20^2~3 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=c58f0db363a3f2881577f84fb905e07775f65002;p=simantics%2F3d.git git-svn-id: https://www.simantics.org/svn/simantics/3d/branches/dev@9343 ac1ea38d-2e2b-0410-8846-a27921b304fc --- diff --git a/org.simantics.proconf.processeditor/src/org/simantics/processeditor/animations/PipeFlowAnimation.java b/org.simantics.proconf.processeditor/src/org/simantics/processeditor/animations/PipeFlowAnimation.java index e37cfa9e..b1f4281e 100644 --- a/org.simantics.proconf.processeditor/src/org/simantics/processeditor/animations/PipeFlowAnimation.java +++ b/org.simantics.proconf.processeditor/src/org/simantics/processeditor/animations/PipeFlowAnimation.java @@ -18,11 +18,9 @@ import javax.vecmath.Vector3d; import org.simantics.db.Graph; import org.simantics.db.Resource; import org.simantics.processeditor.common.ControlPointTools; -import org.simantics.processeditor.common.PipingTools2; import org.simantics.processeditor.stubs.PipeControlPoint; import org.simantics.processeditor.stubs.VariableLengthInlineComponent; import org.simantics.proconf.g3d.animation.Animatable; -import org.simantics.proconf.g3d.base.G3DTools; import org.simantics.proconf.g3d.base.VecmathJmeTools; import com.jme.renderer.ColorRGBA; @@ -78,7 +76,7 @@ public class PipeFlowAnimation implements Animatable{ if (numParticles < 2) numParticles = 2; - particle = ParticleFactory.buildParticles("Animation of " + s.getResource().getResourceId(),numParticles, ParticleGeometry.PT_QUAD);//new ParticleMesh("Animation of " + r.getId(),40); + particle = ParticleFactory.buildParticles("Animation of " + s.getResource().getResourceId(s.getGraph().getSession()),numParticles, ParticleGeometry.PT_QUAD);//new ParticleMesh("Animation of " + r.getId(),40); particle.setEmissionDirection(VecmathJmeTools.get(dir).normalize()); particle.setLocalTranslation(VecmathJmeTools.get(p1)); particle.setEmitType(ParticleGeometry.ET_POINT); diff --git a/org.simantics.proconf.processeditor/src/org/simantics/processeditor/common/ControlPointTools.java b/org.simantics.proconf.processeditor/src/org/simantics/processeditor/common/ControlPointTools.java index c8e906c4..7584374f 100644 --- a/org.simantics.proconf.processeditor/src/org/simantics/processeditor/common/ControlPointTools.java +++ b/org.simantics.proconf.processeditor/src/org/simantics/processeditor/common/ControlPointTools.java @@ -14,6 +14,7 @@ import javax.vecmath.Vector3d; import org.simantics.db.Graph; import org.simantics.db.Resource; +import org.simantics.db.Session; import org.simantics.layer0.utils.EntityFactory; import org.simantics.layer0.utils.IEntity; import org.simantics.processeditor.ProcessResource; @@ -1039,21 +1040,23 @@ public class ControlPointTools { } static boolean isControlPointChanged(PipeControlPoint node) { - long id = node.getResource().getResourceId(); + Session session = node.getGraph().getSession(); + long id = node.getResource().getResourceId(session); + boolean changed = updatePosition(node); //if (!changed) { if (node.isInstanceOf(ProcessResource.plant3Dresource.PathLegEndControlPoint)) { if (node.isInstanceOf(ProcessResource.plant3Dresource.TurnControlPoint)) { - Pair connected = (Pair)getProperty(node.getResource().getResourceId()); + Pair connected = (Pair)getProperty(node.getResource().getResourceId(session)); PipeControlPoint next = node.getNext(); PipeControlPoint prev = node.getPrevious(); if ((next != null && prev != null) && ( connected == null || (connected.first == null && prev != null) || (connected.second == null && next != null) || - !connected.first.equals(prev.getResource().getResourceId()) || - !connected.second.equals(next.getResource().getResourceId()))) { - storeProperty(id, new Pair(prev.getResource().getResourceId(),next.getResource().getResourceId())); + !connected.first.equals(prev.getResource().getResourceId(session)) || + !connected.second.equals(next.getResource().getResourceId(session)))) { + storeProperty(id, new Pair(prev.getResource().getResourceId(session),next.getResource().getResourceId(session))); changed = true; } if (node.isInstanceOf(ProcessResource.plant3Dresource.VariableAngleTurnControlPoint)) { diff --git a/org.simantics.proconf.processeditor/src/org/simantics/processeditor/dialogs/ConfigureAnimationDialog.java b/org.simantics.proconf.processeditor/src/org/simantics/processeditor/dialogs/ConfigureAnimationDialog.java index 4ef225bb..421bdd55 100644 --- a/org.simantics.proconf.processeditor/src/org/simantics/processeditor/dialogs/ConfigureAnimationDialog.java +++ b/org.simantics.proconf.processeditor/src/org/simantics/processeditor/dialogs/ConfigureAnimationDialog.java @@ -189,7 +189,7 @@ public class ConfigureAnimationDialog extends Dialog { IEntity t = EntityFactory.create(g,type); if (t.getRelatedObjects(ProcessResource.plant3Dresource.HasGraphics).size() > 0) { String key = t.getName(); - if (key.equals("")) key = "ERROR (" + type.getResourceId() + ")"; + if (key.equals("")) key = "ERROR (" + type.getResourceId(g.getSession()) + ")"; sorter.put(key, type); } } @@ -366,7 +366,7 @@ public class ConfigureAnimationDialog extends Dialog { Collection animations = model.getAnimation(); for (Animation a : animations) { String key = a.getName(); - if (key.equals("")) key = "ERROR (" + a.getResource().getResourceId() + ")"; + if (key.equals("")) key = "ERROR (" + a.getResource().getResourceId(model.getGraph().getSession()) + ")"; sorter.put(key, a); } diff --git a/org.simantics.proconf.processeditor/src/org/simantics/processeditor/dialogs/ConfigureMonitorDialog.java b/org.simantics.proconf.processeditor/src/org/simantics/processeditor/dialogs/ConfigureMonitorDialog.java index b1147f4a..c778c0e8 100644 --- a/org.simantics.proconf.processeditor/src/org/simantics/processeditor/dialogs/ConfigureMonitorDialog.java +++ b/org.simantics.proconf.processeditor/src/org/simantics/processeditor/dialogs/ConfigureMonitorDialog.java @@ -126,7 +126,7 @@ public class ConfigureMonitorDialog extends Dialog { for (Resource type : types) { IEntity t = EntityFactory.create(g, type); String key = t.getName(); - if (key.equals("")) key = "ERROR (" + type.getResourceId() + ")"; + if (key.equals("")) key = "ERROR (" + type.getResourceId(g.getSession()) + ")"; sorter.put(key, type); } @@ -198,7 +198,7 @@ public class ConfigureMonitorDialog extends Dialog { for (IEntity model : models) { String key = model.getName(); - if (key.equals("")) key = "ERROR (" + model.getResource().getResourceId() + ")"; + if (key.equals("")) key = "ERROR (" + model.getResource().getResourceId(resource.getGraph().getSession()) + ")"; sorter.put(key, new G3DModel(model)); }