Ignore:
Timestamp:
2010-03-14T23:50:45+01:00 (16 years ago)
Author:
pieren
Message:

minor fixes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/Buildings.java

    r20390 r20484  
    7979    BuildingsImageModifier bim = new BuildingsImageModifier();
    8080
    81     private double snapDistance = Main.pref.getDouble("cadastrewms.snap-distance", 60); // in centimeters
     81    private double snapDistance = Main.pref.getDouble("cadastrewms.snap-distance", 50); // in centimeters
    8282    private double snapDistanceSq = snapDistance*snapDistance;
    8383    private double dx, dy;
     
    173173                            cmds.add(new MoveCommand(nearestNode, dx, dy));
    174174                        }
     175                        if (i>0)
     176                            joinExistingNodesInNewSegment(way2.getNode(i-1), way2.getNode(i));
    175177                    }
    176178                    wayToAdd.addNode(wayToAdd.getNode(0));
     
    411413    }
    412414   
     415    private void joinExistingNodesInNewSegment(Node n1, Node n2) {
     416        // TODO
     417        double minx = Math.min(n1.getEastNorth().getX(), n2.getEastNorth().getX());
     418        double miny = Math.min(n1.getEastNorth().getY(), n2.getEastNorth().getY());
     419        double maxx = Math.max(n1.getEastNorth().getX(), n2.getEastNorth().getX());
     420        double maxy = Math.max(n1.getEastNorth().getY(), n2.getEastNorth().getY());
     421        BBox bbox = new BBox(minx-snapDistance, miny-snapDistance, maxx+snapDistance, maxy+snapDistance);
     422        DataSet ds = getCurrentDataSet();
     423        if (ds == null)
     424            return;
     425        List<Node> ln = ds.searchNodes(bbox);
     426        int i=0;
     427        for (Node n:ln)
     428            if (n.isUsable())
     429                i++;
     430        System.out.println("usable nodes in boxe="+i);
     431    }
     432   
    413433    private void joinNodeToExistingWays(List<WaySegment> wss, Node newNode, Collection<Command> cmds) {
    414434        HashMap<Way, List<Integer>> insertPoints = new HashMap<Way, List<Integer>>();
Note: See TracChangeset for help on using the changeset viewer.