From 489bdd091ea9dae275717e95340a9fdd07dcba8c Mon Sep 17 00:00:00 2001 From: Johannes Hofmann Date: Thu, 14 Dec 2006 17:23:17 +0100 Subject: change Projection::comp_params() to allow a variable amount of known mountains --- src/ProjectionSphaeric.cxx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/ProjectionSphaeric.cxx') diff --git a/src/ProjectionSphaeric.cxx b/src/ProjectionSphaeric.cxx index 96af4e0..5227355 100644 --- a/src/ProjectionSphaeric.cxx +++ b/src/ProjectionSphaeric.cxx @@ -13,8 +13,8 @@ #define BEST_UNDEF 10000000.0 int -ProjectionSphaeric::comp_params(const Hill *m1, const Hill *m2, ViewParams *parms) { - const Hill *m_tmp; +ProjectionSphaeric::comp_params(const Hills *h, ViewParams *parms) { + const Hill *m_tmp, *m1, *m2; double tmp_x, tmp_y; double val; ViewParams best, tmp; @@ -22,6 +22,14 @@ ProjectionSphaeric::comp_params(const Hill *m1, const Hill *m2, ViewParams *parm double d_m1_2, d_m2_2, d_m1_m2_2; int i, j; + + if (h->get_num() != 2) { + return 1; + } + + m1 = h->get(0); + m2 = h->get(1); + if (m1->x < m2->x) { m_tmp = m1; m1 = m2; -- cgit v1.2.3