Skip to content
Snippets Groups Projects
Commit 6c75e5fb authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

save all

parent ab5d5557
Branches
Tags
No related merge requests found
// $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 <sys/types.h>
#include <signal.h> #include <signal.h>
...@@ -216,6 +216,15 @@ void file_save_as_msh_cb(CALLBACK_ARGS) { ...@@ -216,6 +216,15 @@ void file_save_as_msh_cb(CALLBACK_ARGS) {
if((newfile = fl_file_chooser("Save MSH file", "*", NULL))) if((newfile = fl_file_chooser("Save MSH file", "*", NULL)))
CreateOutputFile(newfile, CTX.print.format = CTX.mesh.format = FORMAT_MSH); 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) { void file_save_as_unv_cb(CALLBACK_ARGS) {
char *newfile; char *newfile;
if((newfile = fl_file_chooser("Save UNV file", "*", NULL))) if((newfile = fl_file_chooser("Save UNV file", "*", NULL)))
...@@ -229,15 +238,19 @@ void file_save_as_gref_cb(CALLBACK_ARGS) { ...@@ -229,15 +238,19 @@ void file_save_as_gref_cb(CALLBACK_ARGS) {
void file_save_as_eps_simple_cb(CALLBACK_ARGS) { void file_save_as_eps_simple_cb(CALLBACK_ARGS) {
char *newfile; char *newfile;
if((newfile = fl_file_chooser("Save EPS file", "*", NULL))){ if((newfile = fl_file_chooser("Save EPS file", "*", NULL))){
int old = CTX.print.eps_quality;
CTX.print.eps_quality = 1; CTX.print.eps_quality = 1;
CreateOutputFile(newfile, CTX.print.format = FORMAT_EPS); CreateOutputFile(newfile, CTX.print.format = FORMAT_EPS);
CTX.print.eps_quality = old;
} }
} }
void file_save_as_eps_accurate_cb(CALLBACK_ARGS) { void file_save_as_eps_accurate_cb(CALLBACK_ARGS) {
char *newfile; char *newfile;
if((newfile = fl_file_chooser("Save EPS file", "*", NULL))){ if((newfile = fl_file_chooser("Save EPS file", "*", NULL))){
int old = CTX.print.eps_quality;
CTX.print.eps_quality = 2; CTX.print.eps_quality = 2;
CreateOutputFile(newfile, CTX.print.format = FORMAT_EPS); CreateOutputFile(newfile, CTX.print.format = FORMAT_EPS);
CTX.print.eps_quality = old;
} }
} }
void file_save_as_jpeg_cb(CALLBACK_ARGS) { void file_save_as_jpeg_cb(CALLBACK_ARGS) {
...@@ -249,25 +262,37 @@ 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) { void file_save_as_gif_cb(CALLBACK_ARGS) {
char *newfile; char *newfile;
if((newfile = fl_file_chooser("Save GIF file", "*", NULL))){ 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_dither = 0;
CTX.print.gif_transparent = 0; CTX.print.gif_transparent = 0;
CreateOutputFile(newfile, CTX.print.format = FORMAT_GIF); 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) { void file_save_as_gif_dithered_cb(CALLBACK_ARGS) {
char *newfile; char *newfile;
if((newfile = fl_file_chooser("Save GIF file", "*", NULL))){ 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_dither = 1;
CTX.print.gif_transparent = 0; CTX.print.gif_transparent = 0;
CreateOutputFile(newfile, CTX.print.format = FORMAT_GIF); 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) { void file_save_as_gif_transparent_cb(CALLBACK_ARGS) {
char *newfile; char *newfile;
if((newfile = fl_file_chooser("Save GIF file", "*", NULL))){ 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_dither = 0;
CTX.print.gif_transparent = 1; CTX.print.gif_transparent = 1;
CreateOutputFile(newfile, CTX.print.format = FORMAT_GIF); 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) { void file_save_as_ppm_cb(CALLBACK_ARGS) {
...@@ -1166,6 +1191,12 @@ void geometry_physical_add_volume_cb (CALLBACK_ARGS){ ...@@ -1166,6 +1191,12 @@ void geometry_physical_add_volume_cb (CALLBACK_ARGS){
void mesh_save_cb(CALLBACK_ARGS) { void mesh_save_cb(CALLBACK_ARGS) {
Print_Mesh(&M, CTX.output_filename, CTX.mesh.format); 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){ void mesh_define_cb(CALLBACK_ARGS){
WID->set_context(menu_mesh_define, 0); WID->set_context(menu_mesh_define, 0);
} }
......
...@@ -26,6 +26,7 @@ void file_save_as_auto_cb(CALLBACK_ARGS) ; ...@@ -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_cb(CALLBACK_ARGS) ;
void file_save_as_geo_options_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_cb(CALLBACK_ARGS) ;
void file_save_as_msh_all_cb(CALLBACK_ARGS) ;
void file_save_as_unv_cb(CALLBACK_ARGS) ; void file_save_as_unv_cb(CALLBACK_ARGS) ;
void file_save_as_gref_cb(CALLBACK_ARGS) ; void file_save_as_gref_cb(CALLBACK_ARGS) ;
void file_save_as_eps_simple_cb(CALLBACK_ARGS) ; void file_save_as_eps_simple_cb(CALLBACK_ARGS) ;
...@@ -176,6 +177,7 @@ void con_geometry_define_symmetry_cb(CALLBACK_ARGS) ; ...@@ -176,6 +177,7 @@ void con_geometry_define_symmetry_cb(CALLBACK_ARGS) ;
// Dynamic Mesh Menus // Dynamic Mesh Menus
void mesh_save_cb(CALLBACK_ARGS) ; void mesh_save_cb(CALLBACK_ARGS) ;
void mesh_save_all_cb(CALLBACK_ARGS) ;
void mesh_define_cb(CALLBACK_ARGS) ; void mesh_define_cb(CALLBACK_ARGS) ;
void mesh_1d_cb(CALLBACK_ARGS) ; void mesh_1d_cb(CALLBACK_ARGS) ;
void mesh_2d_cb(CALLBACK_ARGS) ; void mesh_2d_cb(CALLBACK_ARGS) ;
......
// $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: // To make the interface as visually consistent as possible, please:
// - use the BH, BW, WB, IW values for button heights/widths, window borders, etc. // - use the BH, BW, WB, IW values for button heights/widths, window borders, etc.
...@@ -43,6 +43,7 @@ Fl_Menu_Item m_menubar_table[] = { ...@@ -43,6 +43,7 @@ Fl_Menu_Item m_menubar_table[] = {
{"Save as", 0, 0, 0, FL_MENU_DIVIDER|FL_SUBMENU}, {"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}, {"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 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}, {"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}, {"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}, {"GEO flattened geometry...", 0, (Fl_Callback *)file_save_as_geo_cb, 0},
...@@ -124,8 +125,8 @@ Context_Item menu_geometry[] = ...@@ -124,8 +125,8 @@ Context_Item menu_geometry[] =
{ "B-Spline", (Fl_Callback *)geometry_elementary_add_new_bspline_cb } , { "B-Spline", (Fl_Callback *)geometry_elementary_add_new_bspline_cb } ,
{ "Circle", (Fl_Callback *)geometry_elementary_add_new_circle_cb } , { "Circle", (Fl_Callback *)geometry_elementary_add_new_circle_cb } ,
{ "Ellipsis", (Fl_Callback *)geometry_elementary_add_new_ellipsis_cb } , { "Ellipsis", (Fl_Callback *)geometry_elementary_add_new_ellipsis_cb } ,
{ "Plane Surface", (Fl_Callback *)geometry_elementary_add_new_planesurface_cb } , { "Plane surface", (Fl_Callback *)geometry_elementary_add_new_planesurface_cb } ,
{ "Ruled Surface", (Fl_Callback *)geometry_elementary_add_new_ruledsurface_cb } , { "Ruled surface", (Fl_Callback *)geometry_elementary_add_new_ruledsurface_cb } ,
{ "Volume", (Fl_Callback *)geometry_elementary_add_new_volume_cb } , { "Volume", (Fl_Callback *)geometry_elementary_add_new_volume_cb } ,
{ NULL } { NULL }
}; };
...@@ -233,6 +234,7 @@ Context_Item menu_mesh[] = ...@@ -233,6 +234,7 @@ Context_Item menu_mesh[] =
{ "2D", (Fl_Callback *)mesh_2d_cb } , { "2D", (Fl_Callback *)mesh_2d_cb } ,
{ "3D", (Fl_Callback *)mesh_3d_cb } , { "3D", (Fl_Callback *)mesh_3d_cb } ,
{ "Save", (Fl_Callback *)mesh_save_cb } , { "Save", (Fl_Callback *)mesh_save_cb } ,
{ "Save all", (Fl_Callback *)mesh_save_all_cb } ,
{ NULL } { NULL }
}; };
Context_Item menu_mesh_define[] = Context_Item menu_mesh_define[] =
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment