From: Reino Ruusu Date: Mon, 2 Mar 2020 11:48:00 +0000 (+0200) Subject: Updates elbows when turn radius is changed in pipe run X-Git-Tag: v1.43.0~52 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F59%2F3959%2F1;p=simantics%2F3d.git Updates elbows when turn radius is changed in pipe run gitlab #95 Change-Id: I9174814d63382f0035cd4705b3d8eb28982de573 --- diff --git a/org.simantics.plant3d/src/org/simantics/plant3d/editor/P3DNodeMap.java b/org.simantics.plant3d/src/org/simantics/plant3d/editor/P3DNodeMap.java index 08ce5a07..00118cfd 100644 --- a/org.simantics.plant3d/src/org/simantics/plant3d/editor/P3DNodeMap.java +++ b/org.simantics.plant3d/src/org/simantics/plant3d/editor/P3DNodeMap.java @@ -76,8 +76,14 @@ public class P3DNodeMap extends AbstractVTKNodeMap { } } } else if (n instanceof PipeRun) { - // FIXME: may require rule based update! PipeRun run = (PipeRun)n; + + // Check for change to turn radii and update turn components + if (ids.contains(Plant3D.URIs.HasTurnRadiusArray) || + ids.contains(Plant3D.URIs.HasTurnRadius)) { + requestTurnUpdates(run); + } + Set ids2 = new HashSet(); ids2.add(Plant3D.URIs.hasGeometry); for (PipeControlPoint pcp : run.getControlPoints()) { @@ -97,6 +103,13 @@ public class P3DNodeMap extends AbstractVTKNodeMap { } } + private void requestTurnUpdates(PipeRun run) { + for (PipeControlPoint pcp : run.getControlPoints()) { + if (pcp.isTurn()) + PipingRules.requestUpdate(pcp); + } + } + private void updateTransform(IP3DNode node) { if (DEBUG) System.out.println("P3DNodeMap update Transform " + debugString(node));