X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=org.simantics.plant3d%2Fsrc%2Forg%2Fsimantics%2Fplant3d%2Futils%2FP3DUtil.java;h=ab795acc23e413d48a298631e366d680f03d37c3;hb=b402711239498596d7dfada0c66bc6627e37e7e6;hp=65b93cffd2688102500fb30a0b67dce44949c87f;hpb=dad2672f12421f28805df9d97acf20d0a8efe71f;p=simantics%2F3d.git diff --git a/org.simantics.plant3d/src/org/simantics/plant3d/utils/P3DUtil.java b/org.simantics.plant3d/src/org/simantics/plant3d/utils/P3DUtil.java index 65b93cff..ab795acc 100644 --- a/org.simantics.plant3d/src/org/simantics/plant3d/utils/P3DUtil.java +++ b/org.simantics.plant3d/src/org/simantics/plant3d/utils/P3DUtil.java @@ -69,7 +69,7 @@ public class P3DUtil { @Override public List perform(ReadGraph graph) throws DatabaseException { - Resource project = Simantics.getProject().get(); +// Resource project = Simantics.getProject().get(); Resource builtins = graph.getResource(libUri); List actions = new ArrayList<>(); // actions.addAll(getItems(graph, project,type)); @@ -188,7 +188,8 @@ public class P3DUtil { Plant3D p3d = Plant3D.getInstance(graph); String name = graph.getRelatedValue(r, l0.HasName); String uri = graph.getURI(r); - Item item = new Item(uri, name); + String label = graph.getPossibleRelatedValue(r, l0.HasLabel); + Item item = new Item(uri, name, label); if (graph.isInstanceOf(r, p3d.Equipment)) item.setType(Type.EQUIPMENT); else if (graph.isInstanceOf(r, p3d.InlineComponent)) @@ -207,8 +208,12 @@ public class P3DUtil { if (graph.hasStatement(r, p3d.VariableAngleTurnComponent) || graph.hasStatement(r, p3d.VariableLengthInlineComponent)) item.setVariable(true); + if (graph.hasStatement(r, p3d.AdjustableLengthInlineComponent)) + item.setModifiable(true); if (graph.hasStatement(r, p3d.SizeChangeComponent)) item.setSizeChange(true); + if (graph.hasStatement(r, p3d.RotateComponent)) + item.setRotated(true); return item; } @@ -249,16 +254,17 @@ public class P3DUtil { } } - public static void finalizeDBLoad2(P3DRootNode rootNode) throws Exception{ - PipingRules.setEnabled(true); + public static void finalizeDBLoad2(P3DRootNode rootNode) throws Exception { + PipingRules.setEnabled(true); for (INode node : rootNode.getChild()) { if (node instanceof PipeRun) { - PipeRun run = (PipeRun)node; + PipeRun run = (PipeRun) node; for (PipeControlPoint pcp : run.getControlPoints()) - PipingRules.positionUpdate(pcp); - //PipingRules.requestUpdate(pcp); + if (pcp.asPathLegEnd()) + PipingRules.requestUpdate(pcp); } } - } + PipingRules.update(); + } }