]> gerrit.simantics Code Review - simantics/3d.git/commitdiff
Removing components left orphan piperuns in the plant 06/3506/1
authorMarko Luukkainen <marko.luukkainen@semantum.fi>
Tue, 12 Nov 2019 13:34:48 +0000 (15:34 +0200)
committerMarko Luukkainen <marko.luukkainen@semantum.fi>
Tue, 12 Nov 2019 13:34:48 +0000 (15:34 +0200)
gitlab #35

Change-Id: I428a58bf4e817816f2bb02d00186b41fa40a0527

org.simantics.plant3d/src/org/simantics/plant3d/scenegraph/controlpoint/PipeControlPoint.java
org.simantics.plant3d/src/org/simantics/plant3d/scenegraph/controlpoint/PipingRules.java

index 491a273331a36ec8a0392122c92dc8833c6bbfb6..20386b5408c11ca4477e4fb6a67a4bb4e4209ff5 100644 (file)
@@ -1079,6 +1079,7 @@ public class PipeControlPoint extends G3DNode implements IP3DNode {
                        if (currentNext == null && currentPrev == null) {
                                removeComponent();
                                pipeRun.remChild(this);
+                               checkRemove(pipeRun);
                                return;
                        }
                        if (currentNext != null && currentPrev != null) {
@@ -1350,6 +1351,8 @@ public class PipeControlPoint extends G3DNode implements IP3DNode {
                                pcp._remove(); // This call will recursively call also this method...
                                return true;
                        }
+               } else if (points.size() == 2) {
+                   
                }
                return false;
        }
index 3094f7d20651527c8ca1728a7760a3b4187ce2d5..3ab4cca46892795d3f3931b1b00a651a5f0518a3 100644 (file)
@@ -1671,7 +1671,11 @@ public class PipingRules {
                        pcps.add(points);
                        PipeControlPoint pcp = points.get(points.size()-1);
                        if (pcp.getChildPoints().size() > 0) {
-                               pipeRun = pcp.getChildPoints().get(0).getPipeRun();
+                               PipeRun pipeRun2 = pcp.getChildPoints().get(0).getPipeRun();
+                               if (pipeRun == pipeRun2)
+                                   break;
+                               else
+                                   pipeRun = pipeRun2;
                        } else {
                                break;
                        }