Changeset 3209 in josm
- Timestamp:
- 2010-04-26T14:52:40+02:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/BBox.java
r3163 r3209 78 78 } 79 79 80 /** 81 * Extends this bbox to include the point (x, y) 82 */ 80 83 public void add(double x, double y) { 81 84 xmin = Math.min(xmin, x); … … 105 108 } 106 109 110 /** 111 * Tests, weather the bbox b lies completely inside 112 * this bbox. 113 */ 107 114 public boolean bounds(BBox b) { 108 115 if (!(xmin <= b.xmin) || … … 114 121 } 115 122 123 /** 124 * Tests, weather the Point c lies within the bbox. 125 */ 116 126 public boolean bounds(LatLon c) { 117 127 if ((xmin <= c.lon()) && … … 123 133 } 124 134 125 public boolean inside(BBox b) { 135 /** 136 * Tests, weather two BBoxes intersect as an area. 137 * I.e. weather there exists a point that lies in both of them. 138 */ 139 public boolean intersects(BBox b) { 126 140 if (xmin > b.xmax) 127 141 return false; … … 135 149 } 136 150 137 public boolean intersects(BBox b) { 138 return this.inside(b) || b.inside(this); 139 } 140 151 /** 152 * Returns a list of all 4 corners of the bbox rectangle. 153 */ 141 154 public List<LatLon> points() { 142 155 LatLon p1 = new LatLon(ymin, xmin);
Note:
See TracChangeset
for help on using the changeset viewer.