Skip to content

Commit

Permalink
rename attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-f committed Oct 15, 2024
1 parent 041385c commit a53b819
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
}
}
Expand Down Expand Up @@ -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());
}
Expand Down Expand Up @@ -1390,7 +1390,7 @@ public List<PropagationPath> 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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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<Double> alphaWall, int buildingId, POINT_TYPE type) {
Expand All @@ -53,6 +48,22 @@ public PointPath(Coordinate coordinate, double altitude, List<Double> 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.;
Expand Down

0 comments on commit a53b819

Please sign in to comment.