From 2e21d035669963833b326586654f280b8e7f3ef4 Mon Sep 17 00:00:00 2001 From: Reino Ruusu Date: Mon, 2 Mar 2020 13:48:00 +0200 Subject: [PATCH] Updates elbows when turn radius is changed in pipe run gitlab #95 Change-Id: I9174814d63382f0035cd4705b3d8eb28982de573 --- .../org/simantics/plant3d/editor/P3DNodeMap.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) 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)); -- 2.47.1