diff --git a/Fltk/Callbacks.cpp b/Fltk/Callbacks.cpp index bc9a1d791b395566806474611a74f2c6efff5381..5c0348df1891a0d2ebc6b474565d1d032406e60e 100644 --- a/Fltk/Callbacks.cpp +++ b/Fltk/Callbacks.cpp @@ -1,4 +1,4 @@ -// $Id: Callbacks.cpp,v 1.209 2004-03-05 23:47:35 geuzaine Exp $ +// $Id: Callbacks.cpp,v 1.210 2004-03-13 19:24:12 geuzaine Exp $ // // Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle // @@ -61,9 +61,9 @@ extern Context_T CTX; static char *fn = NULL; int file_chooser(int multi, int create, const char *message, - const char *pat, int patindex) + const char *pat, int patindex, char *fname=NULL) { - fn = fl_file_chooser(message, pat, NULL); + fn = fl_file_chooser(message, pat, fname); if(fn) return 1; else @@ -88,7 +88,7 @@ int file_chooser_get_filter() static Fl_File_Chooser *fc = NULL; int file_chooser(int multi, int create, const char *message, - const char *pat, int patindex) + const char *pat, int patindex, char *fname=NULL) { static char oldfilter[1024]; @@ -102,6 +102,9 @@ int file_chooser(int multi, int create, const char *message, fc->label(message); + if(fname) + fc->value(fname); + if(strncmp(oldfilter, pat, 1024)) { strncpy(oldfilter, pat, 1024); fc->filter(pat); @@ -2911,8 +2914,11 @@ void view_remove_cb(CALLBACK_ARGS) void view_save_ascii_cb(CALLBACK_ARGS) { + Post_View *v = (Post_View *) List_Pointer(CTX.post.list, (long int)data); + if(!v) return; + test: - if(file_chooser(0, 1, "Save view in ASCII format", "*", 0)) { + if(file_chooser(0, 1, "Save view in ASCII format", "*", 0, v->FileName)) { char *name = file_chooser_get_name(1); if(CTX.confirm_overwrite) { struct stat buf; @@ -2923,15 +2929,17 @@ test: goto test; } save: - WriteView((Post_View *) List_Pointer(CTX.post.list, (long int)data), - name, 0, 0); + WriteView(v, name, 0, 0); } } void view_save_binary_cb(CALLBACK_ARGS) { + Post_View *v = (Post_View *) List_Pointer(CTX.post.list, (long int)data); + if(!v) return; + test: - if(file_chooser(0, 1, "Save view in binary format", "*", 0)) { + if(file_chooser(0, 1, "Save view in binary format", "*", 0, v->FileName)) { char *name = file_chooser_get_name(1); if(CTX.confirm_overwrite) { struct stat buf; @@ -2942,8 +2950,7 @@ test: goto test; } save: - WriteView((Post_View *) List_Pointer(CTX.post.list, (long int)data), - name, 1, 0); + WriteView(v, name, 1, 0); } } diff --git a/Plugin/Extract.cpp b/Plugin/Extract.cpp index 7e99885d70d194fd15aa77b29837405963b5c40c..bf70b74465f504ace8cf1d1c8004982bd10d4741 100644 --- a/Plugin/Extract.cpp +++ b/Plugin/Extract.cpp @@ -1,4 +1,4 @@ -// $Id: Extract.cpp,v 1.3 2004-03-08 23:15:25 geuzaine Exp $ +// $Id: Extract.cpp,v 1.4 2004-03-13 19:24:12 geuzaine Exp $ // // Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle // @@ -173,8 +173,8 @@ Post_View *GMSH_ExtractPlugin::execute(Post_View * v) List_Add(view->Time, List_Pointer(vv->Time, i)); // finalize char name[1024], filename[1024]; - sprintf(name, "extract-%s", vv->Name); - sprintf(filename, "extract-%s", vv->FileName); + sprintf(name, "%s_Extract_%d", vv->Name, iComp); + sprintf(filename, "%s_Extract_%d.pos", vv->Name, iComp); EndView(view, 1, filename, name); } diff --git a/Plugin/Harmonic2Time.cpp b/Plugin/Harmonic2Time.cpp index 3fa29c3d61ea0665fad3d6d0cf5e9a4dff955f5a..8b588859501fe13bdb26c8b00c671f46969ea983 100644 --- a/Plugin/Harmonic2Time.cpp +++ b/Plugin/Harmonic2Time.cpp @@ -1,4 +1,4 @@ -// $Id: Harmonic2Time.cpp,v 1.11 2004-02-07 01:40:30 geuzaine Exp $ +// $Id: Harmonic2Time.cpp,v 1.12 2004-03-13 19:24:12 geuzaine Exp $ // // Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle // @@ -137,11 +137,9 @@ Post_View *GMSH_Harmonic2TimePlugin::execute(Post_View * v) // FIXME: todo // finalize char name[1024], filename[1024]; - sprintf(name, "h2t-%s", vv->Name); - sprintf(filename, "h2t-%s", vv->FileName); + sprintf(name, "%s_Harmonic2Time", vv->Name); + sprintf(filename, "%s_Harmonic2Time.pos", vv->Name); EndView(View, 1, filename, name); - Msg(INFO, "Created view '%s'", name); - return View; } return 0; diff --git a/Plugin/Levelset.cpp b/Plugin/Levelset.cpp index ee1e858118f6eea3c210805f575dea34ff7d441e..69cd4ea7d0ba9cdf3ff76f01692295b79cd4911b 100644 --- a/Plugin/Levelset.cpp +++ b/Plugin/Levelset.cpp @@ -1,4 +1,4 @@ -// $Id: Levelset.cpp,v 1.12 2004-02-07 01:40:30 geuzaine Exp $ +// $Id: Levelset.cpp,v 1.13 2004-03-13 19:24:12 geuzaine Exp $ // // Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle // @@ -526,8 +526,8 @@ Post_View *GMSH_LevelsetPlugin::execute(Post_View * v) // FIXME: todo // finalize char name[1024], filename[1024]; - sprintf(name, "cut-%s-%d", v->Name, i); - sprintf(filename, "cut-%s-%d", v->FileName, i); + sprintf(name, "%s_Levelset_%d", v->Name, i); + sprintf(filename, "%s_Levelset_%d.pos", v->Name, i); EndView(out[i], 1, filename, name); } diff --git a/Plugin/Skin.cpp b/Plugin/Skin.cpp index 1f501ed122f64a551ca2ce1db9759dfc0d793732..a08af449bd00d2077df953b2ffe9922122ff6dd3 100644 --- a/Plugin/Skin.cpp +++ b/Plugin/Skin.cpp @@ -1,4 +1,4 @@ -// $Id: Skin.cpp,v 1.24 2004-02-07 01:40:30 geuzaine Exp $ +// $Id: Skin.cpp,v 1.25 2004-03-13 19:24:12 geuzaine Exp $ // // Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle // @@ -288,8 +288,8 @@ Post_View *GMSH_SkinPlugin::execute(Post_View * v) List_Add(view->Time, List_Pointer(vv->Time, i)); // finalize char name[1024], filename[1024]; - sprintf(name, "skin-%s", vv->Name); - sprintf(filename, "skin-%s", vv->FileName); + sprintf(name, "%s_Skin", vv->Name); + sprintf(filename, "%s_Skin.pos", vv->Name); EndView(view, 1, filename, name); } diff --git a/Plugin/Triangulate.cpp b/Plugin/Triangulate.cpp index 19b71403a8bc89f94c5a99f78029c46a3cd8db63..c2df53f4ae13525bc54d40cdb2a68c94aac30cd9 100644 --- a/Plugin/Triangulate.cpp +++ b/Plugin/Triangulate.cpp @@ -1,4 +1,4 @@ -// $Id: Triangulate.cpp,v 1.18 2004-02-07 01:40:30 geuzaine Exp $ +// $Id: Triangulate.cpp,v 1.19 2004-03-13 19:24:12 geuzaine Exp $ // // Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle // @@ -227,16 +227,11 @@ Post_View *GMSH_TriangulatePlugin::execute(Post_View * v) List_Add(View->Time, List_Pointer(vv->Time, i)); // finalize char name[1024], filename[1024]; - sprintf(name, "triangulate-%s", vv->Name); - sprintf(filename, "triangulate-%s", vv->FileName); + sprintf(name, "%s_Triangulate", vv->Name); + sprintf(filename, "%s_Triangulate.pos", vv->Name); EndView(View, 1, filename, name); - Msg(INFO, "Created view '%s'", name); - return View; - } - else { - Msg(WARNING, "No scalar points to triangulate in View[%d]", vv->Index); - return 0; } + return 0; } diff --git a/TODO b/TODO index b94a98b58d27593dba5f99932277a1bd3a50d144..43f80dddd07c16df7b095638bb3d36621c1d695d 100644 --- a/TODO +++ b/TODO @@ -1,4 +1,8 @@ -$Id: TODO,v 1.36 2004-03-10 15:31:46 geuzaine Exp $ +$Id: TODO,v 1.37 2004-03-13 19:24:12 geuzaine Exp $ + +add some code to make the node/element list ordered+dense (with no +gaps)? this seems to be one common problem users have with our mesh +format... ********************************************************************