diff --git a/Fltk/GUI_Projection.cpp b/Fltk/GUI_Projection.cpp index b4df0ec02e7cb7828b64eab91c6e7075edc61f62..1d4f2ddd57adb065ac0b73fae6b74585d5376c8e 100644 --- a/Fltk/GUI_Projection.cpp +++ b/Fltk/GUI_Projection.cpp @@ -762,20 +762,21 @@ void action_cb(Fl_Widget *w, void *data) delete_fourier(faces[i]); } else{ - char *filename = "patches.fm"; - FILE *fp = fopen(filename, "w+"); - if(!fp){ - printf("Unable to open file '%s'\n", filename); - return; - } - fprintf(fp, "%d\n", (int)faces.size()); - for(unsigned int i = 0; i < faces.size(); i++){ - FFace* ff = (FFace*)faces[i]; - ff->GetFMFace()->GetPatch()->Export(fp); + if(file_chooser(0, 1, "Save Fourier Model", "*.fm")){ + FILE *fp = fopen(file_chooser_get_name(1), "w"); + if(!fp){ + Msg(GERROR, "Unable to open file `%s'", file_chooser_get_name(1)); + return; + } + fprintf(fp, "%d\n", (int)faces.size()); + for(unsigned int i = 0; i < faces.size(); i++){ + FFace* ff = (FFace*)faces[i]; + ff->GetFMFace()->GetPatch()->Export(fp); + } + fclose(fp); } - fclose(fp); } - + Draw(); }