Changeset 2587 in josm for trunk/src/org/openstreetmap/josm/data
- Timestamp:
- 2009-12-06T14:43:18+01: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/DataSetMerger.java
r2578 r2587 150 150 if (n.isIncomplete()) return; 151 151 } 152 myWay.set Incomplete(false);152 myWay.setHasIncompleteNodes(false); 153 153 } 154 154 … … 168 168 throw new RuntimeException(tr("Missing merge target for node with id {0}", other.getUniqueId())); 169 169 if (myNode.isIncomplete() || myNode.isDeleted() || !myNode.isVisible()) return; 170 wayloop: for (Way w: OsmPrimitive.getFilteredList(myNode.getReferrers(), Way.class)) { 171 if (w.isDeleted() || ! w.isVisible() || ! w.isIncomplete()) { 172 continue; 173 } 174 for (Node n: w.getNodes()) { 175 if (n.isIncomplete()) { 176 continue wayloop; 170 171 wayloop: 172 for (Way w: OsmPrimitive.getFilteredList(myNode.getReferrers(), Way.class)) { 173 if (w.isDeleted() || ! w.isVisible() || ! w.isIncomplete()) { 174 continue; 177 175 } 178 } 179 // all nodes are complete - set the way complete too 180 w.setIncomplete(false); 181 } 176 for (Node n: w.getNodes()) { 177 if (n.isIncomplete()) { 178 continue wayloop; 179 } 180 } 181 // all nodes are complete - set the way complete too 182 w.setHasIncompleteNodes(false); 183 } 182 184 } 183 185 -
trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java
r2583 r2587 1155 1155 } 1156 1156 1157 //TODO This method should not be necessary, incomplete state should be handled internally by OsmPrimitive 1157 1158 public void setIncomplete(boolean incomplete) { 1158 1159 this.incomplete = incomplete; -
trunk/src/org/openstreetmap/josm/data/osm/Way.java
r2578 r2587 26 26 private Node[] nodes = new Node[0]; 27 27 private BBox bbox; 28 private boolean hasIncompleteNodes; 28 29 29 30 /** … … 375 376 bbox = new BBox(this); 376 377 } 378 379 //TODO This method should not be necessary. hasIncomplete state should be updated automatically when incomplete state of nodes change 380 public void setHasIncompleteNodes(boolean hasIncompleteNodes) { 381 this.hasIncompleteNodes = hasIncompleteNodes; 382 } 383 384 public boolean hasIncompleteNodes() { 385 return hasIncompleteNodes; 386 } 387 388 @Override 389 public boolean isUsable() { 390 return super.isUsable() && !hasIncompleteNodes(); 391 } 377 392 }
Note:
See TracChangeset
for help on using the changeset viewer.