- Timestamp:
- 2010-03-29T21:34:13+02:00 (15 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/data/osm
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/BBox.java
r3153 r3163 46 46 } 47 47 add(coor); 48 } 49 } 50 51 public BBox(Node n) { 52 LatLon coor = n.getCoor(); 53 if (coor == null) { 54 xmin = xmax = ymin = ymax = 0; 55 } else { 56 xmin = xmax = coor.lon(); 57 ymin = ymax = coor.lat(); 48 58 } 49 59 } -
trunk/src/org/openstreetmap/josm/data/osm/DataSet.java
r3147 r3163 767 767 private void reindexNode(Node node) { 768 768 nodes.remove(node); 769 node.updatePosition(); 769 770 nodes.add(node); 770 771 for (OsmPrimitive primitive: node.getReferrers()) { -
trunk/src/org/openstreetmap/josm/data/osm/Node.java
r3159 r3163 15 15 16 16 private CachedLatLon coor; 17 private BBox bbox; 17 18 18 19 public final void setCoor(LatLon coor) { … … 186 187 @Override 187 188 public BBox getBBox() { 188 if (coor == null) 189 return new BBox(0, 0, 0, 0); 190 else 191 return new BBox(coor, coor); 189 if (getDataSet() == null) 190 return new BBox(this); 191 if (bbox == null) { 192 bbox = new BBox(this); 193 } 194 return new BBox(bbox); 192 195 } 193 196 194 197 @Override 195 198 public void updatePosition() { 196 // Do nothing for now, but in future replace CachedLatLon with simple doubles and update precalculated EastNorth value here 199 bbox = new BBox(this); 200 // TODO: replace CachedLatLon with simple doubles and update precalculated EastNorth value here 197 201 } 198 202
Note:
See TracChangeset
for help on using the changeset viewer.