diff options
-rw-r--r-- | src/GipfelWidget.H | 10 | ||||
-rw-r--r-- | src/GipfelWidget.cxx | 18 | ||||
-rw-r--r-- | src/Hill.H | 24 | ||||
-rw-r--r-- | src/Hill.cxx | 36 | ||||
-rw-r--r-- | src/Panorama.H | 16 | ||||
-rw-r--r-- | src/Panorama.cxx | 36 |
6 files changed, 70 insertions, 70 deletions
diff --git a/src/GipfelWidget.H b/src/GipfelWidget.H index 187ad37..cd7e7ad 100644 --- a/src/GipfelWidget.H +++ b/src/GipfelWidget.H @@ -1,5 +1,5 @@ // -// "$Id: GipfelWidget.H,v 1.17 2005/05/05 17:37:37 hofmann Exp $" +// "$Id: GipfelWidget.H,v 1.18 2005/05/08 18:02:38 hofmann Exp $" // // X11 header file for the Fast Light Tool Kit (FLTK). // @@ -31,9 +31,9 @@ class GipfelWidget : public Fl_Widget { private: Fl_Image *img; - Mountain *cur_mountain; - Mountains *marker; - Mountain *m1, *m2; + Hill *cur_mountain; + Hills *marker; + Hill *m1, *m2; Panorama *pan; Fl_Menu_Button *mb; @@ -44,7 +44,7 @@ class GipfelWidget : public Fl_Widget { int set_mountain(int m_x, int m_y); - void set_labels(Mountains *v); + void set_labels(Hills *v); public: GipfelWidget(int X,int Y,int W, int H); diff --git a/src/GipfelWidget.cxx b/src/GipfelWidget.cxx index 737238f..b09ae81 100644 --- a/src/GipfelWidget.cxx +++ b/src/GipfelWidget.cxx @@ -1,5 +1,5 @@ // -// "$Id: GipfelWidget.cxx,v 1.24 2005/05/05 19:56:38 hofmann Exp $" +// "$Id: GipfelWidget.cxx,v 1.25 2005/05/08 18:02:38 hofmann Exp $" // // PSEditWidget routines. // @@ -54,11 +54,11 @@ GipfelWidget::GipfelWidget(int X,int Y,int W, int H): Fl_Widget(X, Y, W, H) { pan = new Panorama(); cur_mountain = NULL; mb = NULL; - marker = new Mountains(); + marker = new Hills(); m1 = NULL; m2 = NULL; for (i=0; i<=3; i++) { - marker->add(new Mountain(i * 10, 0)); + marker->add(new Hill(i * 10, 0)); } fl_register_images(); } @@ -94,8 +94,8 @@ GipfelWidget::set_viewpoint(const char *pos) { void GipfelWidget::draw() { - Mountains *mnts; - Mountain *m; + Hills *mnts; + Hill *m; int center_x = w() / 2; int center_y = h() / 2; int i; @@ -149,9 +149,9 @@ overlap(int m1, int n1, int m2, int n2) { } void -GipfelWidget::set_labels(Mountains *v) { +GipfelWidget::set_labels(Hills *v) { int i, j, width, height; - Mountain *m, *n; + Hill *m, *n; fl_font(FL_HELVETICA, 8); @@ -175,8 +175,8 @@ GipfelWidget::set_labels(Mountains *v) { int GipfelWidget::set_cur_mountain(int m_x, int m_y) { - Mountains *mnts = pan->get_visible_mountains(); - Mountain *m; + Hills *mnts = pan->get_visible_mountains(); + Hill *m; int center = w() / 2; int i; @@ -1,5 +1,5 @@ // -// "$Id: Hill.H,v 1.11 2005/05/08 18:00:11 hofmann Exp $" +// "$Id: Hill.H,v 1.12 2005/05/08 18:02:38 hofmann Exp $" // // X11 header file for the Fast Light Tool Kit (FLTK). // @@ -24,9 +24,9 @@ #ifndef HILL_H #define HILL_H -class Mountain; +class Hill; -class Mountain { +class Hill { private: public: @@ -40,25 +40,25 @@ class Mountain { int label_x, label_y; char *name; - Mountain(const char *n, double p, double l, double h); + Hill(const char *n, double p, double l, double h); - Mountain(int x_tmp, int y_tmp); + Hill(int x_tmp, int y_tmp); - ~Mountain(); + ~Hill(); }; -class Mountains { +class Hills { private: int num, cap; - Mountain **m; + Hill **m; public: - Mountains(); + Hills(); - ~Mountains(); + ~Hills(); - void add(Mountain *m); + void add(Hill *m); void sort(); @@ -68,6 +68,6 @@ class Mountains { int get_num(); - Mountain *get(int n); + Hill *get(int n); }; #endif diff --git a/src/Hill.cxx b/src/Hill.cxx index 310fd55..a37c7ab 100644 --- a/src/Hill.cxx +++ b/src/Hill.cxx @@ -1,5 +1,5 @@ // -// "$Id: Hill.cxx,v 1.10 2005/05/08 18:00:11 hofmann Exp $" +// "$Id: Hill.cxx,v 1.11 2005/05/08 18:02:38 hofmann Exp $" // // PSEditWidget routines. // @@ -27,7 +27,7 @@ #include "Hill.H" -Mountain::Mountain(const char *n, double p, double l, double h) { +Hill::Hill(const char *n, double p, double l, double h) { name = strdup(n); phi = p; lam = l; @@ -37,7 +37,7 @@ Mountain::Mountain(const char *n, double p, double l, double h) { y = 0; } -Mountain::Mountain(int x_tmp, int y_tmp) { +Hill::Hill(int x_tmp, int y_tmp) { name = ""; phi = 0.0; lam = 0.0; @@ -47,20 +47,20 @@ Mountain::Mountain(int x_tmp, int y_tmp) { y = y_tmp; } -Mountain::~Mountain() { +Hill::~Hill() { if (name) { free(name); } } -Mountains::Mountains() { +Hills::Hills() { num = 0; cap = 100; - m = (Mountain **) malloc(cap * sizeof(Mountain *)); + m = (Hill **) malloc(cap * sizeof(Hill *)); } -Mountains::~Mountains() { +Hills::~Hills() { if (m) { free(m); } @@ -68,10 +68,10 @@ Mountains::~Mountains() { void -Mountains::add(Mountain *m1) { +Hills::add(Hill *m1) { if (num >= cap) { cap = cap?cap * 2:100; - m = (Mountain **) realloc(m, cap * sizeof(Mountain *)); + m = (Hill **) realloc(m, cap * sizeof(Hill *)); } m[num++] = m1; @@ -80,8 +80,8 @@ Mountains::add(Mountain *m1) { static int comp_mountains(const void *n1, const void *n2) { - Mountain *m1 = *(Mountain **)n1; - Mountain *m2 = *(Mountain **)n2; + Hill *m1 = *(Hill **)n1; + Hill *m2 = *(Hill **)n2; if (m1 && m2) { if (m1->alph < m2->alph) { @@ -97,16 +97,16 @@ comp_mountains(const void *n1, const void *n2) { } void -Mountains::sort() { +Hills::sort() { if (!m) { return; } - qsort(m, num, sizeof(Mountain *), comp_mountains); + qsort(m, num, sizeof(Hill *), comp_mountains); } void -Mountains::clear() { +Hills::clear() { if (m) { free(m); m = NULL; @@ -116,7 +116,7 @@ Mountains::clear() { } void -Mountains::clobber() { +Hills::clobber() { int i; for(i=0; i<get_num();i++) { @@ -129,12 +129,12 @@ Mountains::clobber() { } int -Mountains::get_num() { +Hills::get_num() { return num; } -Mountain * -Mountains::get(int n) { +Hill * +Hills::get(int n) { if (n < 0 || n >= num) { return NULL; } else { diff --git a/src/Panorama.H b/src/Panorama.H index 290be50..aa84691 100644 --- a/src/Panorama.H +++ b/src/Panorama.H @@ -1,5 +1,5 @@ // -// "$Id: Panorama.H,v 1.15 2005/05/08 18:00:11 hofmann Exp $" +// "$Id: Panorama.H,v 1.16 2005/05/08 18:02:38 hofmann Exp $" // // X11 header file for the Fast Light Tool Kit (FLTK). // @@ -30,8 +30,8 @@ class Panorama { private: double view_phi, view_lam, view_height; double height_dist_ratio; - Mountains *mountains; - Mountains *visible_mountains; + Hills *mountains; + Hills *visible_mountains; int x1, y1, x2, y2; double a_center; double scale; @@ -62,9 +62,9 @@ class Panorama { int get_matrix(double m[]); - int optimize(Mountain *m1, Mountain *m2); + int optimize(Hill *m1, Hill *m2); - double get_value(Mountains *p); + double get_value(Hills *p); public: Panorama(); @@ -77,7 +77,7 @@ class Panorama { void set_height_dist_ratio(double r); - Mountains * get_visible_mountains(); + Hills * get_visible_mountains(); void set_center_angle(double a); @@ -95,8 +95,8 @@ class Panorama { double get_scale(); - int comp_params(Mountain *m1, Mountain *m2); + int comp_params(Hill *m1, Hill *m2); - int guess(Mountains *p1, Mountain *m1); + int guess(Hills *p1, Hill *m1); }; #endif diff --git a/src/Panorama.cxx b/src/Panorama.cxx index b3d1dad..0ca05f4 100644 --- a/src/Panorama.cxx +++ b/src/Panorama.cxx @@ -1,5 +1,5 @@ // -// "$Id: Panorama.cxx,v 1.33 2005/05/08 17:56:48 hofmann Exp $" +// "$Id: Panorama.cxx,v 1.34 2005/05/08 18:02:38 hofmann Exp $" // // Panorama routines. // @@ -51,8 +51,8 @@ comp_tilt(double tan_nick_view, double tan_dir_view, double n_scale, static double pi_d, deg2rad; Panorama::Panorama() { - mountains = new Mountains(); - visible_mountains = new Mountains(); + mountains = new Hills(); + visible_mountains = new Hills(); height_dist_ratio = 0.07; pi_d = asin(1.0) * 2.0; deg2rad = pi_d / 180.0; @@ -76,7 +76,7 @@ Panorama::load_file(const char *name) { char *vals[10]; char **ap, *bp; double phi, lam, height; - Mountain *m; + Hill *m; visible_mountains->clear(); mountains->clobber(); @@ -99,7 +99,7 @@ Panorama::load_file(const char *name) { height = atof(vals[5]); - m = new Mountain(vals[1], phi, lam, height); + m = new Hill(vals[1], phi, lam, height); mountains->add(m); } @@ -123,15 +123,15 @@ Panorama::set_viewpoint(const char *name) { return 0; } -Mountains * +Hills * Panorama::get_visible_mountains() { return visible_mountains; } double -Panorama::get_value(Mountains *p) { +Panorama::get_value(Hills *p) { int i, j; - Mountain *m; + Hill *m; double v = 0.0, d_min, d; if (isnan(scale) || isnan(a_center) || isnan(a_tilt) || isnan(a_nick) || @@ -158,9 +158,9 @@ Panorama::get_value(Mountains *p) { } int -Panorama::guess(Mountains *p, Mountain *m1) { - Mountain *p2, *m_tmp1, *m_tmp2; - Mountain *m2; +Panorama::guess(Hills *p, Hill *m1) { + Hill *p2, *m_tmp1, *m_tmp2; + Hill *m2; double best = 100000000.0, v; double a_center_best, a_nick_best, a_tilt_best, scale_best; int x1_sav, y1_sav; @@ -226,8 +226,8 @@ Panorama::guess(Mountains *p, Mountain *m1) { } int -Panorama::comp_params(Mountain *m1, Mountain *m2) { - Mountain *tmp; +Panorama::comp_params(Hill *m1, Hill *m2) { + Hill *tmp; double a_center_tmp, scale_tmp, a_nick_tmp; if (m1->x > m2->x) { @@ -264,7 +264,7 @@ Panorama::comp_params(Mountain *m1, Mountain *m2) { } int -Panorama::optimize(Mountain *m1, Mountain *m2) { +Panorama::optimize(Hill *m1, Hill *m2) { int i; double tan_nick_view, tan_dir_view, n_scale; double tan_nick_m1, tan_dir_m1; @@ -386,7 +386,7 @@ Panorama::get_pos(const char *name, double *phi, double *lam, double *height) { int i; int found = 0; double p, l, h; - Mountain *m; + Hill *m; for (i=0; i<mountains->get_num(); i++) { m = mountains->get(i); @@ -413,7 +413,7 @@ Panorama::get_pos(const char *name, double *phi, double *lam, double *height) { void Panorama::update_angles() { int i; - Mountain *m; + Hill *m; for (i=0; i<mountains->get_num(); i++) { m = mountains->get(i); @@ -434,7 +434,7 @@ Panorama::update_angles() { void Panorama::update_visible_mountains() { int i; - Mountain *m; + Hill *m; visible_mountains->clear(); @@ -466,7 +466,7 @@ void Panorama::update_coordinates() { int i; double x_tmp, y_tmp; - Mountain *m; + Hill *m; for (i=0; i<visible_mountains->get_num(); i++) { m = visible_mountains->get(i); |