Changeset 35613 in osm for applications/editors/josm


Ignore:
Timestamp:
2020-10-25T10:36:13+01:00 (4 years ago)
Author:
GerdP
Message:

fix #19280 Select all inside: Child Nodes of inside ways not selected

  • change parameter for selectAllInside() to select nodes in ways
  • don't filter nodes in method addAllInsideMultipolygon(), let selectAllInside() decide if nodes are wanted
Location:
applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/selection
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/selection/NodeWayUtils.java

    r35470 r35613  
    395395            }
    396396        }
    397         for (Way w : newestWays) {
    398             newestNodes.removeAll(w.getNodes());
    399             // do not select nodes of already selected ways
    400         }
    401 
    402397        filteredAddAll(newNodes, newestNodes);
    403398        newWays.addAll(newestWays); // already filtered
     
    488483    }
    489484
     485    /**
     486     * Compute ways inside selected polygons.
     487     * @param selected the selected polygons and maybe other elements
     488     * @param dataset the dataset
     489     * @return ways inside selected polygons
     490     */
    490491    public static Collection<OsmPrimitive> selectAllInside(Collection<OsmPrimitive> selected, DataSet dataset) {
    491492        return selectAllInside(selected, dataset, true);
    492493    }
    493494
     495    /**
     496     * Compute elements (ways, nodes) inside selected polygons.
     497     * @param selected the selected polygons and maybe other elements
     498     * @param dataset the dataset
     499     * @param ignoreNodesOfFoundWays if {@code true}, the result will not contain the nodes of the computed ways.
     500     * @return ways inside selected polygons, if wanted also the nodes.
     501     */
    494502    public static Set<OsmPrimitive> selectAllInside(Collection<OsmPrimitive> selected, DataSet dataset, boolean ignoreNodesOfFoundWays) {
    495503        Set<Way> newWays = new HashSet<>();
  • applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/selection/SelectAllInsideAction.java

    r35579 r35613  
    2323public class SelectAllInsideAction extends JosmAction {
    2424
     25    /**
     26     * Constructs a new {@code SelectAllInsideAction}.
     27     */
    2528    public SelectAllInsideAction() {
    2629        super(tr("All inside [testing]"), "selinside", tr("Select all inside selected polygons"),
     
    3336    public void actionPerformed(ActionEvent e) {
    3437        DataSet ds = getLayerManager().getActiveDataSet();
    35         Collection<OsmPrimitive> insideSelected = NodeWayUtils.selectAllInside(ds.getSelected(), ds, true);
     38        Collection<OsmPrimitive> insideSelected = NodeWayUtils.selectAllInside(ds.getSelected(), ds, false);
    3639
    3740        if (!insideSelected.isEmpty()) {
Note: See TracChangeset for help on using the changeset viewer.