summaryrefslogtreecommitdiff
path: root/src/Panorama.cxx
diff options
context:
space:
mode:
authorJohannes Hofmann <Johannes.Hofmann@gmx.de>2006-08-09 22:20:43 +0200
committerJohannes Hofmann <Johannes.Hofmann@gmx.de>2006-08-09 22:20:43 +0200
commitb045aa1c430b86cb523b7e619d23ddc96aea521a (patch)
tree69bb5b4ee5bd157058dcfe112fe7d738fbfa2725 /src/Panorama.cxx
parentbf4427b9a9c912e94287a4bf9828fdd76b8a40de (diff)
parentfeae8373e6fbdafe5368410ba0ac51059f7155f7 (diff)
merge in stitching code
Diffstat (limited to 'src/Panorama.cxx')
-rw-r--r--src/Panorama.cxx24
1 files changed, 23 insertions, 1 deletions
diff --git a/src/Panorama.cxx b/src/Panorama.cxx
index c8cb1dc..73bc003 100644
--- a/src/Panorama.cxx
+++ b/src/Panorama.cxx
@@ -508,8 +508,11 @@ Panorama::update_coordinates() {
for (int i=0; i<visible_mountains->get_num(); i++) {
m = visible_mountains->get(i);
+ double tmp_x, tmp_y;
- proj->set_coordinates(m, &parms);
+ proj->get_coordinates(m->a_view, m->a_nick, &parms, &tmp_x, &tmp_y);
+ m->x = (int) rint(tmp_x);
+ m->y = (int) rint(tmp_y);
}
}
@@ -586,3 +589,22 @@ Panorama::get_real_distance(Hill *m) {
return c;
}
+int
+Panorama::get_coordinates(double a_view, double a_nick, double *x, double *y) {
+ a_view = a_view - parms.a_center;
+
+ if (a_view > pi_d) {
+ a_view -= 2.0*pi_d;
+ } else if (a_view < -pi_d) {
+ a_view += 2.0*pi_d;
+ }
+
+ if (a_view > view_angle || a_view < - view_angle) {
+ return 1;
+ }
+
+ proj->get_coordinates(a_view, a_nick, &parms, x, y);
+
+ return 0;
+}
+