diff options
| -rw-r--r-- | src/GipfelWidget.H | 6 | ||||
| -rw-r--r-- | src/GipfelWidget.cxx | 8 | ||||
| -rw-r--r-- | src/Panorama.H | 4 | ||||
| -rw-r--r-- | src/Panorama.cxx | 9 | ||||
| -rw-r--r-- | src/gipfel.cxx | 23 | 
5 files changed, 41 insertions, 9 deletions
diff --git a/src/GipfelWidget.H b/src/GipfelWidget.H index 1fc898e..cd803d4 100644 --- a/src/GipfelWidget.H +++ b/src/GipfelWidget.H @@ -1,5 +1,5 @@  //  -// "$Id: GipfelWidget.H,v 1.7 2005/04/17 20:03:13 hofmann Exp $" +// "$Id: GipfelWidget.H,v 1.8 2005/04/19 16:17:56 hofmann Exp $"  //  // X11 header file for the Fast Light Tool Kit (FLTK).  // @@ -30,8 +30,8 @@  class GipfelWidget : public Fl_Widget {   private:    Fl_Image *img; -  Panorama *pan;    Mountain *cur_mountain; +  Panorama *pan;    int handle(int event); @@ -52,6 +52,8 @@ class GipfelWidget : public Fl_Widget {    void set_nick_angle(double a); +  void set_tilt_angle(double a); +    void set_scale(double s);    void set_height_dist_ratio(double r); diff --git a/src/GipfelWidget.cxx b/src/GipfelWidget.cxx index b10653b..b43ea86 100644 --- a/src/GipfelWidget.cxx +++ b/src/GipfelWidget.cxx @@ -1,5 +1,5 @@  //  -// "$Id: GipfelWidget.cxx,v 1.9 2005/04/17 20:03:13 hofmann Exp $" +// "$Id: GipfelWidget.cxx,v 1.10 2005/04/19 16:17:56 hofmann Exp $"  //  // PSEditWidget routines.  // @@ -155,6 +155,12 @@ GipfelWidget::set_nick_angle(double a) {  }  void +GipfelWidget::set_tilt_angle(double a) { +  pan->set_tilt_angle(a); +  redraw(); +} + +void  GipfelWidget::set_scale(double s) {    pan->set_scale(s);    redraw(); diff --git a/src/Panorama.H b/src/Panorama.H index c8dc77b..12586a8 100644 --- a/src/Panorama.H +++ b/src/Panorama.H @@ -1,5 +1,5 @@  //  -// "$Id: Panorama.H,v 1.5 2005/04/17 20:03:13 hofmann Exp $" +// "$Id: Panorama.H,v 1.6 2005/04/19 16:17:56 hofmann Exp $"  //  // X11 header file for the Fast Light Tool Kit (FLTK).  // @@ -76,6 +76,8 @@ class Panorama {    void set_nick_angle(double a); +  void set_tilt_angle(double a); +    void set_scale(double s);    int comp_params(); diff --git a/src/Panorama.cxx b/src/Panorama.cxx index e3dfa21..f812e61 100644 --- a/src/Panorama.cxx +++ b/src/Panorama.cxx @@ -1,5 +1,5 @@  //  -// "$Id: Panorama.cxx,v 1.7 2005/04/17 20:03:13 hofmann Exp $" +// "$Id: Panorama.cxx,v 1.8 2005/04/19 16:17:56 hofmann Exp $"  //  // PSEditWidget routines.  // @@ -167,6 +167,13 @@ Panorama::set_nick_angle(double a) {  }  void +Panorama::set_tilt_angle(double a) { +  a_tilt = a; +  fprintf(stderr, "-->tilt%f\n", a_tilt/deg2rad); +  update_visible_mountains(); +} + +void  Panorama::set_scale(double s) {    scale = s;    update_visible_mountains(); diff --git a/src/gipfel.cxx b/src/gipfel.cxx index c940a56..934ed75 100644 --- a/src/gipfel.cxx +++ b/src/gipfel.cxx @@ -1,5 +1,5 @@  //  -// "$Id: gipfel.cxx,v 1.10 2005/04/17 20:03:13 hofmann Exp $" +// "$Id: gipfel.cxx,v 1.11 2005/04/19 16:17:56 hofmann Exp $"  //  // flpsed program.  // @@ -72,6 +72,12 @@ void nick_cb(Fl_Slider* o, void*) {    }  } +void tilt_cb(Fl_Slider* o, void*) { +  if (gipf) { +    gipf->set_tilt_angle((double)(o->value())); +  } +} +  void h_d_cb(Fl_Slider* o, void*) {    if (gipf) {      gipf->set_height_dist_ratio((double)(o->value())); @@ -190,12 +196,21 @@ int main(int argc, char** argv) {    r->slider(FL_UP_BOX);    r->callback((Fl_Callback*)h_d_cb);    r->align(FL_ALIGN_LEFT); -  Fl_Button *b = new Fl_Button(780, 45, 20, 15, "comp"); +  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); +  Fl_Button *b = new Fl_Button(200, 60, 20, 15, "comp");    b->callback(comp_cb); -  scroll = new Fl_Scroll(0, 60, win->w(), win->h()-60); +  scroll = new Fl_Scroll(0, 75, win->w(), win->h()-75); -  gipf = new GipfelWidget(0,60,500,500); +  gipf = new GipfelWidget(0,75,500,500);    gipf->load_image(img_file);    gipf->load_data(data_file);  | 
