Changeset 529 in josm for trunk/src/org/openstreetmap/josm/data
- Timestamp:
- 2008-01-30T18:02:38+01:00 (16 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/data
- Files:
-
- 1 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/Bounds.java
r298 r529 59 59 max = new LatLon(Math.max(ll.lat(), max.lat()), Math.max(ll.lon(), max.lon())); 60 60 } 61 /** 62 * Is the given point within this bounds? 63 */ 64 public boolean contains(LatLon ll) { 65 if (ll.lat() < min.lat() || ll.lon() < min.lon()) 66 return false; 67 if (ll.lat() > max.lat() || ll.lon() > max.lon()) 68 return false; 69 return true; 70 } 61 71 } -
trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java
r498 r529 4 4 import java.text.ParseException; 5 5 import java.text.SimpleDateFormat; 6 import java.util.ArrayList;7 6 import java.util.Arrays; 8 7 import java.util.Collection; -
trunk/src/org/openstreetmap/josm/data/osm/Way.java
r357 r529 7 7 8 8 import org.openstreetmap.josm.data.osm.visitor.Visitor; 9 import org.openstreetmap.josm.tools.Pair; 9 10 10 11 /** … … 19 20 */ 20 21 public final List<Node> nodes = new ArrayList<Node>(); 22 23 public void visitNodes(Visitor v) { 24 for (Node n : this.nodes) 25 v.visit(n); 26 } 27 28 public ArrayList<Pair<Node,Node>> getNodePairs(boolean sort) { 29 ArrayList<Pair<Node,Node>> chunkSet = new ArrayList<Pair<Node,Node>>(); 30 Node lastN = null; 31 for (Node n : this.nodes) { 32 if (lastN == null) { 33 lastN = n; 34 continue; 35 } 36 Pair<Node,Node> np = new Pair<Node,Node>(lastN, n); 37 if (sort) { 38 Pair.sort(np); 39 } 40 chunkSet.add(np); 41 lastN = n; 42 } 43 return chunkSet; 44 } 45 21 46 22 47 @Override public void visit(Visitor visitor) { -
trunk/src/org/openstreetmap/josm/data/osm/visitor/AllNodesVisitor.java
r343 r529 34 34 */ 35 35 public void visit(Way w) { 36 for (Node n : w.nodes) 37 visit(n); 36 w.visitNodes(this); 38 37 } 39 38 -
trunk/src/org/openstreetmap/josm/data/osm/visitor/BoundingXYVisitor.java
r343 r529 23 23 24 24 public void visit(Way w) { 25 for (Node n : w.nodes) 26 visit(n); 25 w.visitNodes(this); 27 26 } 28 27
Note:
See TracChangeset
for help on using the changeset viewer.