From da5192170bb7ed19a8eadbc8ac393b0fa222c7df Mon Sep 17 00:00:00 2001 From: Johannes Hofmann Date: Mon, 30 Oct 2006 18:18:57 +0100 Subject: consolidate ExifImageMetaData and src/JpgcomImageMetaData into ImageMetaData --- src/gipfel.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/gipfel.cxx') diff --git a/src/gipfel.cxx b/src/gipfel.cxx index 1106c48..13ef3e5 100644 --- a/src/gipfel.cxx +++ b/src/gipfel.cxx @@ -23,6 +23,7 @@ #include #include #include +#include #include #include @@ -438,7 +439,7 @@ int main(int argc, char** argv) { if (view_point) { gipf->set_viewpoint(view_point); } else if (img_file && - gipf->get_view_lat()==0.0 && gipf->get_view_long()==0.0) { + (isnan(gipf->get_view_lat()) || isnan(gipf->get_view_long()))) { viewpoint_cb(NULL, NULL); } -- cgit v1.2.3 From 4188cb198bec8a83cfeb893608af2bd39d515449 Mon Sep 17 00:00:00 2001 From: Johannes Hofmann Date: Mon, 30 Oct 2006 19:21:16 +0100 Subject: scale -> focal_length_35mm --- src/gipfel.cxx | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'src/gipfel.cxx') diff --git a/src/gipfel.cxx b/src/gipfel.cxx index 13ef3e5..dc15d8e 100644 --- a/src/gipfel.cxx +++ b/src/gipfel.cxx @@ -58,7 +58,7 @@ char *data_file = DEFAULT_DATAFILE; GipfelWidget *gipf = NULL; Fl_Dial *s_center = NULL; -Fl_Slider *s_nick, *s_scale, *s_tilt, *s_height_dist, *s_track_width; +Fl_Slider *s_nick, *s_focal_length, *s_tilt, *s_height_dist, *s_track_width; Fl_Value_Input *i_view_lat, *i_view_long, *i_view_height; Fl_Box *b_viewpoint; Fl_Menu_Bar *mb; @@ -72,7 +72,7 @@ static int stitch(int stitch_w, int stitch_h, int type, const char *path, void set_values() { s_center->value(gipf->get_center_angle()); s_nick->value(gipf->get_nick_angle()); - s_scale->value(gipf->get_scale()); + s_focal_length->value(gipf->get_focal_length_35mm()); s_tilt->value(gipf->get_tilt_angle()); s_height_dist->value(gipf->get_height_dist_ratio()); i_view_lat->value(gipf->get_view_lat()); @@ -114,8 +114,8 @@ void save_cb() { } } -void scale_cb(Fl_Slider* o, void*) { - gipf->set_scale(o->value()); +void focal_length_cb(Fl_Slider* o, void*) { + gipf->set_focal_length_35mm(o->value()); } void angle_cb(Fl_Slider* o, void*) { @@ -245,15 +245,15 @@ create_control_window() { Fl_Box *west = new Fl_Box(0, 125, 40, 20, "West"); - s_scale = new Fl_Value_Slider(235, 60, 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_TOP); + s_focal_length = new Fl_Value_Slider(235, 60, 160, 15, "Focal Length In 35mm"); + s_focal_length->type(1); + s_focal_length->box(FL_THIN_DOWN_BOX); + s_focal_length->labelsize(10); + s_focal_length->step(0.01); + s_focal_length->bounds(1.0, 200.0); + s_focal_length->slider(FL_UP_BOX); + s_focal_length->callback((Fl_Callback*)focal_length_cb); + s_focal_length->align(FL_ALIGN_TOP); s_nick = new Fl_Value_Slider(235, 90, 160, 15, "Nick (deg.)"); s_nick->type(1); -- cgit v1.2.3 From 364fadcbea5f37799bb42e663106e3a007746984 Mon Sep 17 00:00:00 2001 From: Johannes Hofmann Date: Mon, 30 Oct 2006 20:45:53 +0100 Subject: strip copyright --- src/gipfel.cxx | 20 -------------------- 1 file changed, 20 deletions(-) (limited to 'src/gipfel.cxx') diff --git a/src/gipfel.cxx b/src/gipfel.cxx index dc15d8e..3ec7290 100644 --- a/src/gipfel.cxx +++ b/src/gipfel.cxx @@ -1,23 +1,3 @@ -// -// gipfel program. -// -// Copyright 2006 by Johannes Hofmann -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// General Public License for more details. -// -// You should have received a copy of the GNU General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// #include #include -- cgit v1.2.3 From 6c50749f40e50a4b6a260a262b40035bfe83fd76 Mon Sep 17 00:00:00 2001 From: Johannes Hofmann Date: Mon, 30 Oct 2006 20:49:30 +0100 Subject: add simplified copyright --- src/gipfel.cxx | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/gipfel.cxx') diff --git a/src/gipfel.cxx b/src/gipfel.cxx index 3ec7290..343d19f 100644 --- a/src/gipfel.cxx +++ b/src/gipfel.cxx @@ -1,3 +1,8 @@ +// +// Copyright 2006 Johannes Hofmann +// +// This software may be used and distributed according to the terms +// of the GNU General Public License, incorporated herein by reference. #include #include -- cgit v1.2.3 From 09419b6f28bb7058c43501d1e1e10b71ef2499ab Mon Sep 17 00:00:00 2001 From: Johannes Hofmann Date: Mon, 30 Oct 2006 21:48:01 +0100 Subject: increase max focal length --- src/gipfel.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/gipfel.cxx') diff --git a/src/gipfel.cxx b/src/gipfel.cxx index 343d19f..3c204b7 100644 --- a/src/gipfel.cxx +++ b/src/gipfel.cxx @@ -230,12 +230,12 @@ create_control_window() { Fl_Box *west = new Fl_Box(0, 125, 40, 20, "West"); - s_focal_length = new Fl_Value_Slider(235, 60, 160, 15, "Focal Length In 35mm"); + s_focal_length = new Fl_Value_Slider(235, 60, 160, 15, "Focal Length in 35mm"); s_focal_length->type(1); s_focal_length->box(FL_THIN_DOWN_BOX); s_focal_length->labelsize(10); s_focal_length->step(0.01); - s_focal_length->bounds(1.0, 200.0); + s_focal_length->bounds(1.0, 300.0); s_focal_length->slider(FL_UP_BOX); s_focal_length->callback((Fl_Callback*)focal_length_cb); s_focal_length->align(FL_ALIGN_TOP); -- cgit v1.2.3 From 3065ecc1e1c44770ecad9e4bf29c4b71f0a2bc52 Mon Sep 17 00:00:00 2001 From: Johannes Hofmann Date: Mon, 30 Oct 2006 22:19:08 +0100 Subject: reindent --- src/gipfel.cxx | 687 +++++++++++++++++++++++++++++---------------------------- 1 file changed, 344 insertions(+), 343 deletions(-) (limited to 'src/gipfel.cxx') diff --git a/src/gipfel.cxx b/src/gipfel.cxx index 3c204b7..6eb4ee9 100644 --- a/src/gipfel.cxx +++ b/src/gipfel.cxx @@ -52,426 +52,427 @@ Fl_Menu_Bar *mb; #define STITCH_JPEG 2 #define STITCH_TIFF 4 static int stitch(int stitch_w, int stitch_h, int type, const char *path, - int argc, char **argv); + int argc, char **argv); void set_values() { - s_center->value(gipf->get_center_angle()); - s_nick->value(gipf->get_nick_angle()); - s_focal_length->value(gipf->get_focal_length_35mm()); - s_tilt->value(gipf->get_tilt_angle()); - s_height_dist->value(gipf->get_height_dist_ratio()); - i_view_lat->value(gipf->get_view_lat()); - i_view_long->value(gipf->get_view_long()); - i_view_height->value(gipf->get_view_height()); - b_viewpoint->label(gipf->get_viewpoint()); - if (gipf->get_projection() == Projection::TANGENTIAL) { - mb->mode(8, FL_MENU_RADIO|FL_MENU_VALUE); - mb->mode(9, FL_MENU_RADIO); - } else { - mb->mode(9, FL_MENU_RADIO|FL_MENU_VALUE); - mb->mode(8, FL_MENU_RADIO); - } + s_center->value(gipf->get_center_angle()); + s_nick->value(gipf->get_nick_angle()); + s_focal_length->value(gipf->get_focal_length_35mm()); + s_tilt->value(gipf->get_tilt_angle()); + s_height_dist->value(gipf->get_height_dist_ratio()); + i_view_lat->value(gipf->get_view_lat()); + i_view_long->value(gipf->get_view_long()); + i_view_height->value(gipf->get_view_height()); + b_viewpoint->label(gipf->get_viewpoint()); + if (gipf->get_projection() == Projection::TANGENTIAL) { + mb->mode(8, FL_MENU_RADIO|FL_MENU_VALUE); + mb->mode(9, FL_MENU_RADIO); + } else { + mb->mode(9, FL_MENU_RADIO|FL_MENU_VALUE); + mb->mode(8, FL_MENU_RADIO); + } } void quit_cb() { - exit(0); + exit(0); } void open_cb() { - char *file = fl_file_chooser("Open File?", "*.jpg", img_file); - if(file != NULL) { - gipf->load_image(file); - set_values(); - } + char *file = fl_file_chooser("Open File?", "*.jpg", img_file); + if(file != NULL) { + gipf->load_image(file); + set_values(); + } } void track_cb() { - char *file = fl_file_chooser("Track File?", NULL, NULL); - if (gipf->load_track(file) == 0) { - s_track_width->activate(); - } + char *file = fl_file_chooser("Track File?", NULL, NULL); + if (gipf->load_track(file) == 0) { + s_track_width->activate(); + } } void save_cb() { - char *file = fl_file_chooser("Save Image As?", NULL, NULL); - if (file) { - gipf->save_image(file); - } + char *file = fl_file_chooser("Save Image As?", NULL, NULL); + if (file) { + gipf->save_image(file); + } } void focal_length_cb(Fl_Slider* o, void*) { - gipf->set_focal_length_35mm(o->value()); + gipf->set_focal_length_35mm(o->value()); } void angle_cb(Fl_Slider* o, void*) { - gipf->set_center_angle(o->value()); + gipf->set_center_angle(o->value()); } void nick_cb(Fl_Slider* o, void*) { - gipf->set_nick_angle(o->value()); + gipf->set_nick_angle(o->value()); } void tilt_cb(Fl_Slider* o, void*) { - gipf->set_tilt_angle(o->value()); + gipf->set_tilt_angle(o->value()); } void h_d_cb(Fl_Slider* o, void*) { - gipf->set_height_dist_ratio(o->value()); + gipf->set_height_dist_ratio(o->value()); } void view_lat_cb(Fl_Value_Input* o, void*) { - gipf->set_view_lat(o->value()); + gipf->set_view_lat(o->value()); } void view_long_cb(Fl_Value_Input* o, void*) { - gipf->set_view_long(o->value()); + gipf->set_view_long(o->value()); } void view_height_cb(Fl_Value_Input* o, void*) { - gipf->set_view_height(o->value()); + gipf->set_view_height(o->value()); } void track_width_cb(Fl_Value_Input* o, void*) { - gipf->set_track_width(o->value()); + gipf->set_track_width(o->value()); } void viewpoint_cb(Fl_Value_Input* o, void*) { - Hill *m = choose_hill(gipf->get_mountains(), "Choose Viewpoint"); - if (m) { - gipf->set_viewpoint(m); - set_values(); - } + Hill *m = choose_hill(gipf->get_mountains(), "Choose Viewpoint"); + if (m) { + gipf->set_viewpoint(m); + set_values(); + } } void proj_cb(Fl_Value_Input* o, void*d) { - if(d == NULL) { - gipf->set_projection(Projection::TANGENTIAL); - } else { - gipf->set_projection(Projection::SPHAERIC); - } + if(d == NULL) { + gipf->set_projection(Projection::TANGENTIAL); + } else { + gipf->set_projection(Projection::SPHAERIC); + } } void hidden_cb(Fl_Menu_* o, void*d) { - gipf->set_show_hidden(o->mvalue()->value()); + gipf->set_show_hidden(o->mvalue()->value()); } void comp_cb(Fl_Widget *, void *) { - gipf->comp_params(); - set_values(); + gipf->comp_params(); + set_values(); } void guess_cb(Fl_Widget *, void *) { - gipf->guess(); - set_values(); + gipf->guess(); + set_values(); } void about_cb() { - fl_message("gipfel -- and you know what you see.\n" - "Version %s\n\n" - "(c) Johannes Hofmann 2006\n\n" - "Default datafile by http://www.alpin-koordinaten.de\n", - VERSION); + fl_message("gipfel -- and you know what you see.\n" + "Version %s\n\n" + "(c) Johannes Hofmann 2006\n\n" + "Default datafile by http://www.alpin-koordinaten.de\n", + VERSION); } void fill_menubar(Fl_Menu_Bar* mb) { - mb->add("&File/L&oad Image", FL_CTRL+'o', (Fl_Callback*)open_cb); - mb->add("&File/&Save Image", FL_CTRL+'s', (Fl_Callback*)save_cb); - mb->add("&File/Choose &Viewpoint", FL_CTRL+'v', (Fl_Callback*)viewpoint_cb); - mb->add("&File/Load &Track", FL_CTRL+'t', (Fl_Callback*)track_cb); - mb->add("&File/&Quit", FL_CTRL+'q', (Fl_Callback*)quit_cb); + mb->add("&File/L&oad Image", FL_CTRL+'o', (Fl_Callback*)open_cb); + mb->add("&File/&Save Image", FL_CTRL+'s', (Fl_Callback*)save_cb); + mb->add("&File/Choose &Viewpoint", FL_CTRL+'v', (Fl_Callback*)viewpoint_cb); + mb->add("&File/Load &Track", FL_CTRL+'t', (Fl_Callback*)track_cb); + mb->add("&File/&Quit", FL_CTRL+'q', (Fl_Callback*)quit_cb); + mb->add("&Projection/Normal Projection", 0, (Fl_Callback *)proj_cb, + (void *)0, FL_MENU_RADIO|FL_MENU_VALUE); + mb->add("&Projection/Panoramic Projection", 0, (Fl_Callback *)proj_cb, + (void *)1, FL_MENU_RADIO); - mb->add("&Projection/Normal Projection", 0, (Fl_Callback *)proj_cb, - (void *)0, FL_MENU_RADIO|FL_MENU_VALUE); - mb->add("&Projection/Panoramic Projection", 0, (Fl_Callback *)proj_cb, - (void *)1, FL_MENU_RADIO); + mb->add("&Option/Show Hidden", 0, (Fl_Callback *) hidden_cb, + (void *)0, FL_MENU_TOGGLE); - mb->add("&Option/Show Hidden", 0, (Fl_Callback *) hidden_cb, - (void *)0, FL_MENU_TOGGLE); - - mb->add("&Help/About", 0, (Fl_Callback*)about_cb); + mb->add("&Help/About", 0, (Fl_Callback*)about_cb); } void usage() { - fprintf(stderr, - "usage: gipfel [-v ] [-d ]\n" - " [-s] [-j ] [-t ] [-h ]\n" - " []\n" - " -v Set point from which the picture was taken.\n" - " This must be a string that unambiguously \n" - " matches the name of an entry in the data file.\n" - " -d Use for GPS data.\n" - " -s Stitch mode.\n" - " -w Width of result image.\n" - " -h Height of result image.\n" - " -j JPEG output file for Stitch mode.\n" - " -t Output directory for TIFF images in Stitch mode.\n" - " JPEG file(s) to use.\n"); + fprintf(stderr, + "usage: gipfel [-v ] [-d ]\n" + " [-s] [-j ] [-t ] [-h ]\n" + " []\n" + " -v Set point from which the picture was taken.\n" + " This must be a string that unambiguously \n" + " matches the name of an entry in the data file.\n" + " -d Use for GPS data.\n" + " -s Stitch mode.\n" + " -w Width of result image.\n" + " -h Height of result image.\n" + " -j JPEG output file for Stitch mode.\n" + " -t Output directory for TIFF images in Stitch mode.\n" + " JPEG file(s) to use.\n"); } Fl_Window * create_control_window() { - Fl_Window *win = new Fl_Window(400,350); - mb = new Fl_Menu_Bar(0, 0, 400, 30); - fill_menubar(mb); - - s_center = new Fl_Value_Dial(40, 60, 150, 150, NULL); - s_center->type(FL_LINE_DIAL); - s_center->labelsize(10); - s_center->step(0.01); - s_center->bounds(0.0, 360.0); - s_center->angles(180, 540); - s_center->callback((Fl_Callback*)angle_cb); - - Fl_Box *north = new Fl_Box(95, 40, 40, 20, "North"); - Fl_Box *south = new Fl_Box(95, 210, 40, 20, "South"); - Fl_Box *east = new Fl_Box(190, 125, 40, 20, "East"); - Fl_Box *west = new Fl_Box(0, 125, 40, 20, "West"); - - - s_focal_length = new Fl_Value_Slider(235, 60, 160, 15, "Focal Length in 35mm"); - s_focal_length->type(1); - s_focal_length->box(FL_THIN_DOWN_BOX); - s_focal_length->labelsize(10); - s_focal_length->step(0.01); - s_focal_length->bounds(1.0, 300.0); - s_focal_length->slider(FL_UP_BOX); - s_focal_length->callback((Fl_Callback*)focal_length_cb); - s_focal_length->align(FL_ALIGN_TOP); - - s_nick = new Fl_Value_Slider(235, 90, 160, 15, "Nick (deg.)"); - s_nick->type(1); - s_nick->box(FL_THIN_DOWN_BOX); - s_nick->labelsize(10); - s_nick->step(0.01); - s_nick->bounds(-20.0, 20.0); - s_nick->slider(FL_UP_BOX); - s_nick->callback((Fl_Callback*)nick_cb); - s_nick->align(FL_ALIGN_TOP); - - s_tilt = new Fl_Value_Slider(235, 120, 160, 15, "Tilt (deg.)"); - s_tilt->type(1); - s_tilt->box(FL_THIN_DOWN_BOX); - s_tilt->labelsize(10); - s_tilt->step(0.01); - s_tilt->bounds(-10.0, 10.0); - s_tilt->slider(FL_UP_BOX); - s_tilt->callback((Fl_Callback*)tilt_cb); - s_tilt->align(FL_ALIGN_TOP); - - s_height_dist = new Fl_Value_Slider(235, 150, 160, 15, "Visibility"); - s_height_dist->type(1); - s_height_dist->box(FL_THIN_DOWN_BOX); - s_height_dist->labelsize(10); - s_height_dist->step(-0.001); - s_height_dist->bounds(0.1, 0.01); - s_height_dist->slider(FL_UP_BOX); - s_height_dist->callback((Fl_Callback*)h_d_cb); - s_height_dist->align(FL_ALIGN_TOP); - - s_track_width = new Fl_Value_Slider(235, 180, 160, 15, "Track Width"); - s_track_width->type(1); - s_track_width->box(FL_THIN_DOWN_BOX); - s_track_width->labelsize(10); - s_track_width->step(1.0); - s_track_width->bounds(1.0, 500.0); - s_track_width->value(200.0); - s_track_width->slider(FL_UP_BOX); - s_track_width->callback((Fl_Callback*)track_width_cb); - s_track_width->align(FL_ALIGN_TOP); - s_track_width->deactivate(); - // Viewpoint Stuff - - b_viewpoint = new Fl_Box(FL_DOWN_BOX, 30, 255, 300, 80, ""); - b_viewpoint->align(FL_ALIGN_TOP); - - i_view_lat = new Fl_Value_Input(40, 270, 100, 20, "Latitude"); - i_view_lat->labelsize(10); - i_view_lat->align(FL_ALIGN_TOP); - i_view_lat->when(FL_WHEN_ENTER_KEY); - i_view_lat->callback((Fl_Callback*)view_lat_cb); - - i_view_long = new Fl_Value_Input(200, 270, 100, 20, "Longitude"); - i_view_long->labelsize(10); - i_view_long->align(FL_ALIGN_TOP); - i_view_long->when(FL_WHEN_ENTER_KEY); - i_view_long->callback((Fl_Callback*)view_long_cb); - - i_view_height = new Fl_Value_Input(40, 310, 80, 20, "Height"); - i_view_height->labelsize(10); - i_view_height->align(FL_ALIGN_TOP); - i_view_height->when(FL_WHEN_ENTER_KEY); - i_view_height->callback((Fl_Callback*)view_height_cb); - - // Buttons - Fl_Button *b = new Fl_Button(240, 210, 60, 20, "comp"); - b->color(FL_RED); - b->callback(comp_cb); - Fl_Button *b1 = new Fl_Button(320, 210, 60, 20, "guess"); - b1->callback(guess_cb); - b1->color(FL_GREEN); - - win->end(); - return win; + Fl_Window *win = new Fl_Window(400,350); + mb = new Fl_Menu_Bar(0, 0, 400, 30); + fill_menubar(mb); + + s_center = new Fl_Value_Dial(40, 60, 150, 150, NULL); + s_center->type(FL_LINE_DIAL); + s_center->labelsize(10); + s_center->step(0.01); + s_center->bounds(0.0, 360.0); + s_center->angles(180, 540); + s_center->callback((Fl_Callback*)angle_cb); + + Fl_Box *north = new Fl_Box(95, 40, 40, 20, "North"); + Fl_Box *south = new Fl_Box(95, 210, 40, 20, "South"); + Fl_Box *east = new Fl_Box(190, 125, 40, 20, "East"); + Fl_Box *west = new Fl_Box(0, 125, 40, 20, "West"); + + + s_focal_length = new Fl_Value_Slider(235, 60, 160, 15, "Focal Length in 35mm"); + s_focal_length->type(1); + s_focal_length->box(FL_THIN_DOWN_BOX); + s_focal_length->labelsize(10); + s_focal_length->step(0.01); + s_focal_length->bounds(1.0, 300.0); + s_focal_length->slider(FL_UP_BOX); + s_focal_length->callback((Fl_Callback*)focal_length_cb); + s_focal_length->align(FL_ALIGN_TOP); + + s_nick = new Fl_Value_Slider(235, 90, 160, 15, "Nick (deg.)"); + s_nick->type(1); + s_nick->box(FL_THIN_DOWN_BOX); + s_nick->labelsize(10); + s_nick->step(0.01); + s_nick->bounds(-20.0, 20.0); + s_nick->slider(FL_UP_BOX); + s_nick->callback((Fl_Callback*)nick_cb); + s_nick->align(FL_ALIGN_TOP); + + s_tilt = new Fl_Value_Slider(235, 120, 160, 15, "Tilt (deg.)"); + s_tilt->type(1); + s_tilt->box(FL_THIN_DOWN_BOX); + s_tilt->labelsize(10); + s_tilt->step(0.01); + s_tilt->bounds(-10.0, 10.0); + s_tilt->slider(FL_UP_BOX); + s_tilt->callback((Fl_Callback*)tilt_cb); + s_tilt->align(FL_ALIGN_TOP); + + s_height_dist = new Fl_Value_Slider(235, 150, 160, 15, "Visibility"); + s_height_dist->type(1); + s_height_dist->box(FL_THIN_DOWN_BOX); + s_height_dist->labelsize(10); + s_height_dist->step(-0.001); + s_height_dist->bounds(0.1, 0.01); + s_height_dist->slider(FL_UP_BOX); + s_height_dist->callback((Fl_Callback*)h_d_cb); + s_height_dist->align(FL_ALIGN_TOP); + + s_track_width = new Fl_Value_Slider(235, 180, 160, 15, "Track Width"); + s_track_width->type(1); + s_track_width->box(FL_THIN_DOWN_BOX); + s_track_width->labelsize(10); + s_track_width->step(1.0); + s_track_width->bounds(1.0, 500.0); + s_track_width->value(200.0); + s_track_width->slider(FL_UP_BOX); + s_track_width->callback((Fl_Callback*)track_width_cb); + s_track_width->align(FL_ALIGN_TOP); + s_track_width->deactivate(); + // Viewpoint Stuff + + b_viewpoint = new Fl_Box(FL_DOWN_BOX, 30, 255, 300, 80, ""); + b_viewpoint->align(FL_ALIGN_TOP); + + i_view_lat = new Fl_Value_Input(40, 270, 100, 20, "Latitude"); + i_view_lat->labelsize(10); + i_view_lat->align(FL_ALIGN_TOP); + i_view_lat->when(FL_WHEN_ENTER_KEY); + i_view_lat->callback((Fl_Callback*)view_lat_cb); + + i_view_long = new Fl_Value_Input(200, 270, 100, 20, "Longitude"); + i_view_long->labelsize(10); + i_view_long->align(FL_ALIGN_TOP); + i_view_long->when(FL_WHEN_ENTER_KEY); + i_view_long->callback((Fl_Callback*)view_long_cb); + + i_view_height = new Fl_Value_Input(40, 310, 80, 20, "Height"); + i_view_height->labelsize(10); + i_view_height->align(FL_ALIGN_TOP); + i_view_height->when(FL_WHEN_ENTER_KEY); + i_view_height->callback((Fl_Callback*)view_height_cb); + + // Buttons + Fl_Button *b = new Fl_Button(240, 210, 60, 20, "comp"); + b->color(FL_RED); + b->callback(comp_cb); + Fl_Button *b1 = new Fl_Button(320, 210, 60, 20, "guess"); + b1->callback(guess_cb); + b1->color(FL_GREEN); + + win->end(); + return win; } int main(int argc, char** argv) { - char c, *sep, *tmp, **my_argv; - char *view_point = NULL; - int err, bflag = 0, dflag = 0, my_argc; - int stitch_flag = 0, stitch_w = 2000, stitch_h = 500; - int jpeg_flag = 0, tiff_flag = 0; - char *outpath; - Fl_Window *control_win, *view_win; - Fl_Scroll *scroll; - - - err = 0; - while ((c = getopt(argc, argv, "?d:v:sw:h:j:t:")) != EOF) { - switch (c) { - case '?': - usage(); - exit(0); - break; - case 'd': - data_file = optarg; - break; - case 'v': - view_point = optarg; - break; - case 's': - stitch_flag++; - break; - case 'j': - jpeg_flag++; - outpath = optarg; - break; - case 't': - tiff_flag++; - outpath = optarg; - break; - case 'w': - stitch_w = atoi(optarg); - break; - case 'h': - stitch_h = atoi(optarg); - break; - default: - err++; - } - } - - - my_argc = argc - optind; - my_argv = argv + optind; - - if (my_argc >= 1) { - img_file = my_argv[0]; - } - - if (data_file == NULL || err) { - usage(); - exit(1); - } - - if (stitch_flag) { - int type = STITCH_PREVIEW; - if (jpeg_flag) { - type = STITCH_JPEG; - } else if (tiff_flag) { - type = STITCH_TIFF; - } - stitch(stitch_w, stitch_h, type, outpath, my_argc, my_argv); - exit(0); - } - - Fl::get_system_colors(); - if (getenv("FLTK_SCHEME")) { - Fl::scheme(NULL); - } else { - Fl::scheme("plastic"); - } - - control_win = create_control_window(); - - view_win = new Fl_Window(800, 600); - - // The Fl_Group is used to avoid FL_DAMAGE_ALL in Fl_Scroll::position - Fl_Group *g = new Fl_Group(0, 0, view_win->w(), view_win->h()); - view_win->resizable(g); - scroll = new Fl_Scroll(0, 0, view_win->w(), view_win->h()); - - gipf = new GipfelWidget(0,0,800,600); - if (img_file) { - gipf->load_image(img_file); - } - - view_win->size(gipf->w(), gipf->h()); - scroll->size(gipf->w(), gipf->h()); - - gipf->load_data(data_file); - scroll->end(); - - set_values(); - - view_win->resizable(scroll); - - view_win->end(); - view_win->show(1, argv); - control_win->show(1, argv); - - if (view_point) { - gipf->set_viewpoint(view_point); - } else if (img_file && - (isnan(gipf->get_view_lat()) || isnan(gipf->get_view_long()))) { - viewpoint_cb(NULL, NULL); - } - - return Fl::run(); + char c, *sep, *tmp, **my_argv; + char *view_point = NULL; + int err, bflag = 0, dflag = 0, my_argc; + int stitch_flag = 0, stitch_w = 2000, stitch_h = 500; + int jpeg_flag = 0, tiff_flag = 0; + char *outpath; + Fl_Window *control_win, *view_win; + Fl_Scroll *scroll; + + + err = 0; + while ((c = getopt(argc, argv, "?d:v:sw:h:j:t:")) != EOF) { + switch (c) { + case '?': + usage(); + exit(0); + break; + case 'd': + data_file = optarg; + break; + case 'v': + view_point = optarg; + break; + case 's': + stitch_flag++; + break; + case 'j': + jpeg_flag++; + outpath = optarg; + break; + case 't': + tiff_flag++; + outpath = optarg; + break; + case 'w': + stitch_w = atoi(optarg); + break; + case 'h': + stitch_h = atoi(optarg); + break; + default: + err++; + } + } + + + my_argc = argc - optind; + my_argv = argv + optind; + + if (my_argc >= 1) { + img_file = my_argv[0]; + } + + if (data_file == NULL || err) { + usage(); + exit(1); + } + + if (stitch_flag) { + int type = STITCH_PREVIEW; + if (jpeg_flag) { + type = STITCH_JPEG; + } else if (tiff_flag) { + type = STITCH_TIFF; + } + stitch(stitch_w, stitch_h, type, outpath, my_argc, my_argv); + exit(0); + } + + Fl::get_system_colors(); + if (getenv("FLTK_SCHEME")) { + Fl::scheme(NULL); + } else { + Fl::scheme("plastic"); + } + + control_win = create_control_window(); + + view_win = new Fl_Window(800, 600); + + // The Fl_Group is used to avoid FL_DAMAGE_ALL in Fl_Scroll::position + Fl_Group *g = new Fl_Group(0, 0, view_win->w(), view_win->h()); + view_win->resizable(g); + scroll = new Fl_Scroll(0, 0, view_win->w(), view_win->h()); + + gipf = new GipfelWidget(0,0,800,600); + if (img_file) { + gipf->load_image(img_file); + } + + view_win->size(gipf->w(), gipf->h()); + scroll->size(gipf->w(), gipf->h()); + + gipf->load_data(data_file); + scroll->end(); + + set_values(); + + view_win->resizable(scroll); + + view_win->end(); + view_win->show(1, argv); + control_win->show(1, argv); + + if (view_point) { + gipf->set_viewpoint(view_point); + } else if (img_file && + (isnan(gipf->get_view_lat()) || isnan(gipf->get_view_long()))) { + viewpoint_cb(NULL, NULL); + } + + return Fl::run(); } static int stitch(int stitch_w, int stitch_h, int type, const char *path, int argc, char **argv) { - Fl_Window *win; - Fl_Scroll *scroll; - Stitch *st = new Stitch(); - - for (int i=0; iload_image(argv[i]); - } - - if (type == STITCH_JPEG) { - - st->set_output((OutputImage*) new JPEGOutputImage(path, 90)); - st->resample(stitch_w, stitch_h, 0.0, 7.0); - - } else if (type == STITCH_TIFF) { - - for (int i=0; iset_output(argv[i], (OutputImage*) new TIFFOutputImage(buf)); - } - - st->resample(stitch_w, stitch_h, 0.0, 7.0); - - } else { - win = new Fl_Window(0,0, stitch_w, stitch_h); - scroll = new Fl_Scroll(0, 0, win->w(), win->h()); - PreviewOutputImage *img = new PreviewOutputImage(0, 0, stitch_w, stitch_h); - win->resizable(scroll); - win->show(0, argv); - st->set_output((OutputImage*) img); - st->resample(stitch_w, stitch_h, 0.0, 7.0); - img->redraw(); - Fl::run(); - } - - return 0; + Fl_Window *win; + Fl_Scroll *scroll; + Stitch *st = new Stitch(); + + for (int i=0; iload_image(argv[i]); + } + + if (type == STITCH_JPEG) { + + st->set_output((OutputImage*) new JPEGOutputImage(path, 90)); + st->resample(stitch_w, stitch_h, 0.0, 7.0); + + } else if (type == STITCH_TIFF) { + + for (int i=0; iset_output(argv[i], (OutputImage*) new TIFFOutputImage(buf)); + } + + st->resample(stitch_w, stitch_h, 0.0, 7.0); + + } else { + win = new Fl_Window(0,0, stitch_w, stitch_h); + scroll = new Fl_Scroll(0, 0, win->w(), win->h()); + PreviewOutputImage *img = + new PreviewOutputImage(0, 0, stitch_w, stitch_h); + + win->resizable(scroll); + win->show(0, argv); + st->set_output((OutputImage*) img); + st->resample(stitch_w, stitch_h, 0.0, 7.0); + img->redraw(); + Fl::run(); + } + + return 0; } -- cgit v1.2.3 From a10646b1c87e6abc1651ae7160ddd2c7fd1753bc Mon Sep 17 00:00:00 2001 From: Johannes Hofmann Date: Mon, 30 Oct 2006 22:38:13 +0100 Subject: set window title bar --- src/gipfel.cxx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/gipfel.cxx') diff --git a/src/gipfel.cxx b/src/gipfel.cxx index 6eb4ee9..cf43af7 100644 --- a/src/gipfel.cxx +++ b/src/gipfel.cxx @@ -42,6 +42,7 @@ char *img_file; char *data_file = DEFAULT_DATAFILE; GipfelWidget *gipf = NULL; +Fl_Window *control_win, *view_win; Fl_Dial *s_center = NULL; Fl_Slider *s_nick, *s_focal_length, *s_tilt, *s_height_dist, *s_track_width; Fl_Value_Input *i_view_lat, *i_view_long, *i_view_height; @@ -81,6 +82,8 @@ void open_cb() { char *file = fl_file_chooser("Open File?", "*.jpg", img_file); if(file != NULL) { gipf->load_image(file); + view_win->label(file); + control_win->label(file); set_values(); } } @@ -322,7 +325,6 @@ int main(int argc, char** argv) { int stitch_flag = 0, stitch_w = 2000, stitch_h = 500; int jpeg_flag = 0, tiff_flag = 0; char *outpath; - Fl_Window *control_win, *view_win; Fl_Scroll *scroll; @@ -404,6 +406,8 @@ int main(int argc, char** argv) { gipf = new GipfelWidget(0,0,800,600); if (img_file) { gipf->load_image(img_file); + view_win->label(img_file); + control_win->label(img_file); } view_win->size(gipf->w(), gipf->h()); -- cgit v1.2.3