]> gerrit.simantics Code Review - simantics/3d.git/blobdiff - org.simantics.plant3d/src/org/simantics/plant3d/utils/P3DUtil.java
Added labels to piping component types
[simantics/3d.git] / org.simantics.plant3d / src / org / simantics / plant3d / utils / P3DUtil.java
index 55cfead45ea55259972c62eaf65592e62b98006a..ab795acc23e413d48a298631e366d680f03d37c3 100644 (file)
@@ -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))
@@ -211,6 +212,8 @@ public class P3DUtil {
                    item.setModifiable(true);
                if (graph.hasStatement(r, p3d.SizeChangeComponent))
                        item.setSizeChange(true);
+               if (graph.hasStatement(r, p3d.RotateComponent))
+            item.setRotated(true);
                return item;
        }
        
@@ -251,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();
+    }
 
 }