From ef28e528f32820afb3e1d53437ecde8e57e8d702 Mon Sep 17 00:00:00 2001 From: nicolas-f Date: Tue, 8 Oct 2024 10:51:42 +0200 Subject: [PATCH] advanced export of projection cones, with reflection order recursive --- .../pathfinder/MirrorReceiverResultIndex.java | 55 +++++++++++-------- 1 file changed, 32 insertions(+), 23 deletions(-) diff --git a/noisemodelling-pathfinder/src/main/java/org/noise_planet/noisemodelling/pathfinder/MirrorReceiverResultIndex.java b/noisemodelling-pathfinder/src/main/java/org/noise_planet/noisemodelling/pathfinder/MirrorReceiverResultIndex.java index 637acc2de..0768a7a27 100644 --- a/noisemodelling-pathfinder/src/main/java/org/noise_planet/noisemodelling/pathfinder/MirrorReceiverResultIndex.java +++ b/noisemodelling-pathfinder/src/main/java/org/noise_planet/noisemodelling/pathfinder/MirrorReceiverResultIndex.java @@ -196,29 +196,38 @@ public void exportVisibility(StringBuilder sb, double maxPropagationDistance, parent = parent.getParentMirror(); } - sb.append("\""); - sb.append(wktWriter.write(visibilityCone)); - sb.append("\",0"); - sb.append(",").append(refIndex); - sb.append(",").append(refOrder); - sb.append(",").append(res.getWall().getOriginId()); - sb.append(",").append(t).append("\n"); - sb.append("\""); - sb.append(wktWriter.write(factory.createPoint(res.getReceiverPos()).buffer(0.1, - 12, BufferParameters.CAP_ROUND))); - sb.append("\",4"); - sb.append(",").append(refIndex); - sb.append(",").append(refOrder); - sb.append(",").append(res.getWall().getOriginId()); - sb.append(",").append(t).append("\n"); - sb.append("\""); - sb.append(wktWriter.write(factory.createLineString(new Coordinate[]{res.getWall().p0, res.getWall().p1}). - buffer(0.05, 8, BufferParameters.CAP_SQUARE))); - sb.append("\",1"); - sb.append(",").append(refIndex); - sb.append(",").append(refOrder); - sb.append(",").append(res.getWall().getOriginId()); - sb.append(",").append(t).append("\n"); + while(res != null) { + sb.append("\""); + sb.append(wktWriter.write(visibilityCone)); + sb.append("\",0"); + sb.append(",").append(refIndex); + sb.append(",").append(refOrder); + sb.append(",").append(res.getWall().getProcessedWallIndex()); + sb.append(",").append(t).append("\n"); + sb.append("\""); + sb.append(wktWriter.write(factory.createPoint(res.getReceiverPos()).buffer(0.1, + 12, BufferParameters.CAP_ROUND))); + sb.append("\",4"); + sb.append(",").append(refIndex); + sb.append(",").append(refOrder); + sb.append(",").append(res.getWall().getProcessedWallIndex()); + sb.append(",").append(t).append("\n"); + sb.append("\""); + sb.append(wktWriter.write(factory.createLineString(new Coordinate[]{res.getWall().p0, res.getWall().p1}). + buffer(0.05, 8, BufferParameters.CAP_SQUARE))); + sb.append("\",1"); + sb.append(",").append(refIndex); + sb.append(",").append(refOrder); + sb.append(",").append(res.getWall().getProcessedWallIndex()); + sb.append(",").append(t).append("\n"); + res = res.getParentMirror(); + if(res != null) { + visibilityCone = MirrorReceiverResultIndex.createWallReflectionVisibilityCone( + res.getReceiverPos(), res.getWall().getLineSegment(), + maxPropagationDistance, maxPropagationDistanceFromWall); + } + refOrder-=1; + } refIndex+=1; } }