Ignore:
Timestamp:
2009-07-03T12:33:32+02:00 (11 years ago)
Author:
stoecker
Message:

Large rework in projection handling - now allows only switching and more specific projections
TODO:

  • allow subprojections (i.e. settings for projections)
  • setup preferences for subprojections
  • better support of the new projection depending world bounds (how to handle valid data outside of world)
  • do not allow to zoom out of the world - zoom should stop when whole world is displayed
  • fix Lambert and SwissGrid to handle new OutOfWorld style and subprojections
  • fix new UTM projection
  • handle layers with fixed projection on projection change
  • allow easier projection switching (e.g. in menu)

NOTE:
This checkin very likely will cause problems. Please report or fix them. Older plugins may have trouble. The SVN plugins
have been fixed but may have problems nevertheless. This is a BIG change, but will make JOSMs internal structure much cleaner
and reduce lots of projection related problems.

Location:
trunk/src/org/openstreetmap/josm/command
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/command/MoveCommand.java

    r1640 r1722  
    4848    public static class OldState {
    4949        LatLon latlon;
    50         EastNorth eastNorth;
    5150        boolean modified;
    5251    }
     
    7069        for (Node n : this.objects) {
    7170            OldState os = new OldState();
    72             os.eastNorth = n.getEastNorth();
    7371            os.latlon = n.getCoor();
    7472            os.modified = n.modified;
     
    105103        for (Node n : objects) {
    106104            OldState os = it.next();
    107             n.setEastNorth(os.eastNorth);
     105            n.setCoor(os.latlon);
    108106            n.modified = os.modified;
    109107        }
  • trunk/src/org/openstreetmap/josm/command/RotateCommand.java

    r1640 r1722  
    1414
    1515import org.openstreetmap.josm.data.coor.EastNorth;
     16import org.openstreetmap.josm.data.coor.LatLon;
    1617import org.openstreetmap.josm.data.osm.Node;
    1718import org.openstreetmap.josm.data.osm.OsmPrimitive;
     
    3738
    3839    /**
     40     * Small helper for holding the interesting part of the old data state of the
     41     * objects.
     42     */
     43    public static class OldState {
     44        LatLon latlon;
     45        EastNorth eastNorth;
     46        boolean modified;
     47    }
     48
     49    /**
    3950     * angle of rotation starting click to pivot
    4051     */
     
    4960     * List of all old states of the objects.
    5061     */
    51     private Map<Node, MoveCommand.OldState> oldState = new HashMap<Node, MoveCommand.OldState>();
     62    private Map<Node, OldState> oldState = new HashMap<Node, OldState>();
    5263
    5364    /**
     
    6374
    6475        for (Node n : this.objects) {
    65             MoveCommand.OldState os = new MoveCommand.OldState();
     76            OldState os = new OldState();
     77            os.latlon = n.getCoor();
    6678            os.eastNorth = n.getEastNorth();
    67             os.latlon = n.getCoor();
    6879            os.modified = n.modified;
    6980            oldState.put(n, os);
     
    102113            double nx =  sinPhi * x + cosPhi * y + pivot.east();
    103114            double ny = -cosPhi * x + sinPhi * y + pivot.north();
    104             n.setEastNorth(nx, ny);
     115            n.setEastNorth(new EastNorth(nx, ny));
    105116            if (setModified)
    106117                n.modified = true;
     
    115126    @Override public void undoCommand() {
    116127        for (Node n : objects) {
    117             MoveCommand.OldState os = oldState.get(n);
    118             n.setEastNorth(os.eastNorth);
     128            OldState os = oldState.get(n);
     129            n.setCoor(os.latlon);
    119130            n.modified = os.modified;
    120131        }
Note: See TracChangeset for help on using the changeset viewer.