Changeset 18922 in osm for applications/editors/josm/plugins/osmarender/src/org/openstreetmap
- Timestamp:
- 2009-12-03T20:56:33+01:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/osmarender/src/org/openstreetmap/josm/plugins/osmarender/OsmarenderPlugin.java
r18480 r18922 11 11 import java.io.PrintWriter; 12 12 import java.util.HashSet; 13 import java.util.Set; 13 14 14 15 import javax.swing.JLabel; … … 25 26 import org.openstreetmap.josm.data.osm.OsmPrimitive; 26 27 import org.openstreetmap.josm.data.osm.Way; 27 import org.openstreetmap.josm.data.osm.visitor.CollectBackReferencesVisitor;28 28 import org.openstreetmap.josm.gui.MainMenu; 29 29 import org.openstreetmap.josm.gui.MapFrame; … … 54 54 } 55 55 56 CollectBackReferencesVisitor backRefsV = new CollectBackReferencesVisitor(Main.main.getCurrentDataSet(), true);56 Set<OsmPrimitive> parents = new HashSet<OsmPrimitive>(); 57 57 DataSet fromDataSet = new DataSet(); 58 58 for (Node n : Main.main.getCurrentDataSet().getNodes()) { 59 59 if (n.isUsable() && n.getCoor().isWithin(b)) { 60 60 fromDataSet.addPrimitive(n); 61 n.visit(backRefsV);61 parents.addAll(n.getReferrers()); 62 62 } 63 63 } 64 for (OsmPrimitive p : new HashSet<OsmPrimitive>( backRefsV.getData())) {64 for (OsmPrimitive p : new HashSet<OsmPrimitive>(parents)) { 65 65 if (p instanceof Way) { 66 66 for (Node n : ((Way) p).getNodes()) { 67 67 if (n.getCoor().isWithin(b)) 68 backRefsV.getData().add(n);68 parents.add(n); 69 69 } 70 70 } 71 71 } 72 for (OsmPrimitive p : backRefsV.getData())72 for (OsmPrimitive p : parents) 73 73 fromDataSet.addPrimitive(p); 74 74
Note:
See TracChangeset
for help on using the changeset viewer.