- Timestamp:
- 2009-01-11T18:46:15+01:00 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/visitor/SimplePaintVisitor.java
r1250 r1251 122 122 123 123 public void visitAll(DataSet data, Boolean virtual) { 124 boolean profiler = Main.pref.getBoolean("simplepaint.profiler",false); 125 long profilerStart = java.lang.System.currentTimeMillis(); 126 long profilerLast = profilerStart; 127 int profilerN = 0; 128 if(profiler) 129 System.out.println("Simplepaint Profiler"); 130 124 131 getSettings(virtual); 132 133 if(profiler) 134 { 135 System.out.format("Prepare : %4dms\n", (java.lang.System.currentTimeMillis()-profilerLast)); 136 profilerLast = java.lang.System.currentTimeMillis(); 137 } 138 125 139 // draw tagged ways first, then untagged ways. takes 126 140 // time to iterate through list twice, OTOH does not 127 141 // require changing the colour while painting... 142 profilerN = 0; 128 143 for (final OsmPrimitive osm : data.relations) 129 144 if (!osm.deleted && !osm.selected) 145 { 130 146 osm.visit(this); 131 147 profilerN++; 148 } 149 150 if(profiler) 151 { 152 System.out.format("Relations: %4dms, n=%5d\n", (java.lang.System.currentTimeMillis()-profilerLast), profilerN); 153 profilerLast = java.lang.System.currentTimeMillis(); 154 } 155 156 profilerN = 0; 132 157 for (final OsmPrimitive osm : data.ways) 133 158 if (!osm.deleted && !osm.selected && osm.tagged) 159 { 134 160 osm.visit(this); 161 profilerN++; 162 } 135 163 displaySegments(); 136 164 137 165 for (final OsmPrimitive osm : data.ways) 138 166 if (!osm.deleted && !osm.selected && !osm.tagged) 167 { 139 168 osm.visit(this); 169 profilerN++; 170 } 140 171 displaySegments(); 141 172 173 if(profiler) 174 { 175 System.out.format("Ways : %4dms, n=%5d\n", 176 (java.lang.System.currentTimeMillis()-profilerLast), profilerN); 177 profilerLast = java.lang.System.currentTimeMillis(); 178 } 179 180 profilerN = 0; 142 181 for (final OsmPrimitive osm : data.getSelected()) 143 182 if (!osm.deleted) 183 { 144 184 osm.visit(this); 185 profilerN++; 186 } 145 187 displaySegments(); 146 188 189 if(profiler) 190 { 191 System.out.format("Selected : %4dms, n=%5d\n", (java.lang.System.currentTimeMillis()-profilerLast), profilerN); 192 profilerLast = java.lang.System.currentTimeMillis(); 193 } 194 195 profilerN = 0; 147 196 for (final OsmPrimitive osm : data.nodes) 148 197 if (!osm.deleted && !osm.selected) 198 { 149 199 osm.visit(this); 200 profilerN++; 201 } 202 if(profiler) 203 { 204 System.out.format("Nodes : %4dms, n=%5d\n", 205 (java.lang.System.currentTimeMillis()-profilerLast), profilerN); 206 profilerLast = java.lang.System.currentTimeMillis(); 207 } 208 150 209 if(virtualNodeSize != 0) 151 210 { 211 profilerN = 0; 152 212 currentColor = nodeColor; 153 213 for (final OsmPrimitive osm : data.ways) 154 214 if (!osm.deleted) 155 visitVirtual((Way)osm); 215 { 216 visitVirtual((Way)osm); 217 profilerN++; 218 } 156 219 displaySegments(); 220 221 if(profiler) 222 { 223 System.out.format("Virtual : %4dms, n=%5d\n", (java.lang.System.currentTimeMillis()-profilerLast), profilerN); 224 profilerLast = java.lang.System.currentTimeMillis(); 225 } 226 } 227 228 if(profiler) 229 { 230 System.out.format("All : %4dms\n", (profilerLast-profilerStart)); 157 231 } 158 232 }
Note:
See TracChangeset
for help on using the changeset viewer.