From a53b8193ca2ba4c75652bd47f5bfafd556c68b96 Mon Sep 17 00:00:00 2001 From: nicolas-f Date: Tue, 15 Oct 2024 09:29:20 +0200 Subject: [PATCH] rename attribute --- .../pathfinder/ComputeCnossosRays.java | 10 ++++---- .../noisemodelling/pathfinder/PointPath.java | 25 +++++++++++++------ .../EvaluateAttenuationCnossos.java | 2 +- 3 files changed, 24 insertions(+), 13 deletions(-) diff --git a/noisemodelling-pathfinder/src/main/java/org/noise_planet/noisemodelling/pathfinder/ComputeCnossosRays.java b/noisemodelling-pathfinder/src/main/java/org/noise_planet/noisemodelling/pathfinder/ComputeCnossosRays.java index 5d386c1d4..2e5f8a18a 100644 --- a/noisemodelling-pathfinder/src/main/java/org/noise_planet/noisemodelling/pathfinder/ComputeCnossosRays.java +++ b/noisemodelling-pathfinder/src/main/java/org/noise_planet/noisemodelling/pathfinder/ComputeCnossosRays.java @@ -850,12 +850,12 @@ public PropagationPath computeHEdgeDiffraction(ProfileBuilder.CutProfile cutProf pt.bodyBarrier = bodyBarrier; if(pt.buildingId != -1) { pt.alphaWall = data.profileBuilder.getBuilding(pt.buildingId).getAlphas(); - pt.setObstacleAltitude(data.profileBuilder.getBuilding(pt.buildingId).getZ()); + pt.setObstacleZ(data.profileBuilder.getBuilding(pt.buildingId).getZ()); } else if(pt.wallId != -1) { pt.alphaWall = data.profileBuilder.getWall(pt.wallId).getAlphas(); ProfileBuilder.Wall wall = data.profileBuilder.getWall(pt.wallId); - pt.setObstacleAltitude(Vertex.interpolateZ(pt.coordinate, wall.p0, wall.p1)); + pt.setObstacleZ(Vertex.interpolateZ(pt.coordinate, wall.p0, wall.p1)); } } } @@ -1221,11 +1221,11 @@ private void updateReflectionPathAttributes(PointPath reflectionPoint, MirrorRec reflectionPoint.setType(PointPath.POINT_TYPE.REFL); if(mirrorReceiverResult.getType().equals(BUILDING)) { reflectionPoint.setBuildingId(mirrorReceiverResult.getBuildingId()); - reflectionPoint.obstacleAltitude = data.profileBuilder.getBuilding(reflectionPoint.getBuildingId()).getZ(); + reflectionPoint.obstacleZ = data.profileBuilder.getBuilding(reflectionPoint.getBuildingId()).getZ(); reflectionPoint.setAlphaWall(data.profileBuilder.getBuilding(reflectionPoint.getBuildingId()).getAlphas()); } else { ProfileBuilder.Wall wall = mirrorReceiverResult.getWall(); - reflectionPoint.obstacleAltitude = Vertex.interpolateZ(reflectionPoint.coordinate, wall.p0, wall.p1); + reflectionPoint.obstacleZ = Vertex.interpolateZ(reflectionPoint.coordinate, wall.p0, wall.p1); reflectionPoint.setWallId(wall.getProcessedWallIndex()); reflectionPoint.setAlphaWall(wall.getAlphas()); } @@ -1390,7 +1390,7 @@ public List computeReflexion(Coordinate rcvCoord, Coordinate sr // compute Y value (altitude) by interpolating the Y values of the two neighboring points currentPoint.coordinate = new CoordinateXY(p1.x, (p1.x-p0.x)/(p2.x-p0.x)*(p2.y-p0.y)+p0.y); //check if new reflection point altitude is higher than the wall - if (currentPoint.coordinate.y > currentPoint.obstacleAltitude - epsilon) { + if (currentPoint.coordinate.y > currentPoint.obstacleZ - epsilon) { // can't reflect higher than the wall points.clear(); segments.clear(); diff --git a/noisemodelling-pathfinder/src/main/java/org/noise_planet/noisemodelling/pathfinder/PointPath.java b/noisemodelling-pathfinder/src/main/java/org/noise_planet/noisemodelling/pathfinder/PointPath.java index 192a2b166..a02b1b11c 100644 --- a/noisemodelling-pathfinder/src/main/java/org/noise_planet/noisemodelling/pathfinder/PointPath.java +++ b/noisemodelling-pathfinder/src/main/java/org/noise_planet/noisemodelling/pathfinder/PointPath.java @@ -20,12 +20,7 @@ public class PointPath { public int wallId = -1; public double e=0; public Orientation orientation; - - public void setObstacleAltitude(double obstacleAltitude) { - this.obstacleAltitude = obstacleAltitude; - } - - public double obstacleAltitude; // only if POINT_TYPE = REFL + public double obstacleZ; // only if POINT_TYPE = REFL public POINT_TYPE type; // type of point public enum POINT_TYPE { SRCE, @@ -41,8 +36,8 @@ public enum POINT_TYPE { * parameters given by user * @param coordinate * @param altitude - * @param gs * @param alphaWall + * @param buildingId Building identifier -1 if there is no buildings * @param type */ public PointPath(Coordinate coordinate, double altitude, List alphaWall, int buildingId, POINT_TYPE type) { @@ -53,6 +48,22 @@ public PointPath(Coordinate coordinate, double altitude, List alphaWall, this.type = type; } + + /** + * Top obstacle altitude value in meters + * @param obstacleZ + */ + public void setObstacleZ(double obstacleZ) { + this.obstacleZ = obstacleZ; + } + + /** + * @return Top obstacle altitude value in meters + */ + public double getObstacleZ() { + return obstacleZ; + } + /** * parameters given by user * @param coordinate diff --git a/noisemodelling-propagation/src/main/java/org/noise_planet/noisemodelling/propagation/EvaluateAttenuationCnossos.java b/noisemodelling-propagation/src/main/java/org/noise_planet/noisemodelling/propagation/EvaluateAttenuationCnossos.java index 800e8569b..67c30b80b 100644 --- a/noisemodelling-propagation/src/main/java/org/noise_planet/noisemodelling/propagation/EvaluateAttenuationCnossos.java +++ b/noisemodelling-propagation/src/main/java/org/noise_planet/noisemodelling/propagation/EvaluateAttenuationCnossos.java @@ -567,7 +567,7 @@ public static double[] deltaRetrodif(PropagationPath reflect, PropagationProcess //Get the reflexion point PointPath pp = reflect.getPointList().get(idx); //Get the point on the top of the obstacle - Coordinate o = new Coordinate(pp.coordinate.x, pp.obstacleAltitude); + Coordinate o = new Coordinate(pp.coordinate.x, pp.obstacleZ); //Compute de distance delta (2.5.36) double deltaPrime = -(s.distance(o) + o.distance(r) - reflect.getSRSegment().d); double ch = 1.;