From 6c75e5fb4ca1720e285d0fa29aadbd416052bcf5 Mon Sep 17 00:00:00 2001
From: Christophe Geuzaine <cgeuzaine@ulg.ac.be>
Date: Thu, 6 Sep 2001 06:38:48 +0000
Subject: [PATCH] save all

---
 Fltk/Callbacks.cpp | 33 ++++++++++++++++++++++++++++++++-
 Fltk/Callbacks.h   |  2 ++
 Fltk/GUI.cpp       |  8 +++++---
 3 files changed, 39 insertions(+), 4 deletions(-)

diff --git a/Fltk/Callbacks.cpp b/Fltk/Callbacks.cpp
index 604a07ae56..8c596576a9 100644
--- a/Fltk/Callbacks.cpp
+++ b/Fltk/Callbacks.cpp
@@ -1,4 +1,4 @@
-// $Id: Callbacks.cpp,v 1.82 2001-08-23 18:03:45 geuzaine Exp $
+// $Id: Callbacks.cpp,v 1.83 2001-09-06 06:38:48 geuzaine Exp $
 
 #include <sys/types.h>
 #include <signal.h>
@@ -216,6 +216,15 @@ void file_save_as_msh_cb(CALLBACK_ARGS) {
   if((newfile = fl_file_chooser("Save MSH file", "*", NULL)))
     CreateOutputFile(newfile, CTX.print.format = CTX.mesh.format = FORMAT_MSH); 
 }
+void file_save_as_msh_all_cb(CALLBACK_ARGS) {
+  char *newfile;
+  if((newfile = fl_file_chooser("Save MSH file (no physicals)", "*", NULL))){
+    int all = CTX.mesh.save_all;
+    CTX.mesh.save_all = 1;
+    CreateOutputFile(newfile, CTX.print.format = CTX.mesh.format = FORMAT_MSH); 
+    CTX.mesh.save_all = all;
+  }
+}
 void file_save_as_unv_cb(CALLBACK_ARGS) {
   char *newfile;
   if((newfile = fl_file_chooser("Save UNV file", "*", NULL)))
@@ -229,15 +238,19 @@ void file_save_as_gref_cb(CALLBACK_ARGS) {
 void file_save_as_eps_simple_cb(CALLBACK_ARGS) {
   char *newfile;
   if((newfile = fl_file_chooser("Save EPS file", "*", NULL))){
+    int old = CTX.print.eps_quality;
     CTX.print.eps_quality = 1; 
     CreateOutputFile(newfile, CTX.print.format = FORMAT_EPS); 
+    CTX.print.eps_quality = old; 
   }
 }
 void file_save_as_eps_accurate_cb(CALLBACK_ARGS) {
   char *newfile;
   if((newfile = fl_file_chooser("Save EPS file", "*", NULL))){
+    int old = CTX.print.eps_quality;
     CTX.print.eps_quality = 2; 
     CreateOutputFile(newfile, CTX.print.format = FORMAT_EPS); 
+    CTX.print.eps_quality = old; 
   }
 }
 void file_save_as_jpeg_cb(CALLBACK_ARGS) {
@@ -249,25 +262,37 @@ void file_save_as_jpeg_cb(CALLBACK_ARGS) {
 void file_save_as_gif_cb(CALLBACK_ARGS) {
   char *newfile;
   if((newfile = fl_file_chooser("Save GIF file", "*", NULL))){
+    int dither = CTX.print.gif_dither;
+    int transp = CTX.print.gif_transparent;
     CTX.print.gif_dither = 0;
     CTX.print.gif_transparent = 0;
     CreateOutputFile(newfile, CTX.print.format = FORMAT_GIF); 
+    CTX.print.gif_dither = dither;
+    CTX.print.gif_transparent = transp;
   }
 }
 void file_save_as_gif_dithered_cb(CALLBACK_ARGS) {
   char *newfile;
   if((newfile = fl_file_chooser("Save GIF file", "*", NULL))){
+    int dither = CTX.print.gif_dither;
+    int transp = CTX.print.gif_transparent;
     CTX.print.gif_dither = 1; 
     CTX.print.gif_transparent = 0; 
     CreateOutputFile(newfile, CTX.print.format = FORMAT_GIF); 
+    CTX.print.gif_dither = dither;
+    CTX.print.gif_transparent = transp;
   }
 }
 void file_save_as_gif_transparent_cb(CALLBACK_ARGS) {
   char *newfile;
   if((newfile = fl_file_chooser("Save GIF file", "*", NULL))){
+    int dither = CTX.print.gif_dither;
+    int transp = CTX.print.gif_transparent;
     CTX.print.gif_dither = 0;
     CTX.print.gif_transparent = 1; 
     CreateOutputFile(newfile, CTX.print.format = FORMAT_GIF);
+    CTX.print.gif_dither = dither;
+    CTX.print.gif_transparent = transp;
   }
 }
 void file_save_as_ppm_cb(CALLBACK_ARGS) {
@@ -1166,6 +1191,12 @@ void geometry_physical_add_volume_cb (CALLBACK_ARGS){
 void mesh_save_cb(CALLBACK_ARGS) {
   Print_Mesh(&M, CTX.output_filename, CTX.mesh.format);
 }
+void mesh_save_all_cb(CALLBACK_ARGS) {
+  int all = CTX.mesh.save_all;
+  CTX.mesh.save_all = 1;
+  Print_Mesh(&M, CTX.output_filename, CTX.mesh.format);
+  CTX.mesh.save_all = all;
+}
 void mesh_define_cb(CALLBACK_ARGS){
   WID->set_context(menu_mesh_define, 0);
 }
diff --git a/Fltk/Callbacks.h b/Fltk/Callbacks.h
index d679f50dd1..1657d23840 100644
--- a/Fltk/Callbacks.h
+++ b/Fltk/Callbacks.h
@@ -26,6 +26,7 @@ void file_save_as_auto_cb(CALLBACK_ARGS) ;
 void file_save_as_geo_cb(CALLBACK_ARGS) ;
 void file_save_as_geo_options_cb(CALLBACK_ARGS) ;
 void file_save_as_msh_cb(CALLBACK_ARGS) ;
+void file_save_as_msh_all_cb(CALLBACK_ARGS) ;
 void file_save_as_unv_cb(CALLBACK_ARGS) ;
 void file_save_as_gref_cb(CALLBACK_ARGS) ;
 void file_save_as_eps_simple_cb(CALLBACK_ARGS) ;
@@ -176,6 +177,7 @@ void con_geometry_define_symmetry_cb(CALLBACK_ARGS) ;
 // Dynamic Mesh Menus
 
 void mesh_save_cb(CALLBACK_ARGS) ;
+void mesh_save_all_cb(CALLBACK_ARGS) ;
 void mesh_define_cb(CALLBACK_ARGS) ;
 void mesh_1d_cb(CALLBACK_ARGS) ;
 void mesh_2d_cb(CALLBACK_ARGS) ; 
diff --git a/Fltk/GUI.cpp b/Fltk/GUI.cpp
index 8ff269406f..3c6fd118ac 100644
--- a/Fltk/GUI.cpp
+++ b/Fltk/GUI.cpp
@@ -1,4 +1,4 @@
-// $Id: GUI.cpp,v 1.112 2001-08-28 20:40:21 geuzaine Exp $
+// $Id: GUI.cpp,v 1.113 2001-09-06 06:38:48 geuzaine Exp $
 
 // To make the interface as visually consistent as possible, please:
 // - use the BH, BW, WB, IW values for button heights/widths, window borders, etc.
@@ -43,6 +43,7 @@ Fl_Menu_Item m_menubar_table[] = {
     {"Save as",          0, 0, 0, FL_MENU_DIVIDER|FL_SUBMENU},
       {"By extension...",        FL_CTRL+'p', (Fl_Callback *)file_save_as_auto_cb, 0, FL_MENU_DIVIDER},
       {"MSH native mesh format...",       0, (Fl_Callback *)file_save_as_msh_cb, 0},
+      {"MSH without physicals...",        0, (Fl_Callback *)file_save_as_msh_all_cb, 0},
       {"UNV universal mesh format...",    0, (Fl_Callback *)file_save_as_unv_cb, 0},
       {"GREF gref mesh format...",        0, (Fl_Callback *)file_save_as_gref_cb, 0},
       {"GEO flattened geometry...",       0, (Fl_Callback *)file_save_as_geo_cb, 0},
@@ -124,8 +125,8 @@ Context_Item menu_geometry[] =
 	      { "B-Spline",      (Fl_Callback *)geometry_elementary_add_new_bspline_cb } ,
 	      { "Circle",        (Fl_Callback *)geometry_elementary_add_new_circle_cb } ,
 	      { "Ellipsis",      (Fl_Callback *)geometry_elementary_add_new_ellipsis_cb } ,
-	      { "Plane Surface", (Fl_Callback *)geometry_elementary_add_new_planesurface_cb } ,
-	      { "Ruled Surface", (Fl_Callback *)geometry_elementary_add_new_ruledsurface_cb } ,
+	      { "Plane surface", (Fl_Callback *)geometry_elementary_add_new_planesurface_cb } ,
+	      { "Ruled surface", (Fl_Callback *)geometry_elementary_add_new_ruledsurface_cb } ,
 	      { "Volume",        (Fl_Callback *)geometry_elementary_add_new_volume_cb } ,
 	      { NULL } 
 	    };  
@@ -233,6 +234,7 @@ Context_Item menu_mesh[] =
   { "2D",     (Fl_Callback *)mesh_2d_cb } , 
   { "3D",     (Fl_Callback *)mesh_3d_cb } , 
   { "Save",   (Fl_Callback *)mesh_save_cb } ,
+  { "Save all", (Fl_Callback *)mesh_save_all_cb } ,
   { NULL } 
 };  
     Context_Item menu_mesh_define[] = 
-- 
GitLab