Changeset 3126 in josm for trunk


Ignore:
Timestamp:
2010-03-12T21:23:58+01:00 (10 years ago)
Author:
jttt
Message:

Use QuadBuckets in SimplePaintVisitor

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/SimplePaintVisitor.java

    r3116 r3126  
    1818import org.openstreetmap.josm.Main;
    1919import org.openstreetmap.josm.data.Bounds;
     20import org.openstreetmap.josm.data.osm.BBox;
    2021import org.openstreetmap.josm.data.osm.DataSet;
    2122import org.openstreetmap.josm.data.osm.Node;
     
    121122    DataSet ds;
    122123    public void visitAll(DataSet data, boolean virtual, Bounds bounds) {
     124        BBox bbox = new BBox(bounds);
    123125        this.ds = data;
    124126        //boolean profiler = Main.pref.getBoolean("simplepaint.profiler",false);
     
    141143           require changing the colour while painting... */
    142144        //profilerN = 0;
    143         for (final OsmPrimitive osm: data.getRelations()) {
     145        for (final OsmPrimitive osm: data.searchRelations(bbox)) {
    144146            if (!osm.isDeleted() && !ds.isSelected(osm) && !osm.isFiltered()) {
    145147                osm.visit(this);
     
    155157
    156158        //profilerN = 0;
    157         for (final OsmPrimitive osm:data.getWays()){
     159        for (final OsmPrimitive osm:data.searchWays(bbox)){
    158160            if (!osm.isDeleted() && !ds.isSelected(osm) && !osm.isFiltered() && osm.isTagged()) {
    159161                osm.visit(this);
     
    163165        displaySegments();
    164166
    165         for (final OsmPrimitive osm:data.getWays()){
     167        for (final OsmPrimitive osm:data.searchWays(bbox)){
    166168            if (!osm.isDeleted() && !ds.isSelected(osm) && !osm.isFiltered() && !osm.isTagged()) {
    167169                osm.visit(this);
     
    193195
    194196        //profilerN = 0;
    195         for (final OsmPrimitive osm: data.getNodes()) {
     197        for (final OsmPrimitive osm: data.searchNodes(bbox)) {
    196198            if (!osm.isDeleted() && !ds.isSelected(osm) && !osm.isFiltered())
    197199            {
     
    208210        //}
    209211
    210         drawVirtualNodes(data.getWays());
     212        drawVirtualNodes(data.searchWays(bbox));
    211213
    212214        //if(profiler)
Note: See TracChangeset for help on using the changeset viewer.