Changeset 27619 in osm for applications/editors/josm/plugins/alignways/src
- Timestamp:
- 2012-01-25T15:46:41+01:00 (13 years ago)
- Location:
- applications/editors/josm/plugins/alignways/src/com/tilusnet/josm/plugins/alignways
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/alignways/src/com/tilusnet/josm/plugins/alignways/AlignWaysCmdKeepAngles.java
r27606 r27619 95 95 // there's no need to update this node 96 96 if (isectPnt != null) { 97 enIsectPt = new EastNorth(isectPnt.getX(), isectPnt.getY()); 98 calculatedNodes.put(endpoint, enIsectPt);97 enIsectPt = new EastNorth(isectPnt.getX(), isectPnt.getY()); 98 // Don't "record" it yet as it may not be valid 99 99 } else if (alignedLineKeepLength.getIntersectionStatus() == IntersectionStatus.LINES_PARALLEL) { 100 100 alignableStatKeepAngles = AlignableStatus.ALGN_INV_ANGLE_PRESERVING_CONFLICT; 101 } 102 103 // TODO - THIS APPROACH IS FAULTY! 104 // 101 return; 102 } 103 105 104 // For the case of two adjacent segments with collinear points, the new endpoint may 106 // not fall between enAdjOther1 and enAdjOther2; in this case one of them is redundant 107 // and should be deleted from OSM 105 // not fall between enAdjOther1 and enAdjOther2; 106 // this scenario is not allowed for the time being as placing the new intersection point on the line 107 // triggers complications. 108 // TODO - find a solution 108 109 if (alws.size() == 2 && enIsectPt != null) { 109 110 int middlePtIdx = AlignWaysGeomPoint.getMiddleOf3( … … 127 128 double eps = 1E-6; 128 129 if (!middlePt.equalsEpsilon(enIsectPt, eps)) { 129 // Intersection point didn't fall between the two adjacent points; something must go 130 // Intersection point didn't fall between the two adjacent points; not allowed 131 alignableStatKeepAngles = AlignableStatus.ALGN_INV_XPOINT_FALLSOUT; 132 return; 133 134 /* 130 135 if (middlePt.equalsEpsilon(enAdjOther1, eps)) { 131 136 // Delete adjOther1 … … 135 140 // Delete adjOther2 136 141 // adjOther2.setDeleted(true); 142 */ 137 143 } 138 144 } 139 145 } 140 146 } 147 148 if (isectPnt != null) { 149 // Angle preserving alignment passed all verification tests: record it. 150 calculatedNodes.put(endpoint, enIsectPt); 151 } 152 141 153 142 154 } else { … … 196 208 + "Either choose the ''keep length'' aligning method or select other segments.\n"); 197 209 break; 210 case ALGN_INV_XPOINT_FALLSOUT: 211 statMsg = tr("An intersection point would fall outside its adjacent nodes.\n" 212 + "This is an unsupported scenario.\n"); 213 break; 198 214 default: 199 215 statMsg = tr("Undocumented problem occured.\n"); -
applications/editors/josm/plugins/alignways/src/com/tilusnet/josm/plugins/alignways/AlignWaysCmdKeepLength.java
r27353 r27619 38 38 ALGN_INV_OUTSIDE_WORLD, 39 39 ALGN_INV_TOOMANY_CONNECTED_WS, // for AlignWaysCmdKeepAngles 40 ALGN_INV_ANGLE_PRESERVING_CONFLICT // for AlignWaysCmdKeepAngles 40 ALGN_INV_ANGLE_PRESERVING_CONFLICT, // for AlignWaysCmdKeepAngles 41 ALGN_INV_XPOINT_FALLSOUT // for AlignWaysCmdKeepAngles 41 42 } 42 43 final AlignWaysAlgnSegment algnSeg;
Note:
See TracChangeset
for help on using the changeset viewer.