altoslib: Get new abstract mapping code compiling
[fw/altos] / altoslib / AltosMapTransform.java
index f5fc5ebe597531953d0a41413381198d558452a3..384c1744bc0131eebaef87007f4c9d9cf6d9636a 100644 (file)
@@ -39,10 +39,18 @@ public class AltosMapTransform {
                return new AltosLatLon(lat,lon);
        }
 
+       public AltosPointDouble screen_point(AltosPointInt screen) {
+               return new AltosPointDouble(screen.x + offset_x, screen.y + offset_y);
+       }
+
        public AltosPointDouble screen_point(AltosPointDouble screen) {
                return new AltosPointDouble(screen.x + offset_x, screen.y + offset_y);
        }
 
+       public AltosLatLon screen_lat_lon(AltosPointInt screen) {
+               return lat_lon(screen_point(screen));
+       }
+
        public AltosLatLon screen_lat_lon(AltosPointDouble screen) {
                return lat_lon(screen_point(screen));
        }
@@ -71,12 +79,12 @@ public class AltosMapTransform {
                                         (int) (point.y - offset_y + 0.5));
        }
 
-//     public Rectangle screen(AltosMapRectangle map_rect) {
-//             AltosPoint2D    ul = screen(map_rect.ul);
-//             AltosPoint2D    lr = screen(map_rect.lr);
-//
-//             return new Rectangle((int) ul.x, (int) ul.y, (int) (lr.x - ul.x), (int) (lr.y - ul.y));
-//     }
+       public AltosRectangle screen(AltosMapRectangle map_rect) {
+               AltosPointDouble        ul = screen(map_rect.ul);
+               AltosPointDouble        lr = screen(map_rect.lr);
+
+               return new AltosRectangle((int) ul.x, (int) ul.y, (int) (lr.x - ul.x), (int) (lr.y - ul.y));
+       }
 
        public AltosPointDouble screen(AltosLatLon lat_lon) {
                return screen(point(lat_lon));