Changeset 35978 in osm for applications/editors/josm/plugins/indoor_sweepline
- Timestamp:
- 2022-06-15T20:10:48+02:00 (3 years ago)
- Location:
- applications/editors/josm/plugins/indoor_sweepline/src/indoor_sweepline
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/indoor_sweepline/src/indoor_sweepline/CorridorGeography.java
r32601 r35978 4 4 import java.util.Vector; 5 5 6 import org.openstreetmap.josm.data.coor.ILatLon; 6 7 import org.openstreetmap.josm.data.coor.LatLon; 7 8 import org.openstreetmap.josm.data.osm.DataSet; … … 17 18 private static final double MIN_LENGTH = 10.; 18 19 19 private void setExtraElements(CorridorPart.ReachableSide side, LatLon from, LatLon to, 20 private void setExtraElements(CorridorPart.ReachableSide side, ILatLon from, ILatLon to, 20 21 boolean extraWayUp, double minLength) { 21 22 LatLon middleCoor = new LatLon((from.lat() + to.lat())/2., … … 27 28 middleNode.setCoor(middleCoor); 28 29 29 LatLon start = from; 30 ILatLon start = from; 30 31 if (side == CorridorPart.ReachableSide.LEFT) { 31 32 if (middleCoor.lat() < start.lat()) … … 71 72 72 73 public void appendNodes(CorridorPart.Type type, CorridorPart.ReachableSide side, String level, 73 LatLon from, LatLon to, ModelGeography target) { 74 ILatLon from, ILatLon to, ModelGeography target) { 74 75 if (type == CorridorPart.Type.STAIRS_UP || type == CorridorPart.Type.STAIRS_DOWN) { 75 76 setExtraElements(side, from, to, type == CorridorPart.Type.STAIRS_UP, MIN_LENGTH); -
applications/editors/josm/plugins/indoor_sweepline/src/indoor_sweepline/ModelGeography.java
r32601 r35978 85 85 86 86 public void finishWay(Strip strip, int partIndex, boolean isOuter, String level) { 87 if ( nodes.size() > 0) {87 if (!nodes.isEmpty()) { 88 88 CorridorPart part = strip.partAt(partIndex); 89 89 strip.geographyAt(partIndex).appendNodes(part.getType(), part.getSide(), level, 90 nodes.elementAt(nodes.size()-1) .getCoor(), nodes.elementAt(0).getCoor(), this);90 nodes.elementAt(nodes.size()-1), nodes.elementAt(0), this); 91 91 nodes.add(nodes.elementAt(0)); 92 92 } … … 98 98 public void appendCorridorPart(CorridorPart part, CorridorGeography partGeography, int beamIndex, int partIndex, 99 99 String level) { 100 if ( nodes.size() > 0)100 if (!nodes.isEmpty()) 101 101 partGeography.appendNodes(part.getType(), part.getSide(), level, 102 nodes.elementAt(nodes.size()-1) .getCoor(),102 nodes.elementAt(nodes.size()-1), 103 103 beamsGeography.elementAt(beamIndex).coorAt(partIndex), this); 104 104 } … … 113 113 0, strip.width / 2.)); 114 114 115 if ( nodes.size() > 0) {115 if (!nodes.isEmpty()) { 116 116 CorridorPart part = strip.partAt(partIndex); 117 117 strip.geographyAt(partIndex).appendNodes(part.getType(), part.getSide(), level, 118 nodes.elementAt(nodes.size()-1) .getCoor(), nodePool.elementAt(nodePoolCount).getCoor(), this);118 nodes.elementAt(nodes.size()-1), nodePool.elementAt(nodePoolCount), this); 119 119 } 120 120 nodes.add(nodePool.elementAt(nodePoolCount)); … … 183 183 private void adjustMultipolygonRelation(IndoorSweeplineModel.Type type, String level) { 184 184 if (members.size() > 1) { 185 if (wayPool. size() > 0)185 if (!wayPool.isEmpty()) 186 186 wayPool.elementAt(0).removeAll(); 187 187
Note:
See TracChangeset
for help on using the changeset viewer.