Changeset 13670 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2018-04-23T23:13:03+02:00 (7 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/OrthogonalizeAction.java
r13434 r13670 188 188 * @return a rectifying command 189 189 * @throws InvalidUserInputException if the selection is invalid 190 */ 191 static SequenceCommand orthogonalize(Iterable<OsmPrimitive> selection) throws InvalidUserInputException { 190 * @since 13670 191 */ 192 public static SequenceCommand orthogonalize(Iterable<OsmPrimitive> selection) throws InvalidUserInputException { 192 193 final List<Node> nodeList = new ArrayList<>(); 193 194 final List<WayData> wayDataList = new ArrayList<>(); … … 619 620 /** 620 621 * Exception: unsuited user input 621 */ 622 protected static class InvalidUserInputException extends Exception { 622 * @since 13670 623 */ 624 public static final class InvalidUserInputException extends Exception { 623 625 InvalidUserInputException(String message) { 624 626 super(message); -
trunk/src/org/openstreetmap/josm/data/osm/Way.java
r13665 r13670 16 16 import org.openstreetmap.josm.spi.preferences.Config; 17 17 import org.openstreetmap.josm.tools.CopyList; 18 import org.openstreetmap.josm.tools.Geometry; 18 19 import org.openstreetmap.josm.tools.Pair; 19 20 import org.openstreetmap.josm.tools.Utils; … … 780 781 } 781 782 } 783 784 /** 785 * Returns angles of vertices. 786 * @return angles of the way 787 * @since 13670 788 */ 789 public synchronized List<Pair<Double, Node>> getAngles() { 790 List<Pair<Double, Node>> angles = new ArrayList<>(); 791 792 for (int i = 1; i < nodes.length - 1; i++) { 793 Node n0 = nodes[i - 1]; 794 Node n1 = nodes[i]; 795 Node n2 = nodes[i + 1]; 796 797 double angle = Geometry.getNormalizedAngleInDegrees(Geometry.getCornerAngle( 798 n0.getEastNorth(), n1.getEastNorth(), n2.getEastNorth())); 799 angles.add(new Pair<>(angle, n1)); 800 } 801 802 angles.add(new Pair<>(Geometry.getNormalizedAngleInDegrees(Geometry.getCornerAngle( 803 nodes[nodes.length - 2].getEastNorth(), 804 nodes[0].getEastNorth(), 805 nodes[1].getEastNorth())), nodes[0])); 806 807 return angles; 808 } 782 809 } -
trunk/src/org/openstreetmap/josm/data/validation/OsmValidator.java
r13647 r13670 53 53 import org.openstreetmap.josm.data.validation.tests.PublicTransportRouteTest; 54 54 import org.openstreetmap.josm.data.validation.tests.RelationChecker; 55 import org.openstreetmap.josm.data.validation.tests.RightAngleBuildingTest; 55 56 import org.openstreetmap.josm.data.validation.tests.SelfIntersectingWay; 56 57 import org.openstreetmap.josm.data.validation.tests.SimilarNamedWays; … … 141 142 LongSegment.class, // 3500 .. 3599 142 143 PublicTransportRouteTest.class, // 3600 .. 3699 144 RightAngleBuildingTest.class, // 3700 .. 3799 143 145 }; 144 146 -
trunk/src/org/openstreetmap/josm/tools/Geometry.java
r13638 r13670 794 794 795 795 return result; 796 } 797 798 /** 799 * Get angles in radians and return it's value in range [0, 180]. 800 * 801 * @param angle the angle in radians 802 * @return normalized angle in degrees 803 * @since 13670 804 */ 805 public static double getNormalizedAngleInDegrees(double angle) { 806 return Math.abs(180 * angle / Math.PI); 796 807 } 797 808
Note:
See TracChangeset
for help on using the changeset viewer.