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
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
\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
}\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
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
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
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
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