From a1957ae738e07e76b48f1d9e77fbd884ec3c9c84 Mon Sep 17 00:00:00 2001 From: Johannes Hofmann Date: Fri, 11 Oct 2013 19:43:36 +0200 Subject: don't update coordinates of marked hills --- src/Panorama.H | 4 ++-- src/Panorama.cxx | 11 ++++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/Panorama.H b/src/Panorama.H index 1b5fdac..1f4fdeb 100644 --- a/src/Panorama.H +++ b/src/Panorama.H @@ -26,9 +26,9 @@ class Panorama { Hill * get_pos(const char *name); void update_angles(); - void update_coordinates(); + void update_coordinates(Hills *excluded_hills = NULL); void update_close_mountains(); - void update_visible_mountains(); + void update_visible_mountains(Hills *excluded_hills = NULL); void mark_hidden(Hills *hills); double distance(double phi, double lam); double alpha(const Hill *m); diff --git a/src/Panorama.cxx b/src/Panorama.cxx index e340599..ccba04f 100644 --- a/src/Panorama.cxx +++ b/src/Panorama.cxx @@ -131,7 +131,7 @@ Panorama::comp_params(Hills *h) { ret = proj->comp_params(h, &parms); if (ret == 0) - update_visible_mountains(); + update_visible_mountains(h); return ret; } @@ -360,7 +360,7 @@ Panorama::update_close_mountains() { } void -Panorama::update_visible_mountains() { +Panorama::update_visible_mountains(Hills *excluded_hills) { visible_mountains->clear(); for (int i = 0; i < close_mountains->get_num(); i++) { @@ -374,14 +374,15 @@ Panorama::update_visible_mountains() { } } - update_coordinates(); + update_coordinates(excluded_hills); } void -Panorama::update_coordinates() { +Panorama::update_coordinates(Hills *excluded_hills) { for (int i = 0; i < visible_mountains->get_num(); i++) { Hill *m = visible_mountains->get(i); - proj->get_coordinates(m->alph, m->a_nick, &parms, &m->x, &m->y); + if (!excluded_hills || !excluded_hills->contains(m)) + proj->get_coordinates(m->alph, m->a_nick, &parms, &m->x, &m->y); } } -- cgit v1.2.3