summaryrefslogtreecommitdiff
path: root/src/Panorama.cxx
diff options
context:
space:
mode:
authorJohannes Hofmann <Johannes.Hofmann@gmx.de>2006-06-25 13:02:31 +0200
committerJohannes Hofmann <Johannes.Hofmann@gmx.de>2006-06-25 13:02:31 +0200
commitbf376cf0a996b08c39f22d46ba68be4e7957777f (patch)
tree3ebf29fea7f8bd7183dabdbd7388dc264194f7c3 /src/Panorama.cxx
parentb8a44e5e78d6b9f9c045f1c4e9600e1b346e099c (diff)
first working version
Diffstat (limited to 'src/Panorama.cxx')
-rw-r--r--src/Panorama.cxx25
1 files changed, 19 insertions, 6 deletions
diff --git a/src/Panorama.cxx b/src/Panorama.cxx
index 55fb9b8..b33a260 100644
--- a/src/Panorama.cxx
+++ b/src/Panorama.cxx
@@ -588,15 +588,28 @@ Panorama::get_real_distance(Hill *m) {
int
Panorama::get_coordinates(double a_view, double a_nick, int *x, int *y) {
- Hill *m = new Hill(0,0);
+ Hill m(0,0);
- m->a_view = a_view;
- m->a_nick = a_nick;
- proj->set_coordinates(m, &parms);
- *x = m->x;
- *y = m->y;
+ m.a_view = a_view - parms.a_center;
+
+ if (m.a_view > pi_d) {
+ m.a_view -= 2.0*pi_d;
+ } else if (m.a_view < -pi_d) {
+ m.a_view += 2.0*pi_d;
+ }
+
+ if (m.a_view < view_angle && m.a_view > - view_angle) {
+ return 1;
+ }
+
+ m.a_nick = a_nick;
+
+ proj->set_coordinates(&m, &parms);
+
+ *x = m.x;
+ *y = m.y;
return 0;
}