Changeset 13807 in josm
- Timestamp:
- 2018-05-21T19:34:43+02:00 (7 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/IPrimitive.java
r13806 r13807 417 417 */ 418 418 List<? extends IPrimitive> getReferrers(); 419 420 /** 421 * Returns the parent data set of this primitive. 422 * @return OsmData this primitive is part of. 423 */ 424 OsmData<?, ?, ?, ?> getDataSet(); 419 425 } -
trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java
r13806 r13807 237 237 } 238 238 239 /** 240 * 241 * @return DataSet this primitive is part of. 242 */ 239 @Override 243 240 public DataSet getDataSet() { 244 241 return dataSet; -
trunk/src/org/openstreetmap/josm/data/osm/PrimitiveData.java
r13806 r13807 176 176 177 177 @Override 178 public OsmData<?, ?, ?, ?> getDataSet() { 179 return null; 180 } 181 182 @Override 178 183 public StyleCache getCachedStyle() { 179 184 return null; -
trunk/src/org/openstreetmap/josm/tools/Geometry.java
r13805 r13807 571 571 /** 572 572 * Tests if two polygons intersect. 573 * @param <N> type of node574 573 * @param first List of nodes forming first polygon 575 574 * @param second List of nodes forming second polygon 576 575 * @return intersection kind 577 576 */ 578 public static <N extends INode> PolygonIntersection polygonIntersection(List<N> first, List<N> second) {577 public static PolygonIntersection polygonIntersection(List<? extends INode> first, List<? extends INode> second) { 579 578 Area a1 = getArea(first); 580 579 Area a2 = getArea(second); … … 620 619 /** 621 620 * Tests if point is inside a polygon. The polygon can be self-intersecting. In such case the contains function works in xor-like manner. 622 * @param <N> type of node623 621 * @param polygonNodes list of nodes from polygon path. 624 622 * @param point the point to test 625 623 * @return true if the point is inside polygon. 626 624 */ 627 public static <N extends INode> boolean nodeInsidePolygon(N point, List<N> polygonNodes) {625 public static boolean nodeInsidePolygon(INode point, List<? extends INode> polygonNodes) { 628 626 if (polygonNodes.size() < 2) 629 627 return false; 630 628 631 629 //iterate each side of the polygon, start with the last segment 632 NoldPoint = polygonNodes.get(polygonNodes.size() - 1);630 INode oldPoint = polygonNodes.get(polygonNodes.size() - 1); 633 631 634 632 if (!oldPoint.isLatLonKnown()) { … … 637 635 638 636 boolean inside = false; 639 Np1, p2;640 641 for ( NnewPoint : polygonNodes) {637 INode p1, p2; 638 639 for (INode newPoint : polygonNodes) { 642 640 //skip duplicate points 643 641 if (newPoint.equals(oldPoint)) { … … 943 941 * @return {@code true} if the node is inside the multipolygon 944 942 */ 945 public static boolean isNodeInsideMultiPolygon( Node node, Relation multiPolygon, Predicate<Way> isOuterWayAMatch) {943 public static boolean isNodeInsideMultiPolygon(INode node, Relation multiPolygon, Predicate<Way> isOuterWayAMatch) { 946 944 return isPolygonInsideMultiPolygon(Collections.singletonList(node), multiPolygon, isOuterWayAMatch); 947 945 } … … 957 955 * @return {@code true} if the polygon formed by nodes is inside the multipolygon 958 956 */ 959 public static boolean isPolygonInsideMultiPolygon(List< Node> nodes, Relation multiPolygon, Predicate<Way> isOuterWayAMatch) {957 public static boolean isPolygonInsideMultiPolygon(List<? extends INode> nodes, Relation multiPolygon, Predicate<Way> isOuterWayAMatch) { 960 958 // Extract outer/inner members from multipolygon 961 959 final Pair<List<JoinedPolygon>, List<JoinedPolygon>> outerInner;
Note:
See TracChangeset
for help on using the changeset viewer.