Changeset 20484 in osm
- Timestamp:
- 2010-03-14T23:50:45+01:00 (15 years ago)
- Location:
- applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/Buildings.java
r20390 r20484 79 79 BuildingsImageModifier bim = new BuildingsImageModifier(); 80 80 81 private double snapDistance = Main.pref.getDouble("cadastrewms.snap-distance", 60); // in centimeters81 private double snapDistance = Main.pref.getDouble("cadastrewms.snap-distance", 50); // in centimeters 82 82 private double snapDistanceSq = snapDistance*snapDistance; 83 83 private double dx, dy; … … 173 173 cmds.add(new MoveCommand(nearestNode, dx, dy)); 174 174 } 175 if (i>0) 176 joinExistingNodesInNewSegment(way2.getNode(i-1), way2.getNode(i)); 175 177 } 176 178 wayToAdd.addNode(wayToAdd.getNode(0)); … … 411 413 } 412 414 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 413 433 private void joinNodeToExistingWays(List<WaySegment> wss, Node newNode, Collection<Command> cmds) { 414 434 HashMap<Way, List<Integer>> insertPoints = new HashMap<Way, List<Integer>>(); -
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastrePlugin.java
r20481 r20484 150 150 System.out.println("Pluging cadastre-fr v"+VERSION+" started..."); 151 151 if (Main.pref.get("cadastrewms.cacheDir").equals("")) 152 cacheDir = Main.pref.getPreferencesDir()+"plugins"+File. pathSeparatorChar+"cadastrewms"+File.pathSeparatorChar;152 cacheDir = Main.pref.getPreferencesDir()+"plugins"+File.separatorChar+"cadastrewms"+File.separatorChar; 153 153 else { 154 154 cacheDir = Main.pref.get("cadastrewms.cacheDir"); 155 if (cacheDir.charAt(cacheDir.length()-1) != File. pathSeparatorChar )156 cacheDir += File. pathSeparatorChar;155 if (cacheDir.charAt(cacheDir.length()-1) != File.separatorChar ) 156 cacheDir += File.separatorChar; 157 157 } 158 158 System.out.println("current cache directory: "+cacheDir); … … 328 328 if (oldFrame == null && newFrame != null) { 329 329 setEnabledAll(true); 330 Main.map.addMapMode(new IconToggleButton 331 (new WMSAdjustAction(Main.map))); 332 Main.map.addMapMode(new IconToggleButton 333 (new Buildings(Main.map))); 330 Main.map.addMapMode(new IconToggleButton(new WMSAdjustAction(Main.map))); 331 if (Main.pref.getBoolean("cadastrewms.buildingsMenu", false)) 332 Main.map.addMapMode(new IconToggleButton(new Buildings(Main.map))); 334 333 } else if (oldFrame != null && newFrame == null) { 335 334 setEnabledAll(false);
Note:
See TracChangeset
for help on using the changeset viewer.