]> gerrit.simantics Code Review - simantics/3d.git/blobdiff - org.simantics.plant3d/src/org/simantics/plant3d/utils/P3DUtil.java
Showing error messages when components overlap each other
[simantics/3d.git] / org.simantics.plant3d / src / org / simantics / plant3d / utils / P3DUtil.java
index 65b93cffd2688102500fb30a0b67dce44949c87f..055ffa11df29a5f388b9eea4e67089862247b40a 100644 (file)
@@ -69,7 +69,7 @@ public class P3DUtil {
                
                @Override
                public List<Item> perform(ReadGraph graph) throws DatabaseException {
-                       Resource project = Simantics.getProject().get();
+//                     Resource project = Simantics.getProject().get();
                        Resource builtins = graph.getResource(libUri);
                        List<Item> actions = new ArrayList<>();
 //                     actions.addAll(getItems(graph, project,type));
@@ -207,8 +207,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 +253,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();
+    }
 
 }