Changeset 27606 in osm for applications/editors/josm/plugins/alignways/src
- Timestamp:
- 2012-01-23T20:25:52+01:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/alignways/src/com/tilusnet/josm/plugins/alignways/AlignWaysCmdKeepAngles.java
r27588 r27606 66 66 // - the adjacent way segment 67 67 68 EastNorth enAdjOther1 = getNonEqualEN(alws.get(0), endpoint); 68 Node adjOther1 = getNonEqualNode(alws.get(0), endpoint); 69 EastNorth enAdjOther1 = adjOther1.getEastNorth(); 70 Node adjOther2 = null; 69 71 EastNorth enAdjOther2 = null; 70 72 71 73 if (alws.size() == 2) { 72 enAdjOther2 = getNonEqualEN(alws.get(1), endpoint); 74 adjOther2 = getNonEqualNode(alws.get(1), endpoint); 75 enAdjOther2 = adjOther2.getEastNorth(); 73 76 74 77 // In order have a chance to align, (enAdjOther1, enAdjOther2 and endpoint) must be collinear … … 98 101 } 99 102 103 // TODO - THIS APPROACH IS FAULTY! 104 // 100 105 // For the case of two adjacent segments with collinear points, the new endpoint may 101 106 // not fall between enAdjOther1 and enAdjOther2; in this case one of them is redundant … … 124 129 // Intersection point didn't fall between the two adjacent points; something must go 125 130 if (middlePt.equalsEpsilon(enAdjOther1, eps)) { 126 // TODO Delete enAdjOther1 131 // Delete adjOther1 132 // adjOther1.setDeleted(true); 133 } else 127 134 if (true); 128 // Main.map. 129 } else 130 // TODO Delete enAdjOther2 131 if (true); 135 // Delete adjOther2 136 // adjOther2.setDeleted(true); 132 137 } 133 138 } … … 155 160 156 161 157 private EastNorth getNonEqualEN(WaySegment waySegment, Node endpoint) {162 private Node getNonEqualNode(WaySegment waySegment, Node endpoint) { 158 163 if (waySegment.getFirstNode().equals(endpoint)) { 159 return waySegment.getSecondNode() .getEastNorth();164 return waySegment.getSecondNode(); 160 165 } else if (waySegment.getSecondNode().equals(endpoint)) { 161 return waySegment.getFirstNode() .getEastNorth();166 return waySegment.getFirstNode(); 162 167 } else 163 168 return null;
Note:
See TracChangeset
for help on using the changeset viewer.