Changeset 30631 in osm for applications/editors/josm/plugins/alignways
- Timestamp:
- 2014-09-14T19:56:42+02:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/alignways/src/com/tilusnet/josm/plugins/alignways/AlignWaysCmdKeepAngles.java
r30345 r30631 19 19 import com.tilusnet.josm.plugins.alignways.geometry.AlignWaysGeomLine.IntersectionStatus; 20 20 import com.tilusnet.josm.plugins.alignways.geometry.AlignWaysGeomPoint; 21 22 21 23 22 /** … … 27 26 public class AlignWaysCmdKeepAngles extends AlignWaysCmdKeepLength { 28 27 29 AlignableStatus alignableStatKeepAngles = AlignableStatus.ALGN_VALID;28 private AlignableStatus alignableStatKeepAngles = AlignableStatus.ALGN_VALID; 30 29 31 30 public AlignWaysCmdKeepAngles() { 32 super();33 34 31 // Now the calculatedNodes reflect the coordinates that we'd have 35 32 // without preserving the angles, i.e. preserving the length. … … 48 45 recalculateNodesAndValidate(lineKeepLength, nodeArr[0]); 49 46 recalculateNodesAndValidate(lineKeepLength, nodeArr[1]); 50 51 } 52 53 54 void recalculateNodesAndValidate(AlignWaysGeomLine alignedLineKeepLength, Node endpoint) { 47 } 48 49 private void recalculateNodesAndValidate(AlignWaysGeomLine alignedLineKeepLength, Node endpoint) { 55 50 56 51 if (endpoint.getEastNorth().equals(pivot)) { … … 60 55 61 56 ArrayList<WaySegment> alws = algnSeg.getAdjacentWaySegments(endpoint); 62 if (alws.size() <= 2) { 57 int alwsSize = alws.size(); 58 if (0 < alwsSize && alwsSize <= 2) { 63 59 // We need the intersection point of 64 60 // - the alignee following the keep length rule … … 70 66 EastNorth enAdjOther2 = null; 71 67 72 if (alws .size()== 2) {68 if (alwsSize == 2) { 73 69 adjOther2 = getNonEqualNode(alws.get(1), endpoint); 74 70 enAdjOther2 = adjOther2.getEastNorth(); … … 106 102 // triggers complications. 107 103 // TODO - find a solution 108 if (alws .size()== 2 && enIsectPt != null) {104 if (alwsSize == 2 && enIsectPt != null) { 109 105 int middlePtIdx = AlignWaysGeomPoint.getMiddleOf3( 110 106 new AlignWaysGeomPoint(enIsectPt), … … 155 151 alignableStatKeepAngles = AlignableStatus.ALGN_INV_TOOMANY_CONNECTED_WS; 156 152 } 157 158 } 159 153 } 160 154 161 155 private boolean isEnSetCollinear(ArrayList<EastNorth> enAdjPts) { … … 169 163 return AlignWaysGeomPoint.isSetCollinear(awAdjPts); 170 164 } 171 172 165 173 166 private Node getNonEqualNode(WaySegment waySegment, Node endpoint) { … … 179 172 return null; 180 173 } 181 182 174 183 175 /** … … 222 214 JOptionPane.WARNING_MESSAGE 223 215 ); 224 225 } 226 216 } 227 217 228 218 /**
Note:
See TracChangeset
for help on using the changeset viewer.