Changeset 29535 in osm for applications/editors/josm/plugins/reltoolbox/src/relcontext/actions/TheRing.java
- Timestamp:
- 2013-04-23T13:43:26+02:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/reltoolbox/src/relcontext/actions/TheRing.java
r29459 r29535 1 1 package relcontext.actions; 2 2 3 import java.util.*; 3 import java.util.ArrayList; 4 import java.util.Collection; 5 import java.util.HashMap; 6 import java.util.List; 7 import java.util.Map; 8 4 9 import javax.swing.JOptionPane; 10 5 11 import org.openstreetmap.josm.Main; 6 import org.openstreetmap.josm.command.*; 7 import org.openstreetmap.josm.data.coor.EastNorth; 8 import org.openstreetmap.josm.data.osm.*; 12 import org.openstreetmap.josm.command.AddCommand; 13 import org.openstreetmap.josm.command.ChangeCommand; 14 import org.openstreetmap.josm.command.Command; 15 import org.openstreetmap.josm.command.DeleteCommand; 16 import org.openstreetmap.josm.data.osm.Node; 17 import org.openstreetmap.josm.data.osm.OsmPrimitive; 18 import org.openstreetmap.josm.data.osm.Relation; 19 import org.openstreetmap.josm.data.osm.RelationMember; 20 import org.openstreetmap.josm.data.osm.Way; 9 21 import org.openstreetmap.josm.tools.Geometry; 10 22 import org.openstreetmap.josm.tools.Geometry.PolygonIntersection; … … 326 338 } 327 339 } 328 // todo: когда два кольца меняют одно и то же отношение, в список команд добавляется329 // изменение базового отношения на новое, а не предыдущего330 // поэтому сохраняется только первое изменение340 // todo: когда два кольца менÑ�ÑŽÑ‚ одно и то же отношение, в Ñ�пиÑ�ок команд добавлÑ�етÑ�Ñ� 341 // изменение базового отношениÑ� на новое, а не предыдущего 342 // поÑ�тому Ñ�охранÑ�етÑ�Ñ� только первое изменение 331 343 332 344 List<Command> commands = new ArrayList<Command>(); … … 389 401 * Appends "append" to "base" so the closed polygon forms. 390 402 */ 391 private static void closePolygon( List<Node> base, List<Node> append ) { 403 /*private static void closePolygon( List<Node> base, List<Node> append ) { 392 404 if( append.get(0).equals(base.get(0)) && append.get(append.size() - 1).equals(base.get(base.size() - 1)) ) { 393 405 List<Node> ap2 = new ArrayList<Node>(append); … … 397 409 base.remove(base.size() - 1); 398 410 base.addAll(append); 399 } 411 }*/ 400 412 401 413 /** 402 414 * Checks if a middle point between two nodes is inside a polygon. Useful to check if the way is inside. 403 415 */ 404 private static boolean segmentInsidePolygon( Node n1, Node n2, List<Node> polygon ) { 416 /*private static boolean segmentInsidePolygon( Node n1, Node n2, List<Node> polygon ) { 405 417 EastNorth en1 = n1.getEastNorth(); 406 418 EastNorth en2 = n2.getEastNorth(); 407 419 Node testNode = new Node(new EastNorth((en1.east() + en2.east()) / 2.0, (en1.north() + en2.north()) / 2.0)); 408 420 return Geometry.nodeInsidePolygon(testNode, polygon); 409 } 421 }*/ 410 422 411 423 private static void log( String s ) { … … 420 432 private boolean isRing; 421 433 422 private RingSegment() { 423 } 434 /*private RingSegment() { 435 }*/ 424 436 425 437 public RingSegment( Way w ) { … … 435 447 } 436 448 437 public RingSegment( RingSegment ref ) { 449 /*public RingSegment( RingSegment ref ) { 438 450 this.nodes = null; 439 451 this.references = ref; 440 } 452 }*/ 441 453 442 454 /** … … 559 571 * @return true if ways are equals, or one references another. 560 572 */ 561 public boolean isReferencingEqual( RingSegment other ) { 573 /*public boolean isReferencingEqual( RingSegment other ) { 562 574 return this.equals(other) || (other.isReference() && other.references == this) || (isReference() && references == other); 563 } 575 }*/ 564 576 565 577 @Override
Note:
See TracChangeset
for help on using the changeset viewer.
