diff --git a/Common/CommandLine.cpp b/Common/CommandLine.cpp index c56bc8b8ab84a62af95d7f27ef464b667657443d..ece6b7eccf8608dd805530f2d821127739437ddc 100644 --- a/Common/CommandLine.cpp +++ b/Common/CommandLine.cpp @@ -1,4 +1,4 @@ -// $Id: CommandLine.cpp,v 1.47 2004-09-17 17:35:53 geuzaine Exp $ +// $Id: CommandLine.cpp,v 1.48 2004-09-18 01:12:07 geuzaine Exp $ // // Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle // @@ -91,7 +91,7 @@ void Print_Usage(char *name){ Msg(DIRECT, "Post-processing options:"); Msg(DIRECT, " -noview hide all views on startup"); Msg(DIRECT, " -link int select link mode between views (0, 1, 2, 3, 4)"); - Msg(DIRECT, " -combine combine input views into multi time step ones"); + Msg(DIRECT, " -combine combine input views into multi-time-step ones"); Msg(DIRECT, "Display options:"); Msg(DIRECT, " -nodb disable double buffering"); Msg(DIRECT, " -fontsize int specify the font size for the GUI"); diff --git a/Common/Context.h b/Common/Context.h index 0198c3059d62a872606e49aabd466a6b094f7dd6..4768ae8b4bd12818be1cd7c68f59c4e34f24938d 100644 --- a/Common/Context.h +++ b/Common/Context.h @@ -192,7 +192,7 @@ public : List_T *list ; int force_num, compute_bb, vertex_arrays; int draw, scales, link ; - int smooth, anim_cycle, combine_time ; + int smooth, anim_cycle, combine_time, combine_remove_orig ; double anim_delay ; }post; diff --git a/Common/DefaultOptions.h b/Common/DefaultOptions.h index f0646ae8bf2d56e0a3c76a4a76b84cab99331fd5..d5dfc81b0eb2faf989f0780af2afd765d228fd43 100644 --- a/Common/DefaultOptions.h +++ b/Common/DefaultOptions.h @@ -908,6 +908,9 @@ StringXNumber PostProcessingOptions_Number[] = { { F|O, "AnimationCycle" , opt_post_anim_cycle , 0. , "Cycle through views instead of time steps in automatic animation mode" }, + { F|O, "CombineRemoveOriginal" , opt_post_combine_remove_orig , 1. , + "Remove original views after a Combine operation" }, + { F|O, "Link" , opt_post_link , 0. , "Link post-processing views (0=none, 1,2=changes in visible/all, 3,4=everything in visible/all)" }, diff --git a/Common/Options.cpp b/Common/Options.cpp index 1331c4cf24c099f0209c34d9e66ea7eb80b51984..1fc149e0d5ca52ae0dfa7ada3c518ea53c686f2c 100644 --- a/Common/Options.cpp +++ b/Common/Options.cpp @@ -1,4 +1,4 @@ -// $Id: Options.cpp,v 1.183 2004-09-16 19:15:26 geuzaine Exp $ +// $Id: Options.cpp,v 1.184 2004-09-18 01:12:07 geuzaine Exp $ // // Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle // @@ -4173,6 +4173,17 @@ double opt_post_anim_cycle(OPT_ARGS_NUM) return CTX.post.anim_cycle; } +double opt_post_combine_remove_orig(OPT_ARGS_NUM) +{ + if(action & GMSH_SET) + CTX.post.combine_remove_orig = (int)val; +#if defined(HAVE_FLTK) + if(WID && (action & GMSH_GUI)) + WID->post_butt[1]->value(CTX.post.combine_remove_orig); +#endif + return CTX.post.combine_remove_orig; +} + double opt_post_nb_views(OPT_ARGS_NUM) { return List_Nbr(CTX.post.list); diff --git a/Common/Options.h b/Common/Options.h index a7d39948c253cef26baaba666602c71b54b707a2..2f12f06d0547248317c70e1812134686a61dc574 100644 --- a/Common/Options.h +++ b/Common/Options.h @@ -430,6 +430,7 @@ double opt_post_link(OPT_ARGS_NUM); double opt_post_smooth(OPT_ARGS_NUM); double opt_post_anim_delay(OPT_ARGS_NUM); double opt_post_anim_cycle(OPT_ARGS_NUM); +double opt_post_combine_remove_orig(OPT_ARGS_NUM); double opt_post_nb_views(OPT_ARGS_NUM); double opt_view_nb_timestep(OPT_ARGS_NUM); double opt_view_timestep(OPT_ARGS_NUM); diff --git a/Fltk/Callbacks.cpp b/Fltk/Callbacks.cpp index 0df90ee7a224a99f9cb36a451fdee15f914b5456..5816c30363bc719b546fc045254970b06502f3ad 100644 --- a/Fltk/Callbacks.cpp +++ b/Fltk/Callbacks.cpp @@ -1,4 +1,4 @@ -// $Id: Callbacks.cpp,v 1.270 2004-09-16 21:26:30 geuzaine Exp $ +// $Id: Callbacks.cpp,v 1.271 2004-09-18 01:12:07 geuzaine Exp $ // // Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle // @@ -1064,6 +1064,7 @@ void post_options_cb(CALLBACK_ARGS) void post_options_ok_cb(CALLBACK_ARGS) { opt_post_anim_cycle(0, GMSH_SET, WID->post_butt[0]->value()); + opt_post_combine_remove_orig(0, GMSH_SET, WID->post_butt[1]->value()); opt_post_anim_delay(0, GMSH_SET, WID->post_value[0]->value()); @@ -3177,61 +3178,31 @@ void view_duplicate_with_options_cb(CALLBACK_ARGS) void view_combine_all_cb(CALLBACK_ARGS) { - CombineViews(1, 0); - Draw(); -} - -void view_combine_all_and_remove_cb(CALLBACK_ARGS) -{ - CombineViews(1, 1); + CombineViews(1, CTX.post.combine_remove_orig); Draw(); } void view_combine_visible_cb(CALLBACK_ARGS) { - CombineViews(0, 0); - Draw(); -} - -void view_combine_visible_and_remove_cb(CALLBACK_ARGS) -{ - CombineViews(0, 1); + CombineViews(0, CTX.post.combine_remove_orig); Draw(); } void view_combine_time_all_cb(CALLBACK_ARGS) { - CombineViews_Time(1, 0); - Draw(); -} - -void view_combine_time_all_and_remove_cb(CALLBACK_ARGS) -{ - CombineViews_Time(1, 1); + CombineViews_Time(1, CTX.post.combine_remove_orig); Draw(); } void view_combine_time_visible_cb(CALLBACK_ARGS) { - CombineViews_Time(0, 0); - Draw(); -} - -void view_combine_time_visible_and_remove_cb(CALLBACK_ARGS) -{ - CombineViews_Time(0, 1); + CombineViews_Time(0, CTX.post.combine_remove_orig); Draw(); } void view_combine_time_by_name_cb(CALLBACK_ARGS) { - CombineViews_Time(2, 0); - Draw(); -} - -void view_combine_time_by_name_and_remove_cb(CALLBACK_ARGS) -{ - CombineViews_Time(2, 1); + CombineViews_Time(2, CTX.post.combine_remove_orig); Draw(); } diff --git a/Fltk/Callbacks.h b/Fltk/Callbacks.h index a01c68706e3dce8acf9440a7ee48ee65652d414c..a3dd23e0af69e895ef87ca52737a8726e5939fb0 100644 --- a/Fltk/Callbacks.h +++ b/Fltk/Callbacks.h @@ -113,15 +113,10 @@ void view_save_binary_cb(CALLBACK_ARGS) ; void view_duplicate_cb(CALLBACK_ARGS) ; void view_duplicate_with_options_cb(CALLBACK_ARGS) ; void view_combine_all_cb(CALLBACK_ARGS) ; -void view_combine_all_and_remove_cb(CALLBACK_ARGS) ; void view_combine_visible_cb(CALLBACK_ARGS) ; -void view_combine_visible_and_remove_cb(CALLBACK_ARGS) ; void view_combine_time_all_cb(CALLBACK_ARGS) ; -void view_combine_time_all_and_remove_cb(CALLBACK_ARGS) ; void view_combine_time_visible_cb(CALLBACK_ARGS) ; -void view_combine_time_visible_and_remove_cb(CALLBACK_ARGS) ; void view_combine_time_by_name_cb(CALLBACK_ARGS) ; -void view_combine_time_by_name_and_remove_cb(CALLBACK_ARGS) ; void view_applybgmesh_cb(CALLBACK_ARGS) ; void view_options_cb(CALLBACK_ARGS) ; void view_plugin_cb(CALLBACK_ARGS) ; diff --git a/Fltk/GUI.cpp b/Fltk/GUI.cpp index d21334cb494373a5fd3755db91672db22757cdf7..5a261a47a6472ece1b75b705d8d3f30abc0d007b 100644 --- a/Fltk/GUI.cpp +++ b/Fltk/GUI.cpp @@ -1,4 +1,4 @@ -// $Id: GUI.cpp,v 1.344 2004-09-17 21:36:19 geuzaine Exp $ +// $Id: GUI.cpp,v 1.345 2004-09-18 01:12:07 geuzaine Exp $ // // Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle // @@ -1064,24 +1064,14 @@ void GUI::set_context(Context_Item * menu_asked, int flag) (Fl_Callback *) view_duplicate_with_options_cb, (void *)nb, 0); p[j]->add("Combine/Elements/From all views", 0, (Fl_Callback *) view_combine_all_cb, (void *)nb, 0); - p[j]->add("Combine/Elements/From all views (and remove originals)", 0, - (Fl_Callback *) view_combine_all_and_remove_cb, (void *)nb, 0); p[j]->add("Combine/Elements/From visible views", 0, (Fl_Callback *) view_combine_visible_cb, (void *)nb, 0); - p[j]->add("Combine/Elements/From visible views (and remove originals)", 0, - (Fl_Callback *) view_combine_visible_and_remove_cb, (void *)nb, 0); p[j]->add("Combine/Time steps/From all views", 0, (Fl_Callback *) view_combine_time_all_cb, (void *)nb, 0); - p[j]->add("Combine/Time steps/From all views (and remove originals)", 0, - (Fl_Callback *) view_combine_time_all_and_remove_cb, (void *)nb, 0); p[j]->add("Combine/Time steps/From visible views", 0, (Fl_Callback *) view_combine_time_visible_cb, (void *)nb, 0); - p[j]->add("Combine/Time steps/From visible views (and remove originals)", 0, - (Fl_Callback *) view_combine_time_visible_and_remove_cb, (void *)nb, 0); p[j]->add("Combine/Time steps/By view name", 0, (Fl_Callback *) view_combine_time_by_name_cb, (void *)nb, 0); - p[j]->add("Combine/Time steps/By view name (and remove originals)", 0, - (Fl_Callback *) view_combine_time_by_name_and_remove_cb, (void *)nb, 0); p[j]->add("Save as/ASCII view...", 0, (Fl_Callback *) view_save_ascii_cb, (void *)nb, 0); p[j]->add("Save as/Binary view...", 0, @@ -2257,6 +2247,11 @@ void GUI::create_option_window() post_butt[0]->down_box(TOGGLE_BOX); post_butt[0]->selection_color(TOGGLE_COLOR); + post_butt[1] = new Fl_Check_Button(2 * WB, 2 * WB + 4 * BH, BW, BH, "Remove original views after combination"); + post_butt[1]->type(FL_TOGGLE_BUTTON); + post_butt[1]->down_box(TOGGLE_BOX); + post_butt[1]->selection_color(TOGGLE_COLOR); + o->end(); } o->end(); diff --git a/Fltk/Main.cpp b/Fltk/Main.cpp index 24a0b034c0c28b28d2a4a430e954bb8ad9c8ffdb..f8a504e65c32c1312ce808a0b45a2c00d8d5b435 100644 --- a/Fltk/Main.cpp +++ b/Fltk/Main.cpp @@ -1,4 +1,4 @@ -// $Id: Main.cpp,v 1.69 2004-05-17 18:04:54 geuzaine Exp $ +// $Id: Main.cpp,v 1.70 2004-09-18 01:12:08 geuzaine Exp $ // // Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle // @@ -126,7 +126,7 @@ int main(int argc, char *argv[]) for(i = 1; i < nbf; i++) MergeProblem(TheFileNameTab[i]); if(CTX.post.combine_time) - CombineViews_Time(2, 1); + CombineViews_Time(2, CTX.post.combine_remove_orig); if(TheBgmFileName) { MergeProblem(TheBgmFileName); if(List_Nbr(CTX.post.list)) @@ -202,7 +202,7 @@ int main(int argc, char *argv[]) for(i = 1; i < nbf; i++) MergeProblem(TheFileNameTab[i]); if(CTX.post.combine_time) - CombineViews_Time(2, 1); + CombineViews_Time(2, CTX.post.combine_remove_orig); // Init first context diff --git a/Parser/Gmsh.tab.cpp b/Parser/Gmsh.tab.cpp index e4e7e545e82e43c68241f2454fe8bc7d4daad8ca..af33060a3f0ab4a315dea94cdea03b1c4f76316b 100644 --- a/Parser/Gmsh.tab.cpp +++ b/Parser/Gmsh.tab.cpp @@ -192,7 +192,7 @@ #line 1 "Gmsh.y" -// $Id: Gmsh.tab.cpp,v 1.201 2004-09-16 21:26:30 geuzaine Exp $ +// $Id: Gmsh.tab.cpp,v 1.202 2004-09-18 01:12:08 geuzaine Exp $ // // Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle // @@ -7156,9 +7156,9 @@ case 287: #line 2535 "Gmsh.y" { if(!strcmp(yyvsp[-1].c, "Views")) - CombineViews(1, 0); + CombineViews(1, CTX.post.combine_remove_orig); else if(!strcmp(yyvsp[-1].c, "TimeSteps")) - CombineViews_Time(2, 0); + CombineViews_Time(2, CTX.post.combine_remove_orig); else yymsg(GERROR, "Unknown 'Combine' command"); ; diff --git a/Parser/Gmsh.y b/Parser/Gmsh.y index 11db90e2a5e63408dbd4b87f7107d68acc1b48e2..8317ec709d7783432e8bf6b4ff9e8a1226ba53ec 100644 --- a/Parser/Gmsh.y +++ b/Parser/Gmsh.y @@ -1,5 +1,5 @@ %{ -// $Id: Gmsh.y,v 1.176 2004-09-16 21:26:33 geuzaine Exp $ +// $Id: Gmsh.y,v 1.177 2004-09-18 01:12:15 geuzaine Exp $ // // Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle // @@ -2534,9 +2534,9 @@ Command : | tCombine tSTRING tEND { if(!strcmp($2, "Views")) - CombineViews(1, 0); + CombineViews(1, CTX.post.combine_remove_orig); else if(!strcmp($2, "TimeSteps")) - CombineViews_Time(2, 0); + CombineViews_Time(2, CTX.post.combine_remove_orig); else yymsg(GERROR, "Unknown 'Combine' command"); } diff --git a/Parser/Gmsh.yy.cpp b/Parser/Gmsh.yy.cpp index d689434ca1e87006dbc108d90b6bcbd1b8d52ac6..81e43d6d6a0ea2f2adba9d4529036704478904e5 100644 --- a/Parser/Gmsh.yy.cpp +++ b/Parser/Gmsh.yy.cpp @@ -2,7 +2,7 @@ /* A lexical scanner generated by flex */ /* Scanner skeleton version: - * $Header: /cvsroot/gmsh/Parser/Gmsh.yy.cpp,v 1.200 2004-09-16 21:26:33 geuzaine Exp $ + * $Header: /cvsroot/gmsh/Parser/Gmsh.yy.cpp,v 1.201 2004-09-18 01:12:16 geuzaine Exp $ */ #define FLEX_SCANNER @@ -1019,7 +1019,7 @@ char *yytext; #line 1 "Gmsh.l" #define INITIAL 0 #line 2 "Gmsh.l" -// $Id: Gmsh.yy.cpp,v 1.200 2004-09-16 21:26:33 geuzaine Exp $ +// $Id: Gmsh.yy.cpp,v 1.201 2004-09-18 01:12:16 geuzaine Exp $ // // Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle // diff --git a/doc/gmsh.1 b/doc/gmsh.1 index 9c3e20460dbaddb66852984e86ca730b6fb831bf..15d08f16050a7d6765466894feaaa43c2d7053c5 100644 --- a/doc/gmsh.1 +++ b/doc/gmsh.1 @@ -1,4 +1,4 @@ -.\" $Id: gmsh.1,v 1.58 2004-09-17 17:35:53 geuzaine Exp $ +.\" $Id: gmsh.1,v 1.59 2004-09-18 01:12:16 geuzaine Exp $ .TH Gmsh 1 "1 July 2004" "Gmsh 1.54" "Gmsh Manual Pages" .UC 4 .\" ******************************************************************** @@ -103,7 +103,7 @@ hide all views at startup. choose link mode between post-processing views (0, 1, 2, 3, 4). .TP 4 .B \-combine -combine input views into multi time step ones. +combine input views into multi-time-step ones. .\" ******************************************************************** .SH DISPLAY OPTIONS .TP 4 diff --git a/doc/texinfo/command_line.texi b/doc/texinfo/command_line.texi index d3a6df83f8d44d5f7f194d0ce446611cf43be232..669bc52670cc263f1dfbeb44721b18ab030ed521 100644 --- a/doc/texinfo/command_line.texi +++ b/doc/texinfo/command_line.texi @@ -60,7 +60,7 @@ select link mode between views (0, 1, 2, 3, 4) @item -smoothview smooth views @item -combine -combine input views into multi time step ones +combine input views into multi-time-step ones @end ftable @sp 1 diff --git a/doc/texinfo/gmsh.texi b/doc/texinfo/gmsh.texi index fed4d9238cea0a344ed62c0a63f3ad3e05255a05..7b27c1c14ce7340c21687af09963530a38e90f9d 100644 --- a/doc/texinfo/gmsh.texi +++ b/doc/texinfo/gmsh.texi @@ -1,5 +1,5 @@ \input texinfo.tex @c -*-texinfo-*- -@c $Id: gmsh.texi,v 1.131 2004-08-21 19:34:52 geuzaine Exp $ +@c $Id: gmsh.texi,v 1.132 2004-09-18 01:12:16 geuzaine Exp $ @c @c Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle @c @@ -2230,7 +2230,7 @@ Sample post-processing files in human-readable ``parsed'' format @ftable @code @item Combine TimeSteps; Combines the data from all the post-processing views having the same name -into new multi time step views. +into new multi-time-step views. @item Combine Views; Combines all post-processing views in a single new view. diff --git a/doc/texinfo/opt_post.texi b/doc/texinfo/opt_post.texi index dbe60cd774bb49c943b2e13fd28ab7e28981dce4..93b9b311a0530ef8a7ddee8acad4e70f27aeecd7 100644 --- a/doc/texinfo/opt_post.texi +++ b/doc/texinfo/opt_post.texi @@ -9,6 +9,11 @@ Cycle through views instead of time steps in automatic animation mode@* Default value: @code{0}@* Saved in: @code{General.OptionsFileName} +@item PostProcessing.CombineRemoveOriginal +Remove original views after a Combine operation@* +Default value: @code{1}@* +Saved in: @code{General.OptionsFileName} + @item PostProcessing.Link Link post-processing views (0=none, 1,2=changes in visible/all, 3,4=everything in visible/all)@* Default value: @code{0}@*