Skip to content

Commit

Permalink
fetch ground coefficient
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-f committed Oct 17, 2024
1 parent 4174cef commit 3241a17
Show file tree
Hide file tree
Showing 5 changed files with 108 additions and 187 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public class Scene {
public static final double DEFAULT_RECEIVER_DIST = 1.0;
public static final double DEFAULT_GS = 0.0;
public static final double DEFAULT_G = 0.0;
public static final double DEFAULT_G_BUILDING = 0.0;
public static final String YAW_DATABASE_FIELD = "YAW";
public static final String PITCH_DATABASE_FIELD = "PITCH";
public static final String ROLL_DATABASE_FIELD = "ROLL";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,24 @@

public class CutPoint implements Comparable<CutPoint> {
/** {@link Coordinate} of the cut point. */
Coordinate coordinate;
Coordinate coordinate = new Coordinate();
/** Intersection type. */
ProfileBuilder.IntersectionType type;
/** Identifier of the cut element. */
int id;
int id = -1;
/** Identifier of the building containing the point. -1 if no building. */
int buildingId;
int buildingId = -1;
/** Identifier of the wall containing the point. -1 if no wall. */
int wallId;
int wallId = -1;
/** Height of the building containing the point. NaN of no building. */
double height;
double height = Double.NaN;
/** Topographic height of the point. */
double zGround = Double.NaN;
/** Ground effect coefficient. 0 if there is no coefficient. */
double groundCoef;
double groundCoef = Double.NaN;
/** Wall alpha. NaN if there is no coefficient. */
List<Double> wallAlpha = Collections.emptyList();
boolean corner;
boolean corner = false; //todo with horizontal plane diffraction rework: remove, replace with intersection type-> DIFFRACTION_POINT

/**
* Constructor using a {@link Coordinate}.
Expand All @@ -44,22 +44,16 @@ public class CutPoint implements Comparable<CutPoint> {
* @param id Identifier of the cut element.
*/
public CutPoint(Coordinate coord, ProfileBuilder.IntersectionType type, int id, boolean corner) {
this.coordinate = new Coordinate(coord.x, coord.y, coord.z);
this.coordinate = new Coordinate(coord);
this.type = type;
this.id = id;
this.buildingId = -1;
this.wallId = -1;
this.groundCoef = 0;
this.wallAlpha = new ArrayList<>();
this.height = 0;
this.corner = corner;
}
public CutPoint(Coordinate coord, ProfileBuilder.IntersectionType type, int id) {
this(coord, type, id, false);
}

public CutPoint() {
coordinate = new Coordinate();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,20 +110,23 @@ public void addTopoCutPt(Coordinate coord, int id) {

/**
* In order to reduce the number of reallocation, reserve the provided points size
* @param numberOfPointsToBePushed
* @param numberOfPointsToBePushed Number of items to preallocate
*/
public void reservePoints(int numberOfPointsToBePushed) {
pts.ensureCapacity(pts.size() + numberOfPointsToBePushed);
}

/**
* Add a ground effect cutting point.
* @param coord Coordinate of the cutting point.
* @param coordinate Coordinate of the cutting point.
* @param id Id of the cut topography.
*/
public void addGroundCutPt(Coordinate coord, int id) {
pts.add(new CutPoint(coord, ProfileBuilder.IntersectionType.GROUND_EFFECT, id));
public CutPoint addGroundCutPt(Coordinate coordinate, int id, double groundCoefficient) {
CutPoint pt = new CutPoint(coordinate, ProfileBuilder.IntersectionType.GROUND_EFFECT, id);
pt.setGroundCoef(groundCoefficient);
pts.add(pt);
hasGroundEffectInter = true;
return pt;
}

/**
Expand Down
Loading

0 comments on commit 3241a17

Please sign in to comment.