diff --git a/Motif/Bitmaps.h b/Common/Bitmaps.h similarity index 100% rename from Motif/Bitmaps.h rename to Common/Bitmaps.h diff --git a/Motif/Help.h b/Common/Help.h similarity index 100% rename from Motif/Help.h rename to Common/Help.h diff --git a/Fltk/Callbacks.cpp b/Fltk/Callbacks.cpp index 20628b02cc80d076d142a14d7ef57e0d5fdf557e..8e55fb35ee1a009ebf192d69ebe2b21e8b89b3dd 100644 --- a/Fltk/Callbacks.cpp +++ b/Fltk/Callbacks.cpp @@ -1,3 +1,4 @@ +// $Id: Callbacks.cpp,v 1.2 2001-01-09 08:58:37 geuzaine Exp $ #include "Gmsh.h" #include "GmshUI.h" @@ -5,19 +6,130 @@ #include "Mesh.h" #include "Draw.h" #include "Views.h" +#include "Timer.h" #include "OpenFile.h" #include "Context.h" #include "GUI.h" +#include "Callbacks.h" #include <FL/fl_file_chooser.H> -extern GUI *WID; -extern Mesh M; -extern Context_T CTX; +extern GUI *WID; +extern Mesh M; +extern Context_T CTX; +extern List_T *Post_ViewList; + +// Compatibility routines + +int AddViewInUI(int i, char *Name, int Num){ + if(i > NB_BUTT_MAX -1) return 1; + if(WID->get_context() == 2) + WID->set_context(menu_post,0); + return 0; +} + +void MarkAllViewsChanged(int action){ + int i; + Post_View *v; + + for(i = 0 ; i< List_Nbr(Post_ViewList) ; i++){ + v = (Post_View*)List_Pointer(Post_ViewList, i); + switch(action){ + case 1: // toggle drawing mode + if(v->IntervalsType == DRAW_POST_ISO) + v->IntervalsType = DRAW_POST_DISCRETE ; + else if(v->IntervalsType == DRAW_POST_DISCRETE) + v->IntervalsType = DRAW_POST_CONTINUOUS ; + else + v->IntervalsType = DRAW_POST_ISO ; + break; + case 2: // time step++ + if(v->TimeStep < v->NbTimeStep-1) + v->TimeStep++ ; + else + v->TimeStep = 0 ; + break; + case 3: // time step-- + if(v->TimeStep > 0) + v->TimeStep-- ; + else + v->TimeStep = v->NbTimeStep-1 ; + } + v->Changed = 1 ; + } +} + +void CancelMeshThread(void){ + +} + +// Graphical window + +void status_xyz1p_cb(CALLBACK_ARGS){ + + extern void set_r(int i, double val); + extern void set_t(int i, double val); + extern void set_s(int i, double val); + + switch((int)data){ + case 0 : + if(CTX.useTrackball) + CTX.setQuaternion(0.,-1./sqrt(2.),0.,1./sqrt(2.)); + set_r(0,0.); set_r(1,90.);set_r(2,0.); + Init(); Draw(); + break; + case 1 : + if(CTX.useTrackball) + CTX.setQuaternion(1./sqrt(2.),0.,0.,1./sqrt(2.)); + set_r(0,-90.);set_r(1,0.); set_r(2,0.); + Init(); Draw(); + break; + case 2 : + if(CTX.useTrackball) + CTX.setQuaternion(0.,0.,0.,1.); + set_r(0,0.); set_r(1,0.); set_r(2,0.); + Init(); Draw(); + break; + case 3 : + set_t(0,0.); set_t(1,0.); set_t(2,0.); + set_s(0,1.); set_s(1,1.); set_s(2,1.); + Init(); Draw(); + break; + case 4 : + Print_Context(NULL); + break ; + } +} + +static int stop_anim ; +void status_play_cb(CALLBACK_ARGS){ + static long anim_time ; + WID->set_anim(0); + stop_anim = 0 ; + anim_time = GetTime(); + while(1){ + if(stop_anim) break ; + WID->check(); + if(GetTime() - anim_time > CTX.post.anim_delay){ + anim_time = GetTime(); + MarkAllViewsChanged(2); + Init(); Draw(); + } + } +} + +void status_pause_cb(CALLBACK_ARGS){ + stop_anim = 1; + WID->set_anim(1); +} + +void status_cancel_cb(CALLBACK_ARGS){ + CancelMeshThread(); +} // File Menu -void file_open_cb(void) { +void file_open_cb(CALLBACK_ARGS) { char *newfile; newfile = fl_file_chooser("Open File", "*.geo", NULL); if (newfile != NULL) { @@ -27,7 +139,7 @@ void file_open_cb(void) { } } -void file_merge_cb(void) { +void file_merge_cb(CALLBACK_ARGS) { char *newfile; newfile = fl_file_chooser("Merge File", "*.{geo,pos,msh}", NULL); if (newfile != NULL) { @@ -37,76 +149,442 @@ void file_merge_cb(void) { } } -void file_save_cb(void) { +void file_save_cb(CALLBACK_ARGS) { + Print_Mesh(&M, NULL, CTX.mesh.format); } -void file_save_as_cb(void) { +void file_save_as_cb(CALLBACK_ARGS) { + char *newfile; + newfile = fl_file_chooser("Save File", "*.{geo,pos,msh}", NULL); + void CreateFile (char *name, int format) ; + if (newfile != NULL) + CreateFile(newfile, FORMAT_AUTO); } -void file_reload_all_views_cb(void) { +static int RELOAD_ALL_VIEWS = 0 ; + +void file_reload_all_views_cb(CALLBACK_ARGS) { + if(!Post_ViewList) return; + RELOAD_ALL_VIEWS = 1; + for(int i = 1 ; i<=List_Nbr(Post_ViewList) ; i++) + view_reload_cb(NULL, (void *)i); + RELOAD_ALL_VIEWS = 0; + Init(); + Draw(); } -void file_remove_all_views_cb(void) { +static int REMOVE_ALL_VIEWS = 0 ; + +void file_remove_all_views_cb(CALLBACK_ARGS) { + if(!Post_ViewList) return; + REMOVE_ALL_VIEWS = 1; + while(List_Nbr(Post_ViewList)) + view_remove_cb(NULL, (void*)1); + REMOVE_ALL_VIEWS = 0; + Init(); + Draw(); } -void file_quit_cb(void) { +void file_quit_cb(CALLBACK_ARGS) { exit(0); } // Option Menu -void opt_general_cb(void) { +void opt_general_cb(CALLBACK_ARGS) { WID->opt_general(); } - -void opt_geometry_cb(void) { +void opt_geometry_cb(CALLBACK_ARGS) { + WID->opt_geometry(); } -void opt_mesh_cb(void) { +void opt_mesh_cb(CALLBACK_ARGS) { + WID->opt_mesh(); } -void opt_post_cb(void) { +void opt_post_cb(CALLBACK_ARGS) { + WID->opt_post(); } -void opt_stat_cb(void) { +void opt_stat_cb(CALLBACK_ARGS) { + WID->opt_stat(); } // Help Menu -void help_short_cb(void){ +void help_short_cb(CALLBACK_ARGS){ + WID->help_short(); } -void help_about_cb(void){ +void help_about_cb(CALLBACK_ARGS){ + WID->help_about(); } // Module Menu -void mod_geometry_cb(void){ +void mod_geometry_cb(CALLBACK_ARGS){ + WID->set_context(menu_geometry, 0); +} +void mod_mesh_cb(CALLBACK_ARGS){ + WID->set_context(menu_mesh, 0); } -void mod_mesh_cb(void){ +void mod_post_cb(CALLBACK_ARGS){ + WID->set_context(menu_post, 0); } -void mod_post_cb(void){ +void mod_back_cb(CALLBACK_ARGS){ + WID->set_context(NULL, -1); +} +void mod_forward_cb(CALLBACK_ARGS){ + WID->set_context(NULL, 1); } -// View Menus +// Dynamic Menus -void view_reload_cb(Fl_Widget* w, void* data){ - printf("Reload view %d \n", (int)data); +void geometry_elementary_cb(CALLBACK_ARGS){ + WID->set_context(menu_geometry_elementary, 0); +} +void geometry_physical_cb(CALLBACK_ARGS){ + WID->set_context(menu_geometry_physical, 0); +} +void geometry_reload_cb(CALLBACK_ARGS){ + printf("reload geometry\n"); +} +void geometry_elementary_add_cb(CALLBACK_ARGS){ + WID->set_context(menu_geometry_elementary_add, 0); +} +void geometry_elementary_translate_cb(CALLBACK_ARGS){ + WID->set_context(menu_geometry_elementary_translate, 0); +} +void geometry_elementary_rotate_cb(CALLBACK_ARGS){ + WID->set_context(menu_geometry_elementary_rotate, 0); +} +void geometry_elementary_dilate_cb(CALLBACK_ARGS){ + WID->set_context(menu_geometry_elementary_dilate, 0); +} +void geometry_elementary_symmetry_cb(CALLBACK_ARGS){ + WID->set_context(menu_geometry_elementary_symmetry, 0); +} +void geometry_elementary_extrude_cb(CALLBACK_ARGS){ + WID->set_context(menu_geometry_elementary_extrude, 0); +} +void geometry_elementary_delete_cb(CALLBACK_ARGS){ + WID->set_context(menu_geometry_elementary_delete, 0); +} +void geometry_elementary_add_new_cb(CALLBACK_ARGS){ + WID->set_context(menu_geometry_elementary_add_new, 0); +} +void geometry_elementary_add_translate_cb(CALLBACK_ARGS){ + WID->set_context(menu_geometry_elementary_add_translate, 0); +} +void geometry_elementary_add_rotate_cb(CALLBACK_ARGS){ + WID->set_context(menu_geometry_elementary_add_rotate, 0); +} +void geometry_elementary_add_dilate_cb(CALLBACK_ARGS){ + WID->set_context(menu_geometry_elementary_add_dilate, 0); +} +void geometry_elementary_add_symmetry_cb(CALLBACK_ARGS){ + WID->set_context(menu_geometry_elementary_add_symmetry, 0); +} +void geometry_elementary_add_new_parameter_cb(CALLBACK_ARGS){ + printf("new param\n"); +} +void geometry_elementary_add_new_point_cb(CALLBACK_ARGS){ + printf("new point\n"); +} +void geometry_elementary_add_new_line_cb(CALLBACK_ARGS){ + printf("new line\n"); +} +void geometry_elementary_add_new_spline_cb(CALLBACK_ARGS){ + printf("new spline\n"); +} +void geometry_elementary_add_new_circle_cb(CALLBACK_ARGS){ + printf("new circle\n"); +} +void geometry_elementary_add_new_ellipsis_cb(CALLBACK_ARGS){ + printf("new ellipsis\n"); +} +void geometry_elementary_add_new_planesurface_cb(CALLBACK_ARGS){ + printf("new plane surf\n"); +} +void geometry_elementary_add_new_ruledsurface_cb(CALLBACK_ARGS){ + printf("new rules surf\n"); +} +void geometry_elementary_add_new_volume_cb(CALLBACK_ARGS){ + printf("new vol\n"); +} +void geometry_elementary_add_translate_point_cb(CALLBACK_ARGS){ + printf("translate point\n"); +} +void geometry_elementary_add_translate_curve_cb(CALLBACK_ARGS){ + printf("translate curve\n"); +} +void geometry_elementary_add_translate_surface_cb(CALLBACK_ARGS){ + printf("translate surface\n"); +} +void geometry_elementary_add_rotate_point_cb(CALLBACK_ARGS){ + printf("rotate point\n"); +} +void geometry_elementary_add_rotate_curve_cb(CALLBACK_ARGS){ + printf("rotate curve\n"); +} +void geometry_elementary_add_rotate_surface_cb(CALLBACK_ARGS){ + printf("rotate surf\n"); +} +void geometry_elementary_add_dilate_point_cb(CALLBACK_ARGS){ + printf("dilate point\n"); +} +void geometry_elementary_add_dilate_curve_cb(CALLBACK_ARGS){ + printf("dilate curve\n"); +} +void geometry_elementary_add_dilate_surface_cb(CALLBACK_ARGS){ + printf("dilate surface\n"); +} +void geometry_elementary_add_symmetry_point_cb(CALLBACK_ARGS){ + printf("symm point\n"); +} +void geometry_elementary_add_symmetry_curve_cb(CALLBACK_ARGS){ + printf("symm curve\n"); +} +void geometry_elementary_add_symmetry_surface_cb(CALLBACK_ARGS){ + printf("symm surf\n"); +} +void geometry_elementary_translate_point_cb(CALLBACK_ARGS){ + printf("translate point\n"); +} +void geometry_elementary_translate_curve_cb(CALLBACK_ARGS){ + printf("translate curve\n"); +} +void geometry_elementary_translate_surface_cb(CALLBACK_ARGS){ + printf("translate surf\n"); } -void view_remove_cb(Fl_Widget* w, void* data){ - printf("Remove view %d \n", (int)data); +void geometry_elementary_rotate_point_cb(CALLBACK_ARGS){ + printf("rot point\n"); } -void view_duplicate_cb(Fl_Widget* w, void* data){ - printf("Duplicate view %d \n", (int)data); +void geometry_elementary_rotate_curve_cb(CALLBACK_ARGS){ + printf("rot curve\n"); } -void view_lighting_cb(Fl_Widget* w, void* data){ +void geometry_elementary_rotate_surface_cb(CALLBACK_ARGS){ + printf("rot surf\n"); +} +void geometry_elementary_dilate_point_cb(CALLBACK_ARGS){ + printf("dilate point\n"); +} +void geometry_elementary_dilate_curve_cb(CALLBACK_ARGS){ + printf("dilate curve\n"); +} +void geometry_elementary_dilate_surface_cb(CALLBACK_ARGS){ + printf("dilate surf\n"); +} +void geometry_elementary_symmetry_point_cb(CALLBACK_ARGS){ + printf("symm point\n"); +} +void geometry_elementary_symmetry_curve_cb(CALLBACK_ARGS){ + printf("symm curve\n"); +} +void geometry_elementary_symmetry_surface_cb(CALLBACK_ARGS){ + printf("symm surf\n"); +} +void geometry_elementary_extrude_point_cb(CALLBACK_ARGS){ + printf("extr point\n"); +} +void geometry_elementary_extrude_curve_cb(CALLBACK_ARGS){ + printf("extr curve\n"); +} +void geometry_elementary_extrude_surface_cb(CALLBACK_ARGS){ + printf("extr surf\n"); +} +void geometry_elementary_delete_point_cb(CALLBACK_ARGS){ + printf("del point\n"); +} +void geometry_elementary_delete_curve_cb(CALLBACK_ARGS){ + printf("del curve\n"); +} +void geometry_elementary_delete_surface_cb(CALLBACK_ARGS){ + printf("del surf\n"); +} +void geometry_physical_add_cb(CALLBACK_ARGS){ + WID->set_context(menu_geometry_physical_add, 0); +} +void geometry_physical_delete_cb(CALLBACK_ARGS){ + WID->set_context(menu_geometry_physical_delete, 0); +} +void geometry_physical_add_point_cb (CALLBACK_ARGS){ + printf("phys add point\n"); +} +void geometry_physical_add_curve_cb (CALLBACK_ARGS){ + printf("phys add curve\n"); +} +void geometry_physical_add_surface_cb (CALLBACK_ARGS){ + printf("phys add surf\n"); +} +void geometry_physical_add_volume_cb (CALLBACK_ARGS){ + printf("phys add vol\n"); +} +void geometry_physical_delete_point_cb(CALLBACK_ARGS){ + printf("phys delpoint\n"); +} +void geometry_physical_delete_curve_cb(CALLBACK_ARGS){ + printf("phys del curve\n"); +} +void geometry_physical_delete_surface_cb(CALLBACK_ARGS){ + printf("phys adel surf\n"); +} +void geometry_physical_delete_volume_cb(CALLBACK_ARGS){ + printf("phys del vol\n"); +} +void mesh_define_cb(CALLBACK_ARGS){ + WID->set_context(menu_mesh_define, 0); +} +void mesh_1d_cb(CALLBACK_ARGS){ + printf("mesh 1d\n"); +} +void mesh_2d_cb(CALLBACK_ARGS){ + printf("mesh 2d\n"); +} +void mesh_3d_cb(CALLBACK_ARGS){ + printf("mesh 3d\n"); +} +void mesh_define_length_cb (CALLBACK_ARGS){ + printf("mesh define length\n"); +} +void mesh_define_recombine_cb (CALLBACK_ARGS){ + printf("mesh define reco\n"); +} +void mesh_define_transfinite_cb (CALLBACK_ARGS){ + WID->set_context(menu_mesh_define_transfinite, 0); +} +void mesh_define_transfinite_line_cb(CALLBACK_ARGS){ + printf("mesh define tr line\n"); +} +void mesh_define_transfinite_surface_cb(CALLBACK_ARGS){ + printf("mesh define tr su\n"); +} +void mesh_define_transfinite_volume_cb(CALLBACK_ARGS){ + printf("mesh define tr vol\n"); +} + +void view_toggle_cb(CALLBACK_ARGS){ + if(!Post_ViewList) return; + + Post_View *v = (Post_View*)List_Pointer(Post_ViewList,(int)data); + + Msg(DEBUG, "View %d\n" + DEBUG_NIL " -> Name '%s'\n" + DEBUG_NIL " -> FileName '%s'\n" + DEBUG_NIL " -> DuplicateOf %d\n" + DEBUG_NIL " -> Links %d", + v->Num, v->Name, v->FileName, v->DuplicateOf, v->Links); + + v->Visible = !v->Visible; + + Init(); + Draw(); +} + +void view_reload_cb(CALLBACK_ARGS){ + Post_View tmp ; + char filename[NAME_STR_L]; + extern int Force_ViewNumber; + + if(!Post_ViewList) return; + + Post_View *v = (Post_View*)List_Pointer(Post_ViewList,(int)data); + strcpy(filename, v->FileName); + CopyViewOptions(v, &tmp); + + Force_ViewNumber = v->Num ; + FreeView(v); + MergeProblem(filename); + Force_ViewNumber = 0 ; + + v = (Post_View*)List_Pointer(Post_ViewList,(int)data); + CopyViewOptions(&tmp, v); + + if(!RELOAD_ALL_VIEWS){ + Init(); + Draw(); + } +} + +void view_remove_cb(CALLBACK_ARGS){ + Post_View *v = (Post_View*)List_Pointer(Post_ViewList,(int)data); + FreeView(v); + + if(!List_Suppress(Post_ViewList, v, fcmpPostViewNum)) + Msg(ERROR, "Could Not Suppress View from List"); + + CTX.post.nb_views = List_Nbr(Post_ViewList); + + if(WID->get_context() == 2) + WID->set_context(menu_post, 0); + + if(!REMOVE_ALL_VIEWS){ + Init(); + Draw(); + } +} + +void view_duplicate_cb(CALLBACK_ARGS){ + Post_View v, *v1, *v2, *v3 ; + + if(!Post_ViewList) return; + + v1 = (Post_View*)List_Pointer(Post_ViewList,(int)data); + + BeginView(0); + EndView(0, 0, v1->FileName, v1->Name, 0., 0., 0.); + + v2 = (Post_View*)List_Pointer(Post_ViewList,List_Nbr(Post_ViewList)-1); + + if(!v1->DuplicateOf){ + v2->DuplicateOf = v1->Num ; + v1->Links++ ; + } + else{ + v.Num = v1->DuplicateOf ; + if(!(v3 = (Post_View*)List_PQuery(Post_ViewList, &v, fcmpPostViewNum))){ + v2->DuplicateOf = v1->Num ; + v1->Links++ ; + } + else{ + v2->DuplicateOf = v3->Num; + v3->Links++ ; + } + } + + v2->Time = v1->Time; + v2->NbSP = v1->NbSP; v2->SP = v1->SP; + v2->NbVP = v1->NbVP; v2->VP = v1->VP; + v2->NbTP = v1->NbTP; v2->TP = v1->TP; + v2->NbSL = v1->NbSL; v2->SL = v1->SL; + v2->NbVL = v1->NbVL; v2->VL = v1->VL; + v2->NbTL = v1->NbTL; v2->TL = v1->TL; + v2->NbST = v1->NbST; v2->ST = v1->ST; + v2->NbVT = v1->NbVT; v2->VT = v1->VT; + v2->NbTT = v1->NbTT; v2->TT = v1->TT; + v2->NbSS = v1->NbSS; v2->SS = v1->SS; + v2->NbVS = v1->NbVS; v2->VS = v1->VS; + v2->NbTS = v1->NbTS; v2->TS = v1->TS; + v2->ScalarOnly = v1->ScalarOnly; + v2->Min = v1->Min; + v2->Max = v1->Max; + v2->NbTimeStep = v1->NbTimeStep; + + CopyViewOptions(v1, v2); + + AddViewInUI(List_Nbr(Post_ViewList), v2->Name, v2->Num); + Init(); + Draw(); +} + +void view_lighting_cb(CALLBACK_ARGS){ printf("Light view %d \n", (int)data); } -void view_elements_cb(Fl_Widget* w, void* data){ +void view_elements_cb(CALLBACK_ARGS){ printf("Show Elements view %d \n", (int)data); } -void view_applybgmesh_cb(Fl_Widget* w, void* data){ +void view_applybgmesh_cb(CALLBACK_ARGS){ printf("Apply bgmesh view %d \n", (int)data); } -void view_timestep_cb(Fl_Widget* w, void* data){ +void view_timestep_cb(CALLBACK_ARGS){ printf("Timestep view %d \n", (int)data); } -void view_options_cb(Fl_Widget* w, void* data){ +void view_options_cb(CALLBACK_ARGS){ printf("Options view %d \n", (int)data); } diff --git a/Fltk/Callbacks.h b/Fltk/Callbacks.h index f04535f8cda2ad030789dac03791558abac50cfa..dab7872741873451afe32e4d47a691af7eaacb0d 100644 --- a/Fltk/Callbacks.h +++ b/Fltk/Callbacks.h @@ -1,34 +1,132 @@ #ifndef _CALLBACKS_H_ #define _CALLBACKS_H_ -void file_open_cb(void) ; -void file_merge_cb(void) ; -void file_save_cb(void) ; -void file_save_as_cb(void) ; -void file_reload_all_views_cb(void) ; -void file_remove_all_views_cb(void) ; -void file_quit_cb(void) ; - -void opt_general_cb(void) ; -void opt_geometry_cb(void) ; -void opt_mesh_cb(void) ; -void opt_post_cb(void) ; -void opt_stat_cb(void) ; - -void help_short_cb(void) ; -void help_about_cb(void) ; - -void mod_geometry_cb(void) ; -void mod_mesh_cb(void) ; -void mod_post_cb(void) ; - -void view_reload_cb(Fl_Widget* w, void*) ; -void view_remove_cb(Fl_Widget* w, void*) ; -void view_duplicate_cb(Fl_Widget* w, void*) ; -void view_lighting_cb(Fl_Widget* w, void*) ; -void view_elements_cb(Fl_Widget* w, void*) ; -void view_timestep_cb(Fl_Widget* w, void*) ; -void view_options_cb(Fl_Widget* w, void*) ; -void view_applybgmesh_cb(Fl_Widget* w, void*) ; +#define CALLBACK_ARGS Fl_Widget* w, void* data + +// Graphical window + +void status_xyz1p_cb(CALLBACK_ARGS) ; +void status_play_cb(CALLBACK_ARGS) ; +void status_pause_cb(CALLBACK_ARGS) ; +void status_cancel_cb(CALLBACK_ARGS) ; + +// File Menu + +void file_open_cb(CALLBACK_ARGS) ; +void file_merge_cb(CALLBACK_ARGS) ; +void file_save_cb(CALLBACK_ARGS) ; +void file_save_as_cb(CALLBACK_ARGS) ; +void file_reload_all_views_cb(CALLBACK_ARGS) ; +void file_remove_all_views_cb(CALLBACK_ARGS) ; +void file_quit_cb(CALLBACK_ARGS) ; + +// Option Menu + +void opt_general_cb(CALLBACK_ARGS) ; +void opt_geometry_cb(CALLBACK_ARGS) ; +void opt_mesh_cb(CALLBACK_ARGS) ; +void opt_post_cb(CALLBACK_ARGS) ; +void opt_stat_cb(CALLBACK_ARGS) ; + +// Help Menu + +void help_short_cb(CALLBACK_ARGS) ; +void help_about_cb(CALLBACK_ARGS) ; + +// Module Menu + +void mod_geometry_cb(CALLBACK_ARGS) ; +void mod_mesh_cb(CALLBACK_ARGS) ; +void mod_post_cb(CALLBACK_ARGS) ; +void mod_back_cb(CALLBACK_ARGS) ; +void mod_forward_cb(CALLBACK_ARGS) ; + +// Dynamic Menus + +void geometry_elementary_cb(CALLBACK_ARGS) ; +void geometry_physical_cb(CALLBACK_ARGS) ; +void geometry_reload_cb(CALLBACK_ARGS) ; +void geometry_elementary_add_cb(CALLBACK_ARGS) ; +void geometry_elementary_translate_cb(CALLBACK_ARGS) ; +void geometry_elementary_rotate_cb(CALLBACK_ARGS) ; +void geometry_elementary_dilate_cb(CALLBACK_ARGS) ; +void geometry_elementary_symmetry_cb(CALLBACK_ARGS) ; +void geometry_elementary_extrude_cb(CALLBACK_ARGS) ; +void geometry_elementary_delete_cb(CALLBACK_ARGS) ; +void geometry_elementary_add_new_cb(CALLBACK_ARGS) ; +void geometry_elementary_add_translate_cb(CALLBACK_ARGS) ; +void geometry_elementary_add_rotate_cb(CALLBACK_ARGS) ; +void geometry_elementary_add_dilate_cb(CALLBACK_ARGS) ; +void geometry_elementary_add_symmetry_cb(CALLBACK_ARGS) ; +void geometry_elementary_add_new_parameter_cb(CALLBACK_ARGS) ; +void geometry_elementary_add_new_point_cb(CALLBACK_ARGS) ; +void geometry_elementary_add_new_line_cb(CALLBACK_ARGS) ; +void geometry_elementary_add_new_spline_cb(CALLBACK_ARGS) ; +void geometry_elementary_add_new_circle_cb(CALLBACK_ARGS) ; +void geometry_elementary_add_new_ellipsis_cb(CALLBACK_ARGS) ; +void geometry_elementary_add_new_planesurface_cb(CALLBACK_ARGS) ; +void geometry_elementary_add_new_ruledsurface_cb(CALLBACK_ARGS) ; +void geometry_elementary_add_new_volume_cb(CALLBACK_ARGS) ; +void geometry_elementary_add_translate_point_cb(CALLBACK_ARGS) ; +void geometry_elementary_add_translate_curve_cb(CALLBACK_ARGS) ; +void geometry_elementary_add_translate_surface_cb(CALLBACK_ARGS) ; +void geometry_elementary_add_rotate_point_cb(CALLBACK_ARGS) ; +void geometry_elementary_add_rotate_curve_cb(CALLBACK_ARGS) ; +void geometry_elementary_add_rotate_surface_cb(CALLBACK_ARGS) ; +void geometry_elementary_add_dilate_point_cb(CALLBACK_ARGS) ; +void geometry_elementary_add_dilate_curve_cb(CALLBACK_ARGS) ; +void geometry_elementary_add_dilate_surface_cb(CALLBACK_ARGS) ; +void geometry_elementary_add_symmetry_point_cb(CALLBACK_ARGS) ; +void geometry_elementary_add_symmetry_curve_cb(CALLBACK_ARGS) ; +void geometry_elementary_add_symmetry_surface_cb(CALLBACK_ARGS) ; +void geometry_elementary_translate_point_cb(CALLBACK_ARGS) ; +void geometry_elementary_translate_curve_cb(CALLBACK_ARGS) ; +void geometry_elementary_translate_surface_cb(CALLBACK_ARGS) ; +void geometry_elementary_rotate_point_cb(CALLBACK_ARGS) ; +void geometry_elementary_rotate_curve_cb(CALLBACK_ARGS) ; +void geometry_elementary_rotate_surface_cb(CALLBACK_ARGS) ; +void geometry_elementary_dilate_point_cb(CALLBACK_ARGS) ; +void geometry_elementary_dilate_curve_cb(CALLBACK_ARGS) ; +void geometry_elementary_dilate_surface_cb(CALLBACK_ARGS) ; +void geometry_elementary_symmetry_point_cb(CALLBACK_ARGS) ; +void geometry_elementary_symmetry_curve_cb(CALLBACK_ARGS) ; +void geometry_elementary_symmetry_surface_cb(CALLBACK_ARGS) ; +void geometry_elementary_extrude_point_cb(CALLBACK_ARGS) ; +void geometry_elementary_extrude_curve_cb(CALLBACK_ARGS) ; +void geometry_elementary_extrude_surface_cb(CALLBACK_ARGS) ; +void geometry_elementary_delete_point_cb(CALLBACK_ARGS) ; +void geometry_elementary_delete_curve_cb(CALLBACK_ARGS) ; +void geometry_elementary_delete_surface_cb(CALLBACK_ARGS) ; +void geometry_physical_add_cb(CALLBACK_ARGS) ; +void geometry_physical_delete_cb(CALLBACK_ARGS) ; +void geometry_physical_add_point_cb (CALLBACK_ARGS) ; +void geometry_physical_add_curve_cb (CALLBACK_ARGS) ; +void geometry_physical_add_surface_cb (CALLBACK_ARGS) ; +void geometry_physical_add_volume_cb (CALLBACK_ARGS) ; +void geometry_physical_delete_point_cb(CALLBACK_ARGS) ; +void geometry_physical_delete_curve_cb(CALLBACK_ARGS) ; +void geometry_physical_delete_surface_cb(CALLBACK_ARGS) ; +void geometry_physical_delete_volume_cb(CALLBACK_ARGS) ; +void mesh_define_cb(CALLBACK_ARGS) ; +void mesh_1d_cb(CALLBACK_ARGS) ; +void mesh_2d_cb(CALLBACK_ARGS) ; +void mesh_3d_cb(CALLBACK_ARGS) ; +void mesh_define_length_cb (CALLBACK_ARGS) ; +void mesh_define_recombine_cb (CALLBACK_ARGS) ; +void mesh_define_transfinite_cb (CALLBACK_ARGS) ; +void mesh_define_transfinite_line_cb(CALLBACK_ARGS) ; +void mesh_define_transfinite_surface_cb(CALLBACK_ARGS) ; +void mesh_define_transfinite_volume_cb(CALLBACK_ARGS) ; +void view_reload_cb(CALLBACK_ARGS) ; +void view_toggle_cb(CALLBACK_ARGS) ; +void view_remove_cb(CALLBACK_ARGS) ; +void view_duplicate_cb(CALLBACK_ARGS) ; +void view_lighting_cb(CALLBACK_ARGS) ; +void view_elements_cb(CALLBACK_ARGS) ; +void view_applybgmesh_cb(CALLBACK_ARGS) ; +void view_timestep_cb(CALLBACK_ARGS) ; +void view_options_cb(CALLBACK_ARGS) ; + + #endif diff --git a/Fltk/GUI.cpp b/Fltk/GUI.cpp index 112e7d24c22620b4500ab68cf107cb47f5f342f0..b39dd7671d9335fd2754569c61bebf226769aa92 100644 --- a/Fltk/GUI.cpp +++ b/Fltk/GUI.cpp @@ -14,8 +14,7 @@ #include "Version.h" #include "GUI.h" #include "Callbacks.h" - -//int strtok_r(char *, char const *, char **){return 0;} +#include "Bitmaps.h" extern Context_T CTX; extern List_T *Post_ViewList; @@ -55,159 +54,159 @@ Fl_Menu_Item m_module_table[] = { // Definition of the dynamic contexts -Context_Item menu_geom[] = +Context_Item menu_geometry[] = { { "0", NULL } , - { "Elementary", NULL } , - { "Physical", NULL } , - { "Reload", NULL } , + { "Elementary", (Fl_Callback *)geometry_elementary_cb } , + { "Physical", (Fl_Callback *)geometry_physical_cb } , + { "Reload", (Fl_Callback *)geometry_reload_cb } , { NULL } }; - Context_Item menu_geom_elementary[] = + Context_Item menu_geometry_elementary[] = { { "0", NULL } , - { "Add", NULL } , - { "Translate", NULL } , - { "Rotate", NULL } , - { "Dilate", NULL } , - { "Symmetry", NULL } , - { "Extrude", NULL } , - { "Delete", NULL } , + { "Add", (Fl_Callback *)geometry_elementary_add_cb } , + { "Translate", (Fl_Callback *)geometry_elementary_translate_cb } , + { "Rotate", (Fl_Callback *)geometry_elementary_rotate_cb } , + { "Dilate", (Fl_Callback *)geometry_elementary_dilate_cb } , + { "Symmetry", (Fl_Callback *)geometry_elementary_symmetry_cb } , + { "Extrude", (Fl_Callback *)geometry_elementary_extrude_cb } , + { "Delete", (Fl_Callback *)geometry_elementary_delete_cb } , { NULL } }; - Context_Item menu_geom_elementary_add[] = + Context_Item menu_geometry_elementary_add[] = { { "0", NULL } , - { "New", NULL } , - { "Translate", NULL } , - { "Rotate", NULL } , - { "Dilate", NULL } , - { "Symmetry", NULL } , + { "New", (Fl_Callback *)geometry_elementary_add_new_cb } , + { "Translate", (Fl_Callback *)geometry_elementary_add_translate_cb } , + { "Rotate", (Fl_Callback *)geometry_elementary_add_rotate_cb } , + { "Dilate", (Fl_Callback *)geometry_elementary_add_dilate_cb } , + { "Symmetry", (Fl_Callback *)geometry_elementary_add_symmetry_cb } , { NULL } }; - Context_Item menu_geom_elementary_add_new[] = + Context_Item menu_geometry_elementary_add_new[] = { { "0", NULL } , - { "Parameter", NULL } , - { "Point", NULL } , - { "Line", NULL } , - { "Spline", NULL } , - { "Circle", NULL } , - { "Ellipsis", NULL } , - { "Plane Surface", NULL } , - { "Ruled Surface", NULL } , - { "Volume", NULL } , + { "Parameter", (Fl_Callback *)geometry_elementary_add_new_parameter_cb } , + { "Point", (Fl_Callback *)geometry_elementary_add_new_point_cb } , + { "Line", (Fl_Callback *)geometry_elementary_add_new_line_cb } , + { "Spline", (Fl_Callback *)geometry_elementary_add_new_spline_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 } , + { "Volume", (Fl_Callback *)geometry_elementary_add_new_volume_cb } , { NULL } }; - Context_Item menu_geom_elementary_add_translate[] = + Context_Item menu_geometry_elementary_add_translate[] = { { "0", NULL } , - { "Point", NULL } , - { "Curve", NULL } , - { "Surface", NULL } , + { "Point", (Fl_Callback *)geometry_elementary_add_translate_point_cb } , + { "Curve", (Fl_Callback *)geometry_elementary_add_translate_curve_cb } , + { "Surface", (Fl_Callback *)geometry_elementary_add_translate_surface_cb } , { NULL } }; - Context_Item menu_geom_elementary_add_rotate[] = + Context_Item menu_geometry_elementary_add_rotate[] = { { "0", NULL } , - { "Point", NULL } , - { "Curve", NULL } , - { "Surface", NULL } , + { "Point", (Fl_Callback *)geometry_elementary_add_rotate_point_cb } , + { "Curve", (Fl_Callback *)geometry_elementary_add_rotate_curve_cb } , + { "Surface", (Fl_Callback *)geometry_elementary_add_rotate_surface_cb } , { NULL } }; - Context_Item menu_geom_elementary_add_dilate[] = + Context_Item menu_geometry_elementary_add_dilate[] = { { "0", NULL } , - { "Point", NULL } , - { "Curve", NULL } , - { "Surface", NULL } , + { "Point", (Fl_Callback *)geometry_elementary_add_dilate_point_cb } , + { "Curve", (Fl_Callback *)geometry_elementary_add_dilate_curve_cb } , + { "Surface", (Fl_Callback *)geometry_elementary_add_dilate_surface_cb } , { NULL } }; - Context_Item menu_geom_elementary_add_symmetry[] = + Context_Item menu_geometry_elementary_add_symmetry[] = { { "0", NULL } , - { "Point", NULL } , - { "Curve", NULL } , - { "Surface", NULL } , + { "Point", (Fl_Callback *)geometry_elementary_add_symmetry_point_cb } , + { "Curve", (Fl_Callback *)geometry_elementary_add_symmetry_curve_cb } , + { "Surface", (Fl_Callback *)geometry_elementary_add_symmetry_surface_cb } , { NULL } }; - Context_Item menu_geom_elementary_translate[] = + Context_Item menu_geometry_elementary_translate[] = { { "0", NULL } , - { "Point", NULL } , - { "Curve", NULL } , - { "Surface", NULL } , + { "Point", (Fl_Callback *)geometry_elementary_translate_point_cb } , + { "Curve", (Fl_Callback *)geometry_elementary_translate_curve_cb } , + { "Surface", (Fl_Callback *)geometry_elementary_translate_surface_cb } , { NULL } }; - Context_Item menu_geom_elementary_rotate[] = + Context_Item menu_geometry_elementary_rotate[] = { { "0", NULL } , - { "Point", NULL } , - { "Curve", NULL } , - { "Surface", NULL } , + { "Point", (Fl_Callback *)geometry_elementary_rotate_point_cb } , + { "Curve", (Fl_Callback *)geometry_elementary_rotate_curve_cb } , + { "Surface", (Fl_Callback *)geometry_elementary_rotate_surface_cb } , { NULL } }; - Context_Item menu_geom_elementary_dilate[] = + Context_Item menu_geometry_elementary_dilate[] = { { "0", NULL } , - { "Point", NULL } , - { "Curve", NULL } , - { "Surface", NULL } , + { "Point", (Fl_Callback *)geometry_elementary_dilate_point_cb } , + { "Curve", (Fl_Callback *)geometry_elementary_dilate_curve_cb } , + { "Surface", (Fl_Callback *)geometry_elementary_dilate_surface_cb } , { NULL } }; - Context_Item menu_geom_elementary_symmetry[] = + Context_Item menu_geometry_elementary_symmetry[] = { { "0", NULL } , - { "Point", NULL } , - { "Curve", NULL } , - { "Surface", NULL } , + { "Point", (Fl_Callback *)geometry_elementary_symmetry_point_cb } , + { "Curve", (Fl_Callback *)geometry_elementary_symmetry_curve_cb } , + { "Surface", (Fl_Callback *)geometry_elementary_symmetry_surface_cb } , { NULL } }; - Context_Item menu_geom_elementary_extrude[] = + Context_Item menu_geometry_elementary_extrude[] = { { "0", NULL } , - { "Point", NULL } , - { "Curve", NULL } , - { "Surface", NULL } , + { "Point", (Fl_Callback *)geometry_elementary_extrude_point_cb } , + { "Curve", (Fl_Callback *)geometry_elementary_extrude_curve_cb } , + { "Surface", (Fl_Callback *)geometry_elementary_extrude_surface_cb } , { NULL } }; - Context_Item menu_geom_elementary_delete[] = + Context_Item menu_geometry_elementary_delete[] = { { "0", NULL } , - { "Point", NULL } , - { "Curve", NULL } , - { "Surface", NULL } , + { "Point", (Fl_Callback *)geometry_elementary_delete_point_cb } , + { "Curve", (Fl_Callback *)geometry_elementary_delete_curve_cb } , + { "Surface", (Fl_Callback *)geometry_elementary_delete_surface_cb } , { NULL } }; - Context_Item menu_geom_physical[] = + Context_Item menu_geometry_physical[] = { { "0", NULL } , - { "Add", NULL } , - { "Delete", NULL } , + { "Add", (Fl_Callback *)geometry_physical_add_cb } , + { "Delete", (Fl_Callback *)geometry_physical_delete_cb } , { NULL } }; - Context_Item menu_geom_physical_add[] = + Context_Item menu_geometry_physical_add[] = { { "0", NULL } , - { "Point", NULL } , - { "Line", NULL } , - { "Surface", NULL } , - { "Volume", NULL } , + { "Point", (Fl_Callback *)geometry_physical_add_point_cb } , + { "Curve", (Fl_Callback *)geometry_physical_add_curve_cb } , + { "Surface", (Fl_Callback *)geometry_physical_add_surface_cb } , + { "Volume", (Fl_Callback *)geometry_physical_add_volume_cb } , { NULL } }; - Context_Item menu_geom_physical_delete[] = + Context_Item menu_geometry_physical_delete[] = { { "0", NULL } , - { "Point", NULL } , - { "Line", NULL } , - { "Surface", NULL } , - { "Volume", NULL } , + { "Point", (Fl_Callback *)geometry_physical_delete_point_cb } , + { "Line", (Fl_Callback *)geometry_physical_delete_curve_cb } , + { "Surface", (Fl_Callback *)geometry_physical_delete_surface_cb } , + { "Volume", (Fl_Callback *)geometry_physical_delete_volume_cb } , { NULL } }; Context_Item menu_mesh[] = { { "1", NULL } , - { "Define", NULL } , - { "1D", NULL } , - { "2D", NULL } , - { "3D", NULL } , + { "Define", (Fl_Callback *)mesh_define_cb } , + { "1D", (Fl_Callback *)mesh_1d_cb } , + { "2D", (Fl_Callback *)mesh_2d_cb } , + { "3D", (Fl_Callback *)mesh_3d_cb } , { NULL } }; Context_Item menu_mesh_define[] = { { "1", NULL } , - { "Length", NULL } , - { "Recombine", NULL } , - { "Transfinite", NULL } , + { "Length", (Fl_Callback *)mesh_define_length_cb } , + { "Recombine", (Fl_Callback *)mesh_define_recombine_cb } , + { "Transfinite", (Fl_Callback *)mesh_define_transfinite_cb } , { NULL } }; Context_Item menu_mesh_define_transfinite[] = { { "1", NULL } , - { "Line", NULL } , - { "Surface", NULL } , - { "Volume", NULL } , + { "Line", (Fl_Callback *)mesh_define_transfinite_line_cb } , + { "Surface", (Fl_Callback *)mesh_define_transfinite_surface_cb } , + { "Volume", (Fl_Callback *)mesh_define_transfinite_volume_cb } , { NULL } }; @@ -228,6 +227,12 @@ GUI::GUI() { if(strlen(CTX.display)) Fl::display(CTX.display); + // Icons + + icon1_bmp = new Fl_Bitmap(g1_bits,g1_width,g1_height); + icon2_bmp = new Fl_Bitmap(g2_bits,g2_width,g2_height); + icon3_bmp = new Fl_Bitmap(g3_bits,g3_width,g3_height); + // Menu Window { @@ -240,6 +245,7 @@ GUI::GUI() { { Fl_Menu_Bar *o = new Fl_Menu_Bar(0,0,width,BH); o->menu(m_menubar_table); + o->global(); o->textsize(CTX.fontsize); o->box(FL_UP_BOX); } @@ -253,12 +259,14 @@ GUI::GUI() { m_navig_butt[0]->labeltype(FL_SYMBOL_LABEL); m_navig_butt[0]->box(FL_FLAT_BOX); m_navig_butt[0]->selection_color(FL_WHITE); + m_navig_butt[0]->callback(mod_back_cb); m_navig_butt[1] = new Fl_Button(2,y+BH/2,20,BH/2,"@>"); m_navig_butt[1]->labeltype(FL_SYMBOL_LABEL); m_navig_butt[1]->box(FL_FLAT_BOX); m_navig_butt[1]->selection_color(FL_WHITE); + m_navig_butt[1]->callback(mod_forward_cb); - m_module_butt = new Fl_Choice(22,y,width-29,BH); + m_module_butt = new Fl_Choice(22,y,width-28,BH); m_module_butt->menu(m_module_table); m_module_butt->textsize(CTX.fontsize); m_module_butt->box(FL_THIN_DOWN_BOX); @@ -271,7 +279,8 @@ GUI::GUI() { m_push_butt[i]->hide(); m_toggle_butt[i] = new Fl_Light_Button(0,y+i*BH,width,BH,"test"); m_toggle_butt[i]->labelsize(CTX.fontsize); - if(i>5)m_toggle_butt[i]->hide(); + m_toggle_butt[i]->callback(view_toggle_cb, (void*)i); + m_toggle_butt[i]->hide(); m_popup_butt[i] = new Fl_Menu_Button(0,y+i*BH,width,BH); m_popup_butt[i]->type(Fl_Menu_Button::POPUP3); m_popup_butt[i]->add("Reload", 0, @@ -291,7 +300,7 @@ GUI::GUI() { m_popup_butt[i]->add("Options...", 0, (Fl_Callback *)view_options_cb, (void*)i, 0); m_popup_butt[i]->textsize(CTX.fontsize); - if(i>5)m_popup_butt[i]->hide(); + m_popup_butt[i]->hide(); } m_window->position(800,50); @@ -304,7 +313,6 @@ GUI::GUI() { { g_window = new Fl_Window(700,520); - g_opengl_window = new Opengl_Window(0,0,700,500); { @@ -312,14 +320,31 @@ GUI::GUI() { o->box(FL_THIN_UP_BOX); x = 2; + g_status_butt[0] = new Fl_Button(x,502,15,16,"X"); x+=15; + g_status_butt[0]->callback(status_xyz1p_cb, (void*)0); //g_status_butt[0]->tooltip("Set X view"); g_status_butt[1] = new Fl_Button(x,502,15,16,"Y"); x+=15; + g_status_butt[1]->callback(status_xyz1p_cb, (void*)1); g_status_butt[2] = new Fl_Button(x,502,15,16,"Z"); x+=15; - g_status_butt[3] = new Fl_Button(x,502,16,16,"1:1"); x+=16; + g_status_butt[2]->callback(status_xyz1p_cb, (void*)2); + g_status_butt[3] = new Fl_Button(x,502,20,16,"1:1"); x+=20; + g_status_butt[3]->callback(status_xyz1p_cb, (void*)3); g_status_butt[4] = new Fl_Button(x,502,15,16,"?"); x+=15; + g_status_butt[4]->callback(status_xyz1p_cb, (void*)4); + g_status_butt[5] = new Fl_Button(x,502,15,16,">>"); x+=15; + g_status_butt[5]->callback(status_play_cb); + start_bmp = new Fl_Bitmap(start_bits,start_width,start_height); + start_bmp->label(g_status_butt[5]); + stop_bmp = new Fl_Bitmap(stop_bits,stop_width,stop_height); + g_status_butt[6] = new Fl_Button(x,502,15,16,"0"); x+=15; + g_status_butt[6]->callback(status_cancel_cb); + abort_bmp = new Fl_Bitmap(abort_bits,abort_width,abort_height); + abort_bmp->label(g_status_butt[6]); + g_status_butt[6]->deactivate(); + for(i = 0 ; i<7 ; i++){ g_status_butt[i]->box(FL_FLAT_BOX); g_status_butt[i]->selection_color(FL_WHITE); @@ -327,13 +352,13 @@ GUI::GUI() { g_status_butt[i]->align(FL_ALIGN_CENTER|FL_ALIGN_INSIDE|FL_ALIGN_CLIP); } - g_status_box[0] = new Fl_Box(x,502,(700-x)/3,16); - g_status_box[1] = new Fl_Box(x+(700-x)/3,5022,(700-x)/3,16); - g_status_box[2] = new Fl_Box(x+2*(700-x)/3,5022,(700-x)/3-2,16); + g_status_label[0] = new Fl_Box(x,502,(700-x)/3,16); + g_status_label[1] = new Fl_Box(x+(700-x)/3,5022,(700-x)/3,16); + g_status_label[2] = new Fl_Box(x+2*(700-x)/3,5022,(700-x)/3-2,16); for(i = 0 ; i<3 ; i++){ - g_status_box[i]->box(FL_FLAT_BOX); - g_status_box[i]->labelsize(CTX.fontsize); - g_status_box[i]->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE|FL_ALIGN_CLIP); + g_status_label[i]->box(FL_FLAT_BOX); + g_status_label[i]->labelsize(CTX.fontsize); + g_status_label[i]->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE|FL_ALIGN_CLIP); } o->end(); @@ -352,6 +377,19 @@ GUI::GUI() { } +// Set animation button + +void GUI::set_anim(int mode){ + if(mode){ + g_status_butt[5]->callback(status_play_cb); + start_bmp->label(g_status_butt[5]); + } + else{ + g_status_butt[5]->callback(status_pause_cb); + stop_bmp->label(g_status_butt[5]); + } +} + // Draw the opengl window void GUI::draw_gl(){ @@ -378,27 +416,17 @@ void GUI::check(){ // Set the size of the graphical window -void GUI::set_size(int w, int h){ - static int initw, inith, init=0; - if(!init){ - init = 1; - initw = w; - inith = h; - } - if(w == initw && h == inith) return; - initw = w; - inith = h; - int hh = g_window->h()-g_opengl_window->h(); - g_window->size(w,h+hh); +void GUI::set_gl_size(int new_w, int new_h){ + g_window->size(new_w,new_h+g_window->h()-g_opengl_window->h()); } -// Dymanically set the height of the menu window +// Dynamically set the height of the menu window void GUI::set_menu_size(int nb_butt){ m_window->size(m_window->w(), MH + nb_butt*BH); } -// Dymanically set the context +// Dynamically set the context void GUI::set_context(Context_Item *menu_asked, int flag){ static int nb_back = 0, nb_forward = 0, init_context=0; @@ -414,6 +442,8 @@ void GUI::set_context(Context_Item *menu_asked, int flag){ } } + if(nb_back > NB_HISTORY_MAX-2) nb_back = 1; // we should do a circular list + if(flag == -1){ if(nb_back > 1){ nb_back--; @@ -466,7 +496,8 @@ void GUI::set_context(Context_Item *menu_asked, int flag){ m_popup_butt[i]->hide(); if(menu[i+1].label){ m_push_butt[i]->label(menu[i+1].label); - //m_push_butt[i]->callback(menu[i+1].callback); + m_push_butt[i]->callback(menu[i+1].callback); + m_push_butt[i]->redraw(); m_push_butt[i]->show(); nb++; } @@ -484,6 +515,10 @@ void GUI::set_context(Context_Item *menu_asked, int flag){ } +int GUI::get_context(){ + return m_module_butt->value(); +} + // Create the window for general options void GUI::opt_general(){ @@ -575,3 +610,422 @@ void GUI::opt_general(){ } } + +// Create the window for geometry options + +void GUI::opt_geometry(){ + static int init_opt_geometry = 0; + + if(!init_opt_geometry){ + init_opt_geometry = 1 ; + + int width = 280; + int height = 5*WB+9*BH ; + + geo_window = new Fl_Window(width,height); + geo_window->box(FL_THIN_UP_BOX); + { + Fl_Tabs* o = new Fl_Tabs(WB, WB, width-2*WB, height-3*WB-BH); + { + Fl_Group* o = new Fl_Group(WB, WB+BH, width-2*WB, height-3*WB-2*BH, "Visibility"); + o->labelsize(CTX.fontsize); + geo_butt[0] = new Fl_Check_Button(2*WB, 2*WB+BH, 100, BH, "Points"); + geo_butt[1] = new Fl_Check_Button(2*WB, 2*WB+2*BH, 100, BH, "Curves"); + geo_butt[2] = new Fl_Check_Button(2*WB, 2*WB+3*BH, 100, BH, "Surfaces"); + geo_butt[3] = new Fl_Check_Button(2*WB, 2*WB+4*BH, 100, BH, "Volumes"); + geo_butt[4] = new Fl_Check_Button(2*WB+120, 2*WB+BH, 100, BH, "Point Numbers"); + geo_butt[5] = new Fl_Check_Button(2*WB+120, 2*WB+2*BH, 100, BH, "Curve Numbers"); + geo_butt[6] = new Fl_Check_Button(2*WB+120, 2*WB+3*BH, 100, BH, "Surface Numbers"); + geo_butt[7] = new Fl_Check_Button(2*WB+120, 2*WB+4*BH, 100, BH, "Volume Numbers"); + for(int i=0 ; i<8 ; i++){ + geo_butt[i]->type(FL_TOGGLE_BUTTON); + geo_butt[i]->down_box(FL_DOWN_BOX); + geo_butt[i]->labelsize(CTX.fontsize); + geo_butt[i]->selection_color(FL_YELLOW); + } + geo_value[0] = new Fl_Value_Input(2*WB, 2*WB+5*BH, 100, BH, "Entity Number"); + geo_value[0]->minimum(0); geo_value[0]->maximum(1000); geo_value[0]->step(1); + geo_value[1] = new Fl_Value_Input(2*WB, 2*WB+6*BH, 100, BH, "Normals"); + geo_value[1]->minimum(0); geo_value[1]->maximum(100); geo_value[1]->step(1); + geo_value[2] = new Fl_Value_Input(2*WB, 2*WB+7*BH, 100, BH, "Tangents"); + geo_value[2]->minimum(0); geo_value[2]->maximum(100); geo_value[2]->step(1); + for(int i=0 ; i<3 ; i++){ + geo_value[i]->labelsize(CTX.fontsize); + geo_value[i]->type(FL_HORIZONTAL); + geo_value[i]->align(FL_ALIGN_RIGHT); + } + o->end(); + } + o->end(); + } + + { + Fl_Button* o = new Fl_Button(width-2*60-2*WB, height-BH-WB, 60, BH, "cancel"); + o->labelsize(CTX.fontsize); + } + { + Fl_Return_Button* o = new Fl_Return_Button(width-60-WB, height-BH-WB, 60, BH, "OK"); + o->labelsize(CTX.fontsize); + } + + geo_window->end(); + geo_window->show(); + } + else{ + if(geo_window->shown()) + geo_window->hide(); + else + geo_window->show(); + + } + +} + +// Create the window for mesh options + +void GUI::opt_mesh(){ + static int init_opt_mesh = 0; + + if(!init_opt_mesh){ + init_opt_mesh = 1 ; + + int width = 280; + int height = 5*WB+9*BH ; + + mesh_window = new Fl_Window(width,height); + mesh_window->box(FL_THIN_UP_BOX); + { + Fl_Tabs* o = new Fl_Tabs(WB, WB, width-2*WB, height-3*WB-BH); + { + Fl_Group* o = new Fl_Group(WB, WB+BH, width-2*WB, height-3*WB-2*BH, "Algorithm"); + o->labelsize(CTX.fontsize); + o->hide(); + mesh_butt[0] = new Fl_Check_Button(2*WB, 2*WB+BH, 100, BH, "Second Order"); + mesh_butt[1] = new Fl_Check_Button(2*WB, 2*WB+2*BH, 100, BH, "Interactive"); + mesh_butt[2] = new Fl_Check_Button(2*WB, 2*WB+3*BH, 100, BH, "Anisotropic"); + for(int i=0 ; i<3 ; i++){ + mesh_butt[i]->type(FL_TOGGLE_BUTTON); + mesh_butt[i]->down_box(FL_DOWN_BOX); + mesh_butt[i]->labelsize(CTX.fontsize); + mesh_butt[i]->selection_color(FL_YELLOW); + } + mesh_value[0] = new Fl_Value_Input(2*WB, 2*WB+4*BH, 40, BH, "Smoothing Steps"); + mesh_value[0]->minimum(0); mesh_value[0]->maximum(1000); mesh_value[0]->step(1); + for(int i=0 ; i<1 ; i++){ + mesh_value[i]->labelsize(CTX.fontsize); + mesh_value[i]->type(FL_HORIZONTAL); + mesh_value[i]->align(FL_ALIGN_RIGHT); + } + o->end(); + } + { + Fl_Group* o = new Fl_Group(WB, WB+BH, width-2*WB, height-3*WB-2*BH, "Visibility"); + o->labelsize(CTX.fontsize); + mesh_butt[3] = new Fl_Check_Button(2*WB, 2*WB+BH, 100, BH, "Points"); + mesh_butt[4] = new Fl_Check_Button(2*WB, 2*WB+2*BH, 100, BH, "Curves"); + mesh_butt[5] = new Fl_Check_Button(2*WB, 2*WB+3*BH, 100, BH, "Surfaces"); + mesh_butt[6] = new Fl_Check_Button(2*WB, 2*WB+4*BH, 100, BH, "Volumes"); + mesh_butt[7] = new Fl_Check_Button(2*WB+120, 2*WB+BH, 100, BH, "Point Numebers"); + mesh_butt[8] = new Fl_Check_Button(2*WB+120, 2*WB+2*BH, 100, BH, "Curve Numbers"); + mesh_butt[9] = new Fl_Check_Button(2*WB+120, 2*WB+3*BH, 100, BH, "Surface Numbers"); + mesh_butt[10] = new Fl_Check_Button(2*WB+120, 2*WB+4*BH, 100, BH, "Volume Numbers"); + for(int i=3 ; i<11 ; i++){ + mesh_butt[i]->type(FL_TOGGLE_BUTTON); + mesh_butt[i]->down_box(FL_DOWN_BOX); + mesh_butt[i]->labelsize(CTX.fontsize); + mesh_butt[i]->selection_color(FL_YELLOW); + } + mesh_value[1] = new Fl_Value_Input(2*WB, 2*WB+5*BH, 100, BH, "Entity Number"); + mesh_value[1]->minimum(0); mesh_value[1]->maximum(1000); mesh_value[1]->step(1); + mesh_value[2] = new Fl_Value_Input(2*WB, 2*WB+6*BH, 100, BH, "Element Quality"); + mesh_value[2]->minimum(0); mesh_value[2]->maximum(1000); mesh_value[2]->step(1); + mesh_value[3] = new Fl_Value_Input(2*WB, 2*WB+7*BH, 100, BH, "Normals"); + mesh_value[3]->minimum(0); mesh_value[3]->maximum(100); mesh_value[3]->step(1); + for(int i=1 ; i<4 ; i++){ + mesh_value[i]->labelsize(CTX.fontsize); + mesh_value[i]->type(FL_HORIZONTAL); + mesh_value[i]->align(FL_ALIGN_RIGHT); + } + o->end(); + } + { + Fl_Group* o = new Fl_Group(WB, WB+BH, width-2*WB, height-3*WB-2*BH, "Aspect"); + o->labelsize(CTX.fontsize); + o->hide(); + mesh_butt[11] = new Fl_Check_Button(2*WB, 2*WB+BH, 100, BH, "Wireframe"); + mesh_butt[12] = new Fl_Check_Button(2*WB, 2*WB+2*BH, 100, BH, "Hidden lines"); + mesh_butt[13] = new Fl_Check_Button(2*WB, 2*WB+3*BH, 100, BH, "Solid"); + for(int i=11 ; i<14 ; i++){ + mesh_butt[i]->type(FL_TOGGLE_BUTTON); + mesh_butt[i]->down_box(FL_DOWN_BOX); + mesh_butt[i]->labelsize(CTX.fontsize); + mesh_butt[i]->selection_color(FL_YELLOW); + } + mesh_value[4] = new Fl_Value_Input(2*WB, 2*WB+4*BH, 40, BH, "Explode"); + mesh_value[4]->minimum(0); mesh_value[4]->maximum(100); mesh_value[4]->step(1); + o->end(); + for(int i=4 ; i<5 ; i++){ + mesh_value[i]->labelsize(CTX.fontsize); + mesh_value[i]->type(FL_HORIZONTAL); + mesh_value[i]->align(FL_ALIGN_RIGHT); + } + } + o->end(); + } + + { + Fl_Button* o = new Fl_Button(width-2*60-2*WB, height-BH-WB, 60, BH, "cancel"); + o->labelsize(CTX.fontsize); + } + { + Fl_Return_Button* o = new Fl_Return_Button(width-60-WB, height-BH-WB, 60, BH, "OK"); + o->labelsize(CTX.fontsize); + } + + mesh_window->end(); + mesh_window->show(); + } + else{ + if(mesh_window->shown()) + mesh_window->hide(); + else + mesh_window->show(); + + } + +} + + +// Create the window for post-processing options + +void GUI::opt_post(){ + static int init_opt_post = 0; + + if(!init_opt_post){ + init_opt_post = 1 ; + + int width = 200; + int height = 5*WB+5*BH ; + + post_window = new Fl_Window(width,height); + post_window->box(FL_THIN_UP_BOX); + { + Fl_Tabs* o = new Fl_Tabs(WB, WB, width-2*WB, height-3*WB-BH); + { + Fl_Group* o = new Fl_Group(WB, WB+BH, width-2*WB, height-3*WB-2*BH, "Links"); + o->labelsize(CTX.fontsize); + post_butt[0] = new Fl_Check_Button(2*WB, 2*WB+BH, 150, BH, "No link between views"); + post_butt[1] = new Fl_Check_Button(2*WB, 2*WB+2*BH, 150, BH, "Link all views"); + post_butt[2] = new Fl_Check_Button(2*WB, 2*WB+3*BH, 150, BH, "Link visible views"); + for(int i=0 ; i<3 ; i++){ + post_butt[i]->type(FL_RADIO_BUTTON); + post_butt[i]->labelsize(CTX.fontsize); + post_butt[i]->selection_color(FL_YELLOW); + } + o->end(); + } + { + Fl_Group* o = new Fl_Group(WB, WB+BH, width-2*WB, height-3*WB-2*BH, "Animation"); + o->labelsize(CTX.fontsize); + o->hide(); + post_value[0] = new Fl_Value_Input(2*WB, 2*WB+BH, 40, BH, "Animation delay"); + post_value[0]->minimum(0); post_value[0]->maximum(10); post_value[0]->step(0.1); + for(int i=0 ; i<1 ; i++){ + post_value[i]->labelsize(CTX.fontsize); + post_value[i]->type(FL_HORIZONTAL); + post_value[i]->align(FL_ALIGN_RIGHT); + } + o->end(); + } + o->end(); + } + + { + Fl_Button* o = new Fl_Button(width-2*60-2*WB, height-BH-WB, 60, BH, "cancel"); + o->labelsize(CTX.fontsize); + } + { + Fl_Return_Button* o = new Fl_Return_Button(width-60-WB, height-BH-WB, 60, BH, "OK"); + o->labelsize(CTX.fontsize); + } + + post_window->end(); + post_window->show(); + } + else{ + if(post_window->shown()) + post_window->hide(); + else + post_window->show(); + + } + +} + +// Create the window for the statistics + +void GUI::opt_stat(){ + static int init_opt_stat = 0; + + if(!init_opt_stat){ + init_opt_stat = 1 ; + + int width = 234; + int height = 5*WB+16*BH ; + + stat_window = new Fl_Window(width,height); + stat_window->box(FL_THIN_UP_BOX); + { + Fl_Tabs* o = new Fl_Tabs(WB, WB, width-2*WB, height-3*WB-BH); + { + Fl_Group* o = new Fl_Group(WB, WB+BH, width-2*WB, height-3*WB-2*BH, "Geometry"); + o->labelsize(CTX.fontsize); + o->hide(); + stat_value[0] = new Fl_Value_Output(110+2*WB, 2*WB+BH, 100, BH, "Number of points"); + stat_value[1] = new Fl_Value_Output(110+2*WB, 2*WB+2*BH, 100, BH, "Number of curves"); + stat_value[2] = new Fl_Value_Output(110+2*WB, 2*WB+3*BH, 100, BH, "Number of surfaces"); + stat_value[3] = new Fl_Value_Output(110+2*WB, 2*WB+4*BH, 100, BH, "Number of volumes"); + o->end(); + } + { + Fl_Group* o = new Fl_Group(WB, WB+BH, width-2*WB, height-3*WB-2*BH, "Mesh"); + o->labelsize(CTX.fontsize); + stat_value[4] = new Fl_Value_Output(110+2*WB, 2*WB+BH, 100, BH, "Nodes on curves"); + stat_value[5] = new Fl_Value_Output(110+2*WB, 2*WB+2*BH, 100, BH, "Nodes on surfaces"); + stat_value[6] = new Fl_Value_Output(110+2*WB, 2*WB+3*BH, 100, BH, "Nodes in Volumes"); + stat_value[7] = new Fl_Value_Output(110+2*WB, 2*WB+4*BH, 100, BH, "Triangles"); + stat_value[8] = new Fl_Value_Output(110+2*WB, 2*WB+5*BH, 100, BH, "Quadrangles"); + stat_value[9] = new Fl_Value_Output(110+2*WB, 2*WB+6*BH, 100, BH, "Tetrahedra"); + stat_value[10] = new Fl_Value_Output(110+2*WB, 2*WB+7*BH, 100, BH, "Hexahedra"); + stat_value[11] = new Fl_Value_Output(110+2*WB, 2*WB+8*BH, 100, BH, "Prisms"); + stat_value[12] = new Fl_Value_Output(110+2*WB, 2*WB+9*BH, 100, BH, "Time for 1D mesh"); + stat_value[13] = new Fl_Value_Output(110+2*WB, 2*WB+10*BH, 100, BH, "Time for 2D mesh"); + stat_value[14] = new Fl_Value_Output(110+2*WB, 2*WB+11*BH, 100, BH, "Time for 3D mesh"); + stat_value[15] = new Fl_Value_Output(110+2*WB, 2*WB+12*BH, 100, BH, "Gamma factor"); + stat_value[16] = new Fl_Value_Output(110+2*WB, 2*WB+13*BH, 100, BH, "Eta factor"); + stat_value[17] = new Fl_Value_Output(110+2*WB, 2*WB+14*BH, 100, BH, "Rho factor"); + o->end(); + } + { + Fl_Group* o = new Fl_Group(WB, WB+BH, width-2*WB, height-3*WB-2*BH, "Post-processing"); + o->labelsize(CTX.fontsize); + o->hide(); + stat_value[18] = new Fl_Value_Output(110+2*WB, 2*WB+BH, 100, BH, "Views loaded"); + stat_value[19] = new Fl_Value_Output(110+2*WB, 2*WB+2*BH, 100, BH, "Visible Points"); + stat_value[20] = new Fl_Value_Output(110+2*WB, 2*WB+3*BH, 100, BH, "Visible Lines"); + stat_value[21] = new Fl_Value_Output(110+2*WB, 2*WB+4*BH, 100, BH, "Visible Triangles"); + stat_value[22] = new Fl_Value_Output(110+2*WB, 2*WB+5*BH, 100, BH, "Visible Tetrahedra"); + o->end(); + } + o->end(); + } + + for(int i=0 ; i<23 ; i++){ + stat_value[i]->labelsize(CTX.fontsize); + stat_value[i]->type(FL_HORIZONTAL); + stat_value[i]->align(FL_ALIGN_LEFT); + } + + { + Fl_Button* o = new Fl_Button(width-2*60-2*WB, height-BH-WB, 60, BH, "cancel"); + o->labelsize(CTX.fontsize); + } + { + Fl_Return_Button* o = new Fl_Return_Button(width-60-WB, height-BH-WB, 60, BH, "OK"); + o->labelsize(CTX.fontsize); + } + + stat_window->end(); + stat_window->show(); + } + else{ + if(stat_window->shown()) + stat_window->hide(); + else + stat_window->show(); + + } + +} + +// Create the short help window + +#include "Help.h" + +void GUI::help_short(){ + static int init_help_short = 0; + + if(!init_help_short){ + init_help_short = 1 ; + + int width = 450; + int height = 400 ; + + help_window = new Fl_Window(width,height); + help_window->box(FL_THIN_UP_BOX); + + Fl_Scroll*o = new Fl_Scroll(WB, WB, width-2*WB, height-3*WB-BH); + { + Fl_Multiline_Output* o = new Fl_Multiline_Output(WB, WB, 600, 1200); + o->value(txt_help); + o->textfont(FL_COURIER); + o->textsize(CTX.fontsize); + } + o->end(); + + { + Fl_Return_Button* o = new Fl_Return_Button(width-60-WB, height-BH-WB, 60, BH, "OK"); + o->labelsize(CTX.fontsize); + } + + help_window->resizable(o); + help_window->end(); + help_window->show(); + } + else{ + if(help_window->shown()) + help_window->hide(); + else + help_window->show(); + + } + +} + +// Create the about window + +void GUI::help_about(){ + static int init_help_about = 0; + extern char TextAbout[1024]; + + if(!init_help_about){ + init_help_about = 1 ; + + int width = 470; + int height = 220; + + about_window = new Fl_Window(width,height); + about_window->box(FL_THIN_UP_BOX); + + Fl_Box *o = new Fl_Box(2*WB, WB, about_width, height-2*WB); + about_bmp = new Fl_Bitmap(about_bits,about_width,about_height); + about_bmp->label(o); + + Fl_Button *o2 = new Fl_Button(WB+80, WB, width-2*WB-80, height-2*WB); + o2->label(TextAbout); + o2->box(FL_FLAT_BOX); + o2->labelsize(CTX.fontsize); + o2->labelfont(FL_COURIER); + o2->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE); + + about_window->end(); + about_window->show(); + } + else{ + if(about_window->shown()) + about_window->hide(); + else + about_window->show(); + } + +} diff --git a/Fltk/GUI.h b/Fltk/GUI.h index 785fe6bd7c49dab74322416564a110266adc86d6..ea4605f3e668a99835df57639640ea0e2fc12a1a 100644 --- a/Fltk/GUI.h +++ b/Fltk/GUI.h @@ -18,34 +18,38 @@ #include <FL/Fl_Menu_Button.H> #include <FL/Fl_Check_Button.H> #include <FL/Fl_Value_Input.H> +#include <FL/Fl_Value_Output.H> +#include <FL/Fl_Multiline_Output.H> +#include <FL/Fl_Browser.H> +#include <FL/Fl_Bitmap.H> #define NB_BUTT_MAX 100 #define NB_HISTORY_MAX 1000 -// The dynamic menus +// The dynamic contexts typedef struct{ char *label; - void (*callback)(Fl_Widget* w, void* data); + Fl_Callback* callback; } Context_Item; -extern Context_Item menu_geom[]; -extern Context_Item menu_geom_elementary[]; -extern Context_Item menu_geom_elementary_add[]; -extern Context_Item menu_geom_elementary_add_new[]; -extern Context_Item menu_geom_elementary_add_translate[]; -extern Context_Item menu_geom_elementary_add_rotate[]; -extern Context_Item menu_geom_elementary_add_dilate[]; -extern Context_Item menu_geom_elementary_add_symmetry[]; -extern Context_Item menu_geom_elementary_translate[]; -extern Context_Item menu_geom_elementary_rotate[]; -extern Context_Item menu_geom_elementary_dilate[]; -extern Context_Item menu_geom_elementary_symmetry[]; -extern Context_Item menu_geom_elementary_extrude[]; -extern Context_Item menu_geom_elementary_delete[]; -extern Context_Item menu_geom_physical[]; -extern Context_Item menu_geom_physical_add[]; -extern Context_Item menu_geom_physical_delete[]; +extern Context_Item menu_geometry[]; +extern Context_Item menu_geometry_elementary[]; +extern Context_Item menu_geometry_elementary_add[]; +extern Context_Item menu_geometry_elementary_add_new[]; +extern Context_Item menu_geometry_elementary_add_translate[]; +extern Context_Item menu_geometry_elementary_add_rotate[]; +extern Context_Item menu_geometry_elementary_add_dilate[]; +extern Context_Item menu_geometry_elementary_add_symmetry[]; +extern Context_Item menu_geometry_elementary_translate[]; +extern Context_Item menu_geometry_elementary_rotate[]; +extern Context_Item menu_geometry_elementary_dilate[]; +extern Context_Item menu_geometry_elementary_symmetry[]; +extern Context_Item menu_geometry_elementary_extrude[]; +extern Context_Item menu_geometry_elementary_delete[]; +extern Context_Item menu_geometry_physical[]; +extern Context_Item menu_geometry_physical_add[]; +extern Context_Item menu_geometry_physical_delete[]; extern Context_Item menu_mesh[]; extern Context_Item menu_mesh_define[]; extern Context_Item menu_mesh_define_transfinite[]; @@ -81,9 +85,13 @@ class GUI{ // Windows Fl_Window *m_window, *g_window, *gen_window, *geo_window ; Fl_Window *mesh_window, *post_window, *stat_window ; - Fl_Window *view_window ; + Fl_Window *help_window, *about_window, *view_window ; Opengl_Window *g_opengl_window ; + // Bitmaps + Fl_Bitmap *icon1_bmp, *icon2_bmp, *icon3_bmp; + Fl_Bitmap *abort_bmp, *start_bmp, *stop_bmp, *about_bmp ; + // We keep the following widgets for easy further reference // menu window @@ -95,19 +103,26 @@ class GUI{ // graphic window Fl_Button *g_status_butt[7] ; - Fl_Box *g_status_box[3] ; + Fl_Box *g_status_label[3] ; // general options window Fl_Check_Button *gen_butt[10] ; Fl_Value_Input *gen_value[10] ; // geometry options window + Fl_Check_Button *geo_butt[10] ; + Fl_Value_Input *geo_value[10] ; // mesh options window + Fl_Check_Button *mesh_butt[20] ; + Fl_Value_Input *mesh_value[20] ; // post-processing options window + Fl_Check_Button *post_butt[20] ; + Fl_Value_Input *post_value[20] ; // statistics window + Fl_Value_Output *stat_value[40] ; // view options window @@ -118,16 +133,24 @@ public: void check(); void draw_gl(); void draw_gl_overlay(); - void set_size(int w, int h); + void set_gl_size(int w, int h); void set_menu_size(int nb_butt); void set_context(Context_Item menu[], int flag); + int get_context(); + void set_anim(int mode); + void set_status(char *msg, int num); + // create option windows void opt_general(); void opt_geometry(); void opt_mesh(); void opt_post(); void opt_stat(); + // create help windows + void help_short(); + void help_about(); + }; diff --git a/Fltk/Main.cpp b/Fltk/Main.cpp index b4eb9f58e5804bebc911c148dd1a2ecf5b40f1f7..c2d4391707d5511f0b8b4ec529a99d92caf9cc66 100644 --- a/Fltk/Main.cpp +++ b/Fltk/Main.cpp @@ -1,4 +1,4 @@ -// $Id: Main.cpp,v 1.2 2001-01-08 14:51:30 geuzaine Exp $ +// $Id: Main.cpp,v 1.3 2001-01-09 08:58:38 geuzaine Exp $ #include <signal.h> @@ -21,8 +21,6 @@ extern List_T *Post_ViewList; int SHOW_ALL_ENTITIES ; -void AddViewInUI(int, char *, int){} - GUI *WID ; int main(int argc, char *argv[]){ @@ -94,8 +92,8 @@ int main(int argc, char *argv[]){ // Text for about window - sprintf(TextAbout, "%s\n \n%s%.2f\n%s\n%s\n%s\n%s\n%s\n%s\n \n%s\n \n" - "Type 'gmsh -help' for command line options", + sprintf(TextAbout, " %s\n \n %s%.2f\n %s\n %s\n %s\n %s\n %s\n %s\n \n %s" + "\n \n Type 'gmsh -help' for command line options", gmsh_progname, gmsh_version, GMSH_VERSION, gmsh_os, gmsh_date, gmsh_host, gmsh_packager, gmsh_url, gmsh_email, gmsh_copyright); @@ -125,10 +123,10 @@ int main(int argc, char *argv[]){ if(nbf > 1){ for(i=1;i<nbf;i++) MergeProblem(TheFileNameTab[i]); - WID->set_context(menu_post,0); + WID->set_context(menu_post, 0); } else { - WID->set_context(menu_geom,0); + WID->set_context(menu_geometry, 0); } // Read background mesh on disk diff --git a/Fltk/Opengl.cpp b/Fltk/Opengl.cpp index 01c0ae2db82cf999e5932a3339886b3053e19b2f..bdda3d0907b196a4a44bf124662dbc0cc41fd7ad 100644 --- a/Fltk/Opengl.cpp +++ b/Fltk/Opengl.cpp @@ -1,4 +1,4 @@ -// $Id: Opengl.cpp,v 1.1 2001-01-08 08:16:27 geuzaine Exp $ +// $Id: Opengl.cpp,v 1.2 2001-01-09 08:58:38 geuzaine Exp $ #include "Gmsh.h" #include "GmshUI.h" @@ -30,8 +30,6 @@ void InitOverlay(void){ } void Draw(void){ - WID->set_size(CTX.viewport[2]-CTX.viewport[0], - CTX.viewport[3]-CTX.viewport[1]); WID->draw_gl(); } @@ -125,6 +123,16 @@ void Opengl_Window::draw() { CTX.viewport[2], CTX.viewport[3]); } + if((w() != CTX.viewport[2]-CTX.viewport[0]) || + (h() != CTX.viewport[3]-CTX.viewport[1])){ + WID->set_gl_size(CTX.viewport[2]-CTX.viewport[0], + CTX.viewport[3]-CTX.viewport[1]); + glViewport(CTX.viewport[0], + CTX.viewport[1], + CTX.viewport[2], + CTX.viewport[3]); + } + Orthogonalize(0,0); glClearColor(UNPACK_RED(CTX.color.bg)/255., UNPACK_GREEN(CTX.color.bg)/255., diff --git a/jpeg/rawjpeg.tar b/jpeg/rawjpeg.tar deleted file mode 100644 index 73ef5fa55bb8aff017373302849c4f472060a7c2..0000000000000000000000000000000000000000 Binary files a/jpeg/rawjpeg.tar and /dev/null differ