summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohannes Hofmann <johannes.hofmann@gmx.de>2005-04-19 14:17:56 +0000
committerJohannes Hofmann <johannes.hofmann@gmx.de>2005-04-19 14:17:56 +0000
commit983b0fc839560702c917a805aba698b7cfe4e3fe (patch)
tree89873b827e881c7139a7cd0b04b337bcc7d66b7c /src
parent53ff36907392c1d4775bcfdfb6201bd210fdb23b (diff)
vor umstellung
vor umstellung
Diffstat (limited to 'src')
-rw-r--r--src/GipfelWidget.H6
-rw-r--r--src/GipfelWidget.cxx8
-rw-r--r--src/Panorama.H4
-rw-r--r--src/Panorama.cxx9
-rw-r--r--src/gipfel.cxx23
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);