diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/GipfelWidget.H | 10 | ||||
-rw-r--r-- | src/GipfelWidget.cxx | 26 | ||||
-rw-r--r-- | src/Panorama.H | 10 | ||||
-rw-r--r-- | src/Panorama.cxx | 28 | ||||
-rw-r--r-- | src/gipfel.cxx | 101 |
5 files changed, 118 insertions, 57 deletions
diff --git a/src/GipfelWidget.H b/src/GipfelWidget.H index 36f801f..187ad37 100644 --- a/src/GipfelWidget.H +++ b/src/GipfelWidget.H @@ -1,5 +1,5 @@ // -// "$Id: GipfelWidget.H,v 1.16 2005/05/05 15:24:43 hofmann Exp $" +// "$Id: GipfelWidget.H,v 1.17 2005/05/05 17:37:37 hofmann Exp $" // // X11 header file for the Fast Light Tool Kit (FLTK). // @@ -62,6 +62,14 @@ class GipfelWidget : public Fl_Widget { void set_tilt_angle(double a); void set_scale(double s); + + double get_center_angle(); + + double get_nick_angle(); + + double get_tilt_angle(); + + double get_scale(); void set_height_dist_ratio(double r); diff --git a/src/GipfelWidget.cxx b/src/GipfelWidget.cxx index 7a6343d..5b0d5b5 100644 --- a/src/GipfelWidget.cxx +++ b/src/GipfelWidget.cxx @@ -1,5 +1,5 @@ // -// "$Id: GipfelWidget.cxx,v 1.22 2005/05/05 17:00:38 hofmann Exp $" +// "$Id: GipfelWidget.cxx,v 1.23 2005/05/05 17:37:37 hofmann Exp $" // // PSEditWidget routines. // @@ -259,6 +259,26 @@ GipfelWidget::set_scale(double s) { redraw(); } +double +GipfelWidget::get_center_angle() { + return pan->get_center_angle(); +} + +double +GipfelWidget::get_nick_angle() { + return pan->get_nick_angle(); +} + +double +GipfelWidget::get_tilt_angle() { + return pan->get_tilt_angle(); +} + +double +GipfelWidget::get_scale() { + return pan->get_scale(); +} + void GipfelWidget::set_height_dist_ratio(double r) { pan->set_height_dist_ratio(r); @@ -272,9 +292,11 @@ GipfelWidget::comp_params() { fprintf(stderr, "Position m1 and m2 first.\n"); return 1; } + fl_cursor(FL_CURSOR_WAIT); pan->comp_params(m1, m2); set_labels(pan->get_visible_mountains()); redraw(); + fl_cursor(FL_CURSOR_DEFAULT); } int @@ -283,9 +305,11 @@ GipfelWidget::guess() { fprintf(stderr, "Position m1 first.\n"); return 1; } + fl_cursor(FL_CURSOR_WAIT); pan->guess(marker, m1); set_labels(pan->get_visible_mountains()); redraw(); + fl_cursor(FL_CURSOR_DEFAULT); } int diff --git a/src/Panorama.H b/src/Panorama.H index d88c0c6..4803a4b 100644 --- a/src/Panorama.H +++ b/src/Panorama.H @@ -1,5 +1,5 @@ // -// "$Id: Panorama.H,v 1.13 2005/05/05 15:24:43 hofmann Exp $" +// "$Id: Panorama.H,v 1.14 2005/05/05 17:37:37 hofmann Exp $" // // X11 header file for the Fast Light Tool Kit (FLTK). // @@ -87,6 +87,14 @@ class Panorama { void set_scale(double s); + double get_center_angle(); + + double get_nick_angle(); + + double get_tilt_angle(); + + double get_scale(); + int comp_params(Mountain *m1, Mountain *m2); int guess(Mountains *p1, Mountain *m1); diff --git a/src/Panorama.cxx b/src/Panorama.cxx index cd1daaf..4f0b62a 100644 --- a/src/Panorama.cxx +++ b/src/Panorama.cxx @@ -1,5 +1,5 @@ // -// "$Id: Panorama.cxx,v 1.30 2005/05/05 17:00:38 hofmann Exp $" +// "$Id: Panorama.cxx,v 1.31 2005/05/05 17:37:37 hofmann Exp $" // // Panorama routines. // @@ -29,7 +29,6 @@ extern "C" { #include <ccmath.h> } -#include "GipfelWidget.H" #include "Panorama.H" static int newton(double *tan_nick_view, @@ -158,10 +157,6 @@ Panorama::get_value(Mountains *p) { return v; } -extern GipfelWidget *gipf; - - - int Panorama::guess(Mountains *p, Mountain *m1) { Mountain *p2, *m_tmp1, *m_tmp2; @@ -210,7 +205,6 @@ Panorama::guess(Mountains *p, Mountain *m1) { a_nick_best = a_nick; a_tilt_best = a_tilt; scale_best = scale; - gipf->update(); fprintf(stderr, "best %f\n", best); } @@ -349,6 +343,26 @@ Panorama::set_height_dist_ratio(double r) { update_visible_mountains(); } +double +Panorama::get_center_angle() { + return a_center; +} + +double +Panorama::get_nick_angle() { + return a_nick; +} + +double +Panorama::get_tilt_angle() { + return a_tilt; +} + +double +Panorama::get_scale() { + return scale; +} + int Panorama::get_pos(const char *name, double *phi, double *lam, double *height) { int i; diff --git a/src/gipfel.cxx b/src/gipfel.cxx index 2b28f1e..622424a 100644 --- a/src/gipfel.cxx +++ b/src/gipfel.cxx @@ -1,5 +1,5 @@ // -// "$Id: gipfel.cxx,v 1.16 2005/05/05 11:02:07 hofmann Exp $" +// "$Id: gipfel.cxx,v 1.17 2005/05/05 17:37:37 hofmann Exp $" // // flpsed program. // @@ -45,7 +45,8 @@ char *img_file; char *data_file; -GipfelWidget *gipf; +GipfelWidget *gipf = NULL; +Fl_Slider *s_center = NULL, *s_nick = NULL, *s_scale = NULL, *s_tilt = NULL; void open_cb() { char *file = fl_file_chooser("Open File?", "*.jpeg", img_file); @@ -166,51 +167,57 @@ int main(int argc, char** argv) { win = new Fl_Window(800,700); m = new Fl_Menu_Bar(0, 0, 800, 30); m->menu(menuitems); - Fl_Slider* a = new Fl_Slider(50, 30, 750, 15, "angle"); - a->type(1); - a->box(FL_THIN_DOWN_BOX); - a->labelsize(10); - a->step(0.00001); - a->bounds(-3.14, 3.14); - a->slider(FL_UP_BOX); - a->callback((Fl_Callback*)angle_cb); - a->align(FL_ALIGN_LEFT); - Fl_Slider* s = new Fl_Slider(100, 45, 160, 15, "scale"); - s->type(1); - s->box(FL_THIN_DOWN_BOX); - s->labelsize(10); - s->step(5.0); - s->bounds(0.0, 10000.0); - s->slider(FL_UP_BOX); - s->callback((Fl_Callback*)scale_cb); - s->align(FL_ALIGN_LEFT); - Fl_Slider* n = new Fl_Slider(360, 45, 160, 15, "nick"); - n->type(1); - n->box(FL_THIN_DOWN_BOX); - n->labelsize(10); - n->step(0.00001); - n->bounds(-0.5, 0.5); - n->slider(FL_UP_BOX); - n->callback((Fl_Callback*)nick_cb); - n->align(FL_ALIGN_LEFT); - Fl_Slider* r = new Fl_Slider(620, 45, 160, 15, "height-dist"); - r->type(1); - r->box(FL_THIN_DOWN_BOX); - r->labelsize(10); - r->step(-0.005); - r->bounds(0.2, 0.01); - r->slider(FL_UP_BOX); - r->callback((Fl_Callback*)h_d_cb); - r->align(FL_ALIGN_LEFT); - Fl_Slider* t = new Fl_Slider(50, 60, 160, 15, "tilt"); - t->type(1); - t->box(FL_THIN_DOWN_BOX); - t->labelsize(10); - t->step(0.005); - t->bounds(-0.1, 0.1); - t->slider(FL_UP_BOX); - t->callback((Fl_Callback*)tilt_cb); - t->align(FL_ALIGN_LEFT); + + s_center = new Fl_Slider(50, 30, 750, 15, "direction"); + s_center->type(1); + s_center->box(FL_THIN_DOWN_BOX); + s_center->labelsize(10); + s_center->step(0.00001); + s_center->bounds(-3.14, 3.14); + s_center->slider(FL_UP_BOX); + s_center->callback((Fl_Callback*)angle_cb); + s_center->align(FL_ALIGN_LEFT); + + s_scale = new Fl_Slider(100, 45, 160, 15, "scale"); + s_scale->type(1); + s_scale->box(FL_THIN_DOWN_BOX); + s_scale->labelsize(10); + s_scale->step(5.0); + s_scale->bounds(0.0, 10000.0); + s_scale->slider(FL_UP_BOX); + s_scale->callback((Fl_Callback*)scale_cb); + s_scale->align(FL_ALIGN_LEFT); + + s_nick = new Fl_Slider(360, 45, 160, 15, "nick"); + s_nick->type(1); + s_nick->box(FL_THIN_DOWN_BOX); + s_nick->labelsize(10); + s_nick->step(0.00001); + s_nick->bounds(-0.5, 0.5); + s_nick->slider(FL_UP_BOX); + s_nick->callback((Fl_Callback*)nick_cb); + s_nick->align(FL_ALIGN_LEFT); + + s_tilt = new Fl_Slider(50, 60, 160, 15, "tilt"); + s_tilt->type(1); + s_tilt->box(FL_THIN_DOWN_BOX); + s_tilt->labelsize(10); + s_tilt->step(0.005); + s_tilt->bounds(-0.1, 0.1); + s_tilt->slider(FL_UP_BOX); + s_tilt->callback((Fl_Callback*)tilt_cb); + s_tilt->align(FL_ALIGN_LEFT); + + Fl_Slider* s_height_dist = new Fl_Slider(620, 45, 160, 15, "height-dist"); + s_height_dist->type(1); + s_height_dist->box(FL_THIN_DOWN_BOX); + s_height_dist->labelsize(10); + s_height_dist->step(-0.005); + s_height_dist->bounds(0.2, 0.01); + s_height_dist->slider(FL_UP_BOX); + s_height_dist->callback((Fl_Callback*)h_d_cb); + s_height_dist->align(FL_ALIGN_LEFT); + Fl_Button *b = new Fl_Button(200, 60, 20, 15, "comp"); b->callback(comp_cb); Fl_Button *b1 = new Fl_Button(250, 60, 20, 15, "guess"); |