diff --git a/Common/Context.h b/Common/Context.h index c64a09a77fc7d2ca444053de2eaa7c204fd6cfdd..35101a76595b6fd7db9fdfbb464c8d5ea10549fb 100644 --- a/Common/Context.h +++ b/Common/Context.h @@ -66,6 +66,7 @@ public : int stat_position[2]; // position of the statistics window on the screen int ctx_position[2]; // position of the geo/mesh context windows on the screen int solver_position[2]; // position of the solver windows on the screen + int plugin_position[2]; // position of the plugin window on the screen int file_chooser_position[2]; // position of the file chooser window on the screen int system_menu_bar; // use the system menu bar on MacOS? diff --git a/Common/DefaultOptions.h b/Common/DefaultOptions.h index 91c2121a83ff8f81424e446f102b4f2eb8b5c5b7..fed805d02759f3f163a2bc49fb414a10ae5adfef 100644 --- a/Common/DefaultOptions.h +++ b/Common/DefaultOptions.h @@ -684,6 +684,10 @@ StringXNumber GeneralOptions_Number[] = { { F|O, "Orthographic" , opt_general_orthographic , 1. , "Orthographic projection mode (0=perspective projection)" }, + { F|S, "PluginPositionX" , opt_general_plugin_position0 , 650. , + "Horizontal position (in pixels) of the upper left corner of the plugin window" }, + { F|S, "PluginPositionY" , opt_general_plugin_position1 , 550. , + "Vertical position (in pixels) of the upper left corner of the plugin window" }, { F|O, "PointSize" , opt_general_point_size , 3. , "Display size of points (in pixels)" }, { F|O, "PolygonOffsetAlwaysOn" , opt_general_polygon_offset_always , 0. , diff --git a/Common/Options.cpp b/Common/Options.cpp index d1094d8214331ecb786192e4c03f81841aee7fe6..ceab67a03e9e97b28ea3b05e07673686258f290b 100644 --- a/Common/Options.cpp +++ b/Common/Options.cpp @@ -1,4 +1,4 @@ -// $Id: Options.cpp,v 1.341 2007-04-26 09:47:38 remacle Exp $ +// $Id: Options.cpp,v 1.342 2007-05-04 10:45:07 geuzaine Exp $ // // Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle // @@ -2390,6 +2390,20 @@ double opt_general_option_position1(OPT_ARGS_NUM) return CTX.opt_position[1]; } +double opt_general_plugin_position0(OPT_ARGS_NUM) +{ + if(action & GMSH_SET) + CTX.plugin_position[0] = (int)val; + return CTX.plugin_position[0]; +} + +double opt_general_plugin_position1(OPT_ARGS_NUM) +{ + if(action & GMSH_SET) + CTX.plugin_position[1] = (int)val; + return CTX.plugin_position[1]; +} + double opt_general_statistics_position0(OPT_ARGS_NUM) { if(action & GMSH_SET) diff --git a/Common/Options.h b/Common/Options.h index 5d06923db737d7553b95e9ef1f366a14f48d38f0..13ee9730d793d043c2c2cb6467ddef0724b3ff93 100644 --- a/Common/Options.h +++ b/Common/Options.h @@ -249,6 +249,8 @@ double opt_general_message_size0(OPT_ARGS_NUM); double opt_general_message_size1(OPT_ARGS_NUM); double opt_general_option_position0(OPT_ARGS_NUM); double opt_general_option_position1(OPT_ARGS_NUM); +double opt_general_plugin_position0(OPT_ARGS_NUM); +double opt_general_plugin_position1(OPT_ARGS_NUM); double opt_general_statistics_position0(OPT_ARGS_NUM); double opt_general_statistics_position1(OPT_ARGS_NUM); double opt_general_visibility_position0(OPT_ARGS_NUM); diff --git a/Common/ShapeFunctions.h b/Common/ShapeFunctions.h index ca025de0b00a82d2a0bc81dfe475956428c77179..33fd8c625a1ed2f9e448cd1a67777508330e2a11 100644 --- a/Common/ShapeFunctions.h +++ b/Common/ShapeFunctions.h @@ -169,7 +169,8 @@ public: } double integrateLevelsetPositive(double val[]) { - double ones[8] = {1., 1., 1., 1., 1., 1., 1., 1.}; // FIXME: 8-node max + // FIXME: explain + generalize this + double ones[8] = {1., 1., 1., 1., 1., 1., 1., 1.}; double area = integrate(ones); double sum = 0, sumabs = 0.; for(int i = 0; i < getNumNodes(); i++){ diff --git a/Fltk/Callbacks.cpp b/Fltk/Callbacks.cpp index c033d81d88b3e7ba32abfa0b4e4d2f4ab9cc0db4..080bb548e7683c66c72ac1a90ec7d7d609e0abc6 100644 --- a/Fltk/Callbacks.cpp +++ b/Fltk/Callbacks.cpp @@ -1,4 +1,4 @@ -// $Id: Callbacks.cpp,v 1.524 2007-04-26 09:47:38 remacle Exp $ +// $Id: Callbacks.cpp,v 1.525 2007-05-04 10:45:07 geuzaine Exp $ // // Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle // @@ -64,6 +64,7 @@ void UpdateViewsInGUI() if(WID->get_context() == 3) WID->set_context(menu_post, 0); WID->reset_option_browser(); + WID->reset_plugin_view_browser(); WID->reset_clip_browser(); WID->reset_external_view_list(); } @@ -145,6 +146,7 @@ void window_cb(CALLBACK_ARGS) if(!strcmp(str, "minimize")){ WID->g_window->iconize(); if(WID->opt_window->shown()) WID->opt_window->iconize(); + if(WID->plugin_window->shown()) WID->plugin_window->iconize(); if(WID->vis_window->shown()) WID->vis_window->iconize(); if(WID->clip_window->shown()) WID->clip_window->iconize(); if(WID->manip_window->shown()) WID->manip_window->iconize(); @@ -172,6 +174,7 @@ void window_cb(CALLBACK_ARGS) // the order is important! WID->g_window->show(); if(WID->opt_window->shown()) WID->opt_window->show(); + if(WID->plugin_window->shown()) WID->plugin_window->show(); if(WID->context_geometry_window->shown()) WID->context_geometry_window->show(); if(WID->context_mesh_window->shown()) WID->context_mesh_window->show(); for(int i = 0; i < MAXSOLVERS; i++) { @@ -2444,6 +2447,7 @@ void help_short_cb(CALLBACK_ARGS) Msg(DIRECT, " Shift+o Show general options"); Msg(DIRECT, " Shift+p Show post-processing options"); Msg(DIRECT, " Shift+s Show solver options"); + Msg(DIRECT, " Shift+u Show post-processing plugins"); Msg(DIRECT, " Shift+w Show post-processing view options"); Msg(DIRECT, " Shift+Escape Enable full mouse selection"); Msg(DIRECT, " "); @@ -4469,54 +4473,9 @@ void view_applybgmesh_cb(CALLBACK_ARGS) fields.insert(field); } -void view_plugin_cancel_cb(CALLBACK_ARGS) +void view_plugin_cb(CALLBACK_ARGS) { - if(data) - ((Fl_Window *) data)->hide(); - if(CTX.post.plugin_draw_function){ - CTX.post.plugin_draw_function = NULL; - Draw(); - } -} - -void view_plugin_run_cb(CALLBACK_ARGS) -{ - GMSH_Post_Plugin *p = (GMSH_Post_Plugin *) data; - char name[256]; - p->getName(name); - int iView; - - if(p->dialogBox) { // get the values from the GUI - iView = p->dialogBox->current_view_index; - int m = p->getNbOptionsStr(); - int n = p->getNbOptions(); - if(m > MAX_PLUGIN_OPTIONS) m = MAX_PLUGIN_OPTIONS; - if(n > MAX_PLUGIN_OPTIONS) n = MAX_PLUGIN_OPTIONS; - for(int i = 0; i < m; i++) { - StringXString *sxs = p->getOptionStr(i); - sxs->def = (char*)p->dialogBox->input[i]->value(); - } - for(int i = 0; i < n; i++) { - StringXNumber *sxn = p->getOption(i); - sxn->def = p->dialogBox->value[i]->value(); - } - } - else - iView = 0; - - try { - Post_View **vv = (Post_View **) List_Pointer_Test(CTX.post.list, iView); - if(!vv) - p->execute(0); - else - p->execute(*vv); - CTX.post.plugin_draw_function = NULL; - Draw(); - } - catch(GMSH_Plugin * err) { - p->catchErrorMessage(name); - Msg(WARNING, "%s", name); - } + WID->create_plugin_window((int)(long)data); } void view_plugin_input_value_cb(CALLBACK_ARGS) @@ -4533,30 +4492,41 @@ void view_plugin_input_cb(CALLBACK_ARGS) f(-1, 0, (char*)input->value()); } -void view_plugin_options_cb(CALLBACK_ARGS) +void view_plugin_browser_cb(CALLBACK_ARGS) { - std::pair<int, GMSH_Plugin *> *pair = (std::pair<int, GMSH_Plugin *>*) data; - int iView = pair->first; - GMSH_Plugin *p = pair->second; - - if(!p->dialogBox) - p->dialogBox = WID->create_plugin_window(p); + // get selected plugin + GMSH_Plugin *p = 0; + for(int i = 1; i <= WID->plugin_browser->size(); i++) { + if(WID->plugin_browser->selected(i)) { + p = (GMSH_Plugin*)WID->plugin_browser->data(i); + break; + } + } + if(!p) return; - p->dialogBox->current_view_index = iView; - p->dialogBox->run_button->callback(view_plugin_run_cb, (void *)p); + // get first first selected view + int iView = -1; + for(int i = 1; i <= WID->plugin_view_browser->size(); i++) { + if(WID->plugin_view_browser->selected(i)) { + iView = i - 1; + break; + } + } - // configure the input value fields (we get step, min and max by - // calling the option function with action==1, 2 and 3, - // respectively) and set the Fl_Value_Input callbacks + // set the Fl_Value_Input callbacks and configure the input value + // fields (we get step, min and max by calling the option function + // with action==1, 2 and 3, respectively) int n = p->getNbOptions(); if(n > MAX_PLUGIN_OPTIONS) n = MAX_PLUGIN_OPTIONS; for(int i = 0; i < n; i++) { StringXNumber *sxn = p->getOption(i); if(sxn->function){ p->dialogBox->value[i]->callback(view_plugin_input_value_cb, (void*)sxn->function); - p->dialogBox->value[i]->step(sxn->function(iView, 1, 0.)); - p->dialogBox->value[i]->minimum(sxn->function(iView, 2, 0.)); - p->dialogBox->value[i]->maximum(sxn->function(iView, 3, 0.)); + if(iView >= 0){ + p->dialogBox->value[i]->step(sxn->function(iView, 1, 0.)); + p->dialogBox->value[i]->minimum(sxn->function(iView, 2, 0.)); + p->dialogBox->value[i]->maximum(sxn->function(iView, 3, 0.)); + } } } @@ -4570,7 +4540,65 @@ void view_plugin_options_cb(CALLBACK_ARGS) } } - p->dialogBox->main_window->show(); + // hide all plugin groups except the selected one + for(int i = 1; i <= WID->plugin_browser->size(); i++) + ((GMSH_Plugin*)WID->plugin_browser->data(i))->dialogBox->group->hide(); + p->dialogBox->group->show(); +} + +void view_plugin_run_cb(CALLBACK_ARGS) +{ + // get selected plugin + GMSH_Post_Plugin *p = 0; + for(int i = 1; i <= WID->plugin_browser->size(); i++) { + if(WID->plugin_browser->selected(i)) { + p = (GMSH_Post_Plugin*)WID->plugin_browser->data(i); + break; + } + } + if(!p) return; + + if(p->dialogBox) { // get the values from the GUI + int m = p->getNbOptionsStr(); + int n = p->getNbOptions(); + if(m > MAX_PLUGIN_OPTIONS) m = MAX_PLUGIN_OPTIONS; + if(n > MAX_PLUGIN_OPTIONS) n = MAX_PLUGIN_OPTIONS; + for(int i = 0; i < m; i++) { + StringXString *sxs = p->getOptionStr(i); + sxs->def = (char*)p->dialogBox->input[i]->value(); + } + for(int i = 0; i < n; i++) { + StringXNumber *sxn = p->getOption(i); + sxn->def = p->dialogBox->value[i]->value(); + } + } + + // run on all selected views + for(int i = 1; i <= WID->plugin_view_browser->size(); i++) { + if(WID->plugin_view_browser->selected(i)) { + try { + Post_View **vv = (Post_View **) List_Pointer_Test(CTX.post.list, i - 1); + if(!vv) + p->execute(0); + else + p->execute(*vv); + } + catch(GMSH_Plugin * err) { + char tmp[256]; + p->catchErrorMessage(tmp); + Msg(WARNING, "%s", tmp); + } + } + } + + Draw(); + CTX.post.plugin_draw_function = NULL; +} + +void view_plugin_cancel_cb(CALLBACK_ARGS) +{ + WID->plugin_window->hide(); + CTX.post.plugin_draw_function = NULL; } // Contextual windows for geometry diff --git a/Fltk/Callbacks.h b/Fltk/Callbacks.h index 6fe296be54c125345744b212a6f4a6f3a70b0769..0211568188b42224780cef55f2303567ad2ec24c 100644 --- a/Fltk/Callbacks.h +++ b/Fltk/Callbacks.h @@ -131,7 +131,9 @@ void view_combine_time_visible_cb(CALLBACK_ARGS); void view_combine_time_by_name_cb(CALLBACK_ARGS); void view_all_visible_cb(CALLBACK_ARGS); void view_applybgmesh_cb(CALLBACK_ARGS); -void view_plugin_options_cb(CALLBACK_ARGS); +void view_plugin_cb(CALLBACK_ARGS); +void view_plugin_browser_cb(CALLBACK_ARGS); +void view_plugin_run_cb(CALLBACK_ARGS); void view_plugin_cancel_cb(CALLBACK_ARGS); // Statistics Menu diff --git a/Fltk/GUI.cpp b/Fltk/GUI.cpp index aa90140b9deda8dc2a90a3decfa29c67ee8d1acb..a5d6237fc2a2e04d31c1bbac0595501ebb173ec5 100644 --- a/Fltk/GUI.cpp +++ b/Fltk/GUI.cpp @@ -1,4 +1,4 @@ -// $Id: GUI.cpp,v 1.606 2007-05-02 07:59:27 geuzaine Exp $ +// $Id: GUI.cpp,v 1.607 2007-05-04 10:45:08 geuzaine Exp $ // // Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle // @@ -573,6 +573,14 @@ int GUI::global_shortcuts(int event) create_view_options_window(0); return 1; } + else if(Fl::test_shortcut(FL_SHIFT + 'u')) { + if(List_Nbr(CTX.post.list)) + if(view_number >= 0 && view_number < List_Nbr(CTX.post.list)) + create_plugin_window(view_number); + else + create_plugin_window(0); + return 1; + } else if(Fl::test_shortcut(FL_ALT + 'f')) { opt_general_fast_redraw(0, GMSH_SET | GMSH_GUI, !opt_general_fast_redraw(0, GMSH_GET, 0)); @@ -795,6 +803,7 @@ GUI::GUI(int argc, char **argv) m_window = NULL; g_window = NULL; opt_window = NULL; + plugin_window = NULL; stat_window = NULL; msg_window = NULL; vis_window = NULL; @@ -879,6 +888,7 @@ GUI::GUI(int argc, char **argv) g_opengl_window->take_focus(); create_option_window(); + create_plugin_window(0); create_message_window(); create_statistics_window(); create_visibility_window(); @@ -925,22 +935,6 @@ void GUI::wait(double time) // Create the menu window -void GUI::add_post_plugins(Popup_Button * button, int iView) -{ - char name[256], menuname[256]; - for(GMSH_PluginManager::iter it = GMSH_PluginManager::instance()->begin(); - it != GMSH_PluginManager::instance()->end(); ++it) { - GMSH_Plugin *p = (*it).second; - if(p->getType() == GMSH_Plugin::GMSH_POST_PLUGIN) { - p->getName(name); - std::pair<int, GMSH_Plugin*> *pair = new std::pair<int, GMSH_Plugin *>(iView, p); - m_pop_plugin.push_back(pair); // keep track of this, so we can free it later - sprintf(menuname, "Plugins/%s...", name); - button->add(menuname, 0, (Fl_Callback *) view_plugin_options_cb, (void *)pair, 0); - } - } -} - void GUI::create_menu_window() { int y; @@ -1161,9 +1155,6 @@ void GUI::set_context(Context_Item * menu_asked, int flag) for(unsigned int i = 0; i < m_pop_label.size(); i++) delete [] m_pop_label[i]; m_pop_label.clear(); - for(unsigned int i = 0; i < m_pop_plugin.size(); i++) - delete m_pop_plugin[i]; - m_pop_plugin.clear(); int width = m_window->w(); int popw = 4 * fontsize + 3; @@ -1247,11 +1238,12 @@ void GUI::set_context(Context_Item * menu_asked, int flag) (Fl_Callback *) view_save_txt_cb, (void *)nb, 0); p[j]->add("Save As/Mesh...", 0, (Fl_Callback *) view_save_msh_cb, (void *)nb, 0); - add_post_plugins(p[j], nb); p[j]->add("Apply As Background Mesh", 0, (Fl_Callback *) view_applybgmesh_cb, (void *)nb, FL_MENU_DIVIDER); p[j]->add("Options...", 'o', (Fl_Callback *) view_options_cb, (void *)nb, 0); + p[j]->add("Plugins...", 'p', + (Fl_Callback *) view_plugin_cb, (void *)nb, 0); } m_toggle_butt.push_back(b1); @@ -1484,6 +1476,27 @@ void GUI::set_status(char *msg, int num) } } +void GUI::add_multiline_in_browser(Fl_Browser * o, char *prefix, char *str) +{ + int start = 0, len; + char *buff; + if(!str || !strlen(str) || !strcmp(str, "\n")) { + o->add(" "); + return; + } + for(unsigned int i = 0; i < strlen(str); i++) { + if(i == strlen(str) - 1 || str[i] == '\n') { + len = i - start + (str[i] == '\n' ? 0 : 1); + buff = new char[len + strlen(prefix) + 2]; + strcpy(buff, prefix); + strncat(buff, &str[start], len); + buff[len + strlen(prefix)] = '\0'; + o->add(buff); + start = i + 1; + } + } +} + // set the current drawing context void GUI::make_opengl_current() @@ -1615,12 +1628,11 @@ void GUI::reset_external_view_list() } } - void GUI::create_option_window() { int width = 40 * fontsize; int height = 13 * BH + 5 * WB; - int L = 105 + WB; + int L = 8 * fontsize + WB; if(opt_window) { opt_window->show(); @@ -3442,6 +3454,149 @@ void GUI::update_view_window(int num) view_colorbar_window->update(v->Name, v->Min, v->Max, &v->CT, &v->Changed); } +// Create the plugin manager window + +void GUI::create_plugin_dialog_box(GMSH_Plugin *p, int x, int y, int width, int height) +{ + p->dialogBox = new PluginDialogBox; + p->dialogBox->group = new Fl_Group(x, y, width, height); + + { + Fl_Tabs *o = new Fl_Tabs(x, y, width, height); + { + Fl_Group *g = new Fl_Group(x, y + BH, width, height - BH, "Options"); + Fl_Scroll *s = new Fl_Scroll(x + WB, y + WB + BH, width - 2 * WB, height - BH - 2 * WB); + + int m = p->getNbOptionsStr(); + if(m > MAX_PLUGIN_OPTIONS) m = MAX_PLUGIN_OPTIONS; + + int n = p->getNbOptions(); + if(n > MAX_PLUGIN_OPTIONS) n = MAX_PLUGIN_OPTIONS; + + int k = 0; + for(int i = 0; i < m; i++) { + StringXString *sxs = p->getOptionStr(i); + p->dialogBox->input[i] = new Fl_Input(x + WB, y + WB + (k + 1) * BH, IW, BH, sxs->str); + p->dialogBox->input[i]->align(FL_ALIGN_RIGHT); + p->dialogBox->input[i]->value(sxs->def); + k++; + } + for(int i = 0; i < n; i++) { + StringXNumber *sxn = p->getOption(i); + p->dialogBox->value[i] = new Fl_Value_Input(x + WB, y + WB + (k + 1) * BH, IW, BH, sxn->str); + p->dialogBox->value[i]->align(FL_ALIGN_RIGHT); + p->dialogBox->value[i]->value(sxn->def); + k++; + } + + s->end(); + g->end(); + } + { + Fl_Group *g = new Fl_Group(x, y + BH, width, height - BH, "About"); + + Fl_Browser *o = new Fl_Browser(x + WB, y + WB + BH, width - 2 * WB, height - 2 * WB - BH); + + char name[1024], copyright[256], author[256], help[4096]; + p->getName(name); + p->getInfos(author, copyright, help); + + o->add(" "); + add_multiline_in_browser(o, "@c@b@.", name); + o->add(" "); + add_multiline_in_browser(o, "", help); + o->add(" "); + add_multiline_in_browser(o, "Author: ", author); + add_multiline_in_browser(o, "Copyright (C) ", copyright); + o->add(" "); + + g->end(); + } + o->end(); + } + + p->dialogBox->group->end(); + p->dialogBox->group->hide(); +} + +void GUI::reset_plugin_view_browser() +{ + // save selected state + std::vector<int> state; + for(int i = 0; i < plugin_view_browser->size(); i++){ + if(plugin_view_browser->selected(i + 1)) + state.push_back(1); + else + state.push_back(0); + } + + char str[128]; + plugin_view_browser->clear(); + for(int i = 0; i < List_Nbr(CTX.post.list); i++) { + sprintf(str, "View [%d]", i); + plugin_view_browser->add(str); + } + + for(int i = 0; i < plugin_view_browser->size(); i++){ + if(i < state.size() && state[i]) + plugin_view_browser->select(i + 1); + } +} + +void GUI::create_plugin_window(int numview) +{ + int width = 40 * fontsize; + int height = 13 * BH + 5 * WB; + + if(plugin_window) { + if(numview >= 0 && numview < List_Nbr(CTX.post.list)){ + plugin_view_browser->deselect(); + plugin_view_browser->select(numview + 1); + } + plugin_window->show(); + return; + } + + plugin_window = new Dialog_Window(width, height, "Plugins"); + plugin_window->box(GMSH_WINDOW_BOX); + + { + Fl_Button *o = new Fl_Button(width - BB - WB, height - BH - WB, BB, BH, "Cancel"); + o->callback(view_plugin_cancel_cb); + } + { + Fl_Return_Button *o = new Fl_Return_Button(width - 2 * BB - 2 * WB, height - BH - WB, BB, BH, "Run"); + o->callback(view_plugin_run_cb); + } + + int L1 = 8 * fontsize, L2 = 7 * fontsize; + plugin_browser = new Fl_Hold_Browser(WB, WB, L1, height - 3 * WB - BH); + plugin_browser->callback(view_plugin_browser_cb); + + plugin_view_browser = new Fl_Multi_Browser(WB + L1, WB, L2, height - 3 * WB - BH); + plugin_view_browser->has_scrollbar(Fl_Browser_::VERTICAL); + plugin_view_browser->callback(view_plugin_browser_cb); + + for(GMSH_PluginManager::iter it = GMSH_PluginManager::instance()->begin(); + it != GMSH_PluginManager::instance()->end(); ++it) { + GMSH_Plugin *p = (*it).second; + if(p->getType() == GMSH_Plugin::GMSH_POST_PLUGIN) { + char name[256]; + p->getName(name); + plugin_browser->add(name, p); + create_plugin_dialog_box(p, 2 * WB + L1 + L2, WB, width - L1 - L2 - 3 * WB, height - 3 * WB - BH); + // select first plugin by default + if(it == GMSH_PluginManager::instance()->begin()){ + plugin_browser->select(1); + p->dialogBox->group->show(); + } + } + } + + plugin_window->position(CTX.plugin_position[0], CTX.plugin_position[1]); + plugin_window->end(); +} + // Create the window for the statistics void GUI::create_statistics_window() @@ -3619,113 +3774,6 @@ void GUI::set_statistics(bool compute_quality) } -// Create the window for the plugins - -void GUI::add_multiline_in_browser(Fl_Browser * o, char *prefix, char *str) -{ - int start = 0, len; - char *buff; - if(!str || !strlen(str) || !strcmp(str, "\n")) { - o->add(" "); - return; - } - for(unsigned int i = 0; i < strlen(str); i++) { - if(i == strlen(str) - 1 || str[i] == '\n') { - len = i - start + (str[i] == '\n' ? 0 : 1); - buff = new char[len + strlen(prefix) + 2]; - strcpy(buff, prefix); - strncat(buff, &str[start], len); - buff[len + strlen(prefix)] = '\0'; - o->add(buff); - start = i + 1; - } - } -} - -PluginDialogBox *GUI::create_plugin_window(GMSH_Plugin * p) -{ - char buffer[1024], namep[1024], copyright[256], author[256], help[4096]; - - // get plugin info - - int m = p->getNbOptionsStr(); - int n = p->getNbOptions(); - p->getName(namep); - p->getInfos(author, copyright, help); - - // create window - - int width = 27 * fontsize; - int height = ((n+m > 8 ? n+m : 8) + 2) * BH + 5 * WB; - - PluginDialogBox *pdb = new PluginDialogBox; - pdb->current_view_index = 0; - pdb->main_window = new Dialog_Window(width, height); - pdb->main_window->box(GMSH_WINDOW_BOX); - sprintf(buffer, "%s Plugin", namep); - char *nbuffer = new char[strlen(buffer) + 1]; - strcpy(nbuffer, buffer); - pdb->main_window->label(nbuffer); - - { - Fl_Tabs *o = new Fl_Tabs(WB, WB, width - 2 * WB, height - 3 * WB - 1 * BH); - { - Fl_Group *g = new Fl_Group(WB, WB + BH, width - 2 * WB, height - 3 * WB - 2 * BH, "Options"); - - if(m > MAX_PLUGIN_OPTIONS) m = MAX_PLUGIN_OPTIONS; - if(n > MAX_PLUGIN_OPTIONS) n = MAX_PLUGIN_OPTIONS; - - int k = 0; - for(int i = 0; i < m; i++) { - StringXString *sxs = p->getOptionStr(i); - pdb->input[i] = new Fl_Input(2 * WB, 2 * WB + (k + 1) * BH, IW, BH, sxs->str); - pdb->input[i]->align(FL_ALIGN_RIGHT); - pdb->input[i]->value(sxs->def); - k++; - } - for(int i = 0; i < n; i++) { - StringXNumber *sxn = p->getOption(i); - pdb->value[i] = new Fl_Value_Input(2 * WB, 2 * WB + (k + 1) * BH, IW, BH, sxn->str); - pdb->value[i]->align(FL_ALIGN_RIGHT); - pdb->value[i]->value(sxn->def); - k++; - } - - g->end(); - } - { - Fl_Group *g = new Fl_Group(WB, WB + BH, width - 2 * WB, height - 3 * WB - 2 * BH, "About"); - - Fl_Browser *o = new Fl_Browser(2 * WB, 2 * WB + 1 * BH, width - 4 * WB, height - 5 * WB - 2 * BH); - - o->add(" "); - add_multiline_in_browser(o, "@c@b@.", namep); - o->add(" "); - add_multiline_in_browser(o, "", help); - o->add(" "); - add_multiline_in_browser(o, "Author: ", author); - add_multiline_in_browser(o, "Copyright (C) ", copyright); - o->add(" "); - - g->end(); - } - o->end(); - } - - pdb->run_button = new Fl_Return_Button(width - 2 * BB - 2 * WB, height - BH - WB, BB, BH, "Run"); - - Fl_Button *cancel = new Fl_Button(width - BB - WB, height - BH - WB, BB, BH, "Cancel"); - cancel->callback(view_plugin_cancel_cb, (void *)pdb->main_window); - - //pdb->main_window->resizable(new Fl_Box(2 * WB, 2 * WB + BH, 10, 10)); - - pdb->main_window->position(m_window->x() + m_window->w() / 2 - width / 2, - m_window->y() + 6 * BH); - pdb->main_window->end(); - - return pdb; -} - // Create the window for the messages void GUI::create_message_window(bool redraw_only) diff --git a/Fltk/GUI.h b/Fltk/GUI.h index f161275051832cddc2471ccb9968723a4c7211fc..42d2df643dad6099ecd15335fe05f69ce30962f7 100644 --- a/Fltk/GUI.h +++ b/Fltk/GUI.h @@ -95,19 +95,15 @@ extern Context_Item menu_mesh_define_transfinite[]; extern Context_Item menu_solver[]; extern Context_Item menu_post[]; -// Forward Declarations - -class GMSH_Plugin; - // A generalized dialogbox for plugins #define MAX_PLUGIN_OPTIONS 50 +class GMSH_Plugin; + struct PluginDialogBox { - int current_view_index; - Fl_Window *main_window; - Fl_Return_Button *run_button; + Fl_Group *group; Fl_Value_Input *value[MAX_PLUGIN_OPTIONS]; Fl_Input *input[MAX_PLUGIN_OPTIONS]; }; @@ -132,7 +128,6 @@ class GUI{ // Bitmaps Fl_Bitmap *abort_bmp, *start_bmp, *stop_bmp, *rewind_bmp, *rotate_bmp, *ortho_bmp; - void add_post_plugins(Popup_Button *button , int iView); void add_multiline_in_browser(Fl_Browser *o, char* prefix, char *str); public: @@ -151,7 +146,6 @@ public: std::vector<Popup_Button*> m_popup_butt; std::vector<Popup_Button*> m_popup2_butt; std::vector<char*> m_pop_label; - std::vector<std::pair<int, GMSH_Plugin*>*> m_pop_plugin; // graphic window Fl_Window *g_window; @@ -219,6 +213,11 @@ public: Fl_Return_Button *view_ok; Fl_Menu_Button *view_menu_butt[2]; + // Plugin window + Fl_Window *plugin_window; + Fl_Hold_Browser *plugin_browser; + Fl_Multi_Browser *plugin_view_browser; + // statistics window Fl_Window *stat_window; Fl_Output *stat_value[50]; @@ -282,8 +281,9 @@ public: void create_mesh_options_window(); void create_solver_options_window(); void create_post_options_window(); - PluginDialogBox *create_plugin_window(GMSH_Plugin *p); void create_view_options_window(int numview); + void create_plugin_dialog_box(GMSH_Plugin *p, int x, int y, int width, int height); + void create_plugin_window(int numview); void create_visibility_window(bool redraw_only=false); void create_clip_window(); void create_manip_window(); @@ -319,6 +319,7 @@ public: int arrow_shortcuts(); void reset_visibility(); void reset_option_browser(); + void reset_plugin_view_browser(); void reset_clip_browser(); void update_manip_window(int force=0); void reset_external_view_list(); diff --git a/Fltk/Message.cpp b/Fltk/Message.cpp index 15acd8fa8c7ba7e4d462755f6da065ff85a76b1a..89916aae724c3be9c9b81e2a2e54a77134bfb299 100644 --- a/Fltk/Message.cpp +++ b/Fltk/Message.cpp @@ -1,4 +1,4 @@ -// $Id: Message.cpp,v 1.78 2006-12-16 05:43:20 geuzaine Exp $ +// $Id: Message.cpp,v 1.79 2007-05-04 10:45:08 geuzaine Exp $ // // Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle // @@ -226,6 +226,8 @@ void Exit(int level) CTX.msg_size[1] = WID->msg_window->h(); CTX.opt_position[0] = WID->opt_window->x(); CTX.opt_position[1] = WID->opt_window->y(); + CTX.plugin_position[0] = WID->plugin_window->x(); + CTX.plugin_position[1] = WID->plugin_window->y(); CTX.stat_position[0] = WID->stat_window->x(); CTX.stat_position[1] = WID->stat_window->y(); CTX.vis_position[0] = WID->vis_window->x(); diff --git a/Plugin/Annotate.cpp b/Plugin/Annotate.cpp index fdbda221e21a8659a21c356ca22c2488981e0ed5..11c112fbd9062255770e60f965469c6b1e252dce 100644 --- a/Plugin/Annotate.cpp +++ b/Plugin/Annotate.cpp @@ -1,4 +1,4 @@ -// $Id: Annotate.cpp,v 1.15 2006-11-27 22:22:32 geuzaine Exp $ +// $Id: Annotate.cpp,v 1.16 2007-05-04 10:45:08 geuzaine Exp $ // // Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle // @@ -212,18 +212,18 @@ void GMSH_AnnotatePlugin::getName(char *name) const void GMSH_AnnotatePlugin::getInfos(char *author, char *copyright, char *help_text) const { - strcpy(author, "C. Geuzaine (geuz@geuz.org)"); + strcpy(author, "C. Geuzaine"); strcpy(copyright, "DGR (www.multiphysics.com)"); strcpy(help_text, - "Plugin(Annotate) adds the text string `Text', in\n" - "font `Font' and size `FontSize', in the view `iView'.\n" - "If `3D' is equal to 1, the plugin inserts the\n" - "string in model coordinates at the position\n" + "Plugin(Annotate) adds the text string `Text',\n" + "in font `Font' and size `FontSize', in the view\n" + "`iView'. If `3D' is equal to 1, the plugin inserts\n" + "the string in model coordinates at the position\n" "(`X',`Y',`Z'). If `3D' is equal to 0, the plugin\n" - "inserts the string in screen coordinates at the\n" - "position (`X',`Y'). The string is aligned according\n" - "to `Align'. If `iView' < 0, the plugin is run on the\n" - "current view.\n" + "inserts the string in screen coordinates at\n" + "the position (`X',`Y'). The string is aligned\n" + "according to `Align'. If `iView' < 0, the plugin\n" + "is run on the current view.\n" "\n" "Plugin(Annotate) is executed in-place.\n"); } diff --git a/Plugin/Curl.cpp b/Plugin/Curl.cpp index 84ffaa282e52c048b6f996eeaf73cc94b968946f..a710f7dfbefa053e92b0bb57bb48b639b159a019 100644 --- a/Plugin/Curl.cpp +++ b/Plugin/Curl.cpp @@ -1,4 +1,4 @@ -// $Id: Curl.cpp,v 1.3 2006-11-27 22:22:32 geuzaine Exp $ +// $Id: Curl.cpp,v 1.4 2007-05-04 10:45:08 geuzaine Exp $ // // Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle // @@ -54,7 +54,7 @@ void GMSH_CurlPlugin::getName(char *name) const void GMSH_CurlPlugin::getInfos(char *author, char *copyright, char *help_text) const { - strcpy(author, "C. Geuzaine (geuz@geuz.org)"); + strcpy(author, "C. Geuzaine"); strcpy(copyright, "DGR (www.multiphysics.com)"); strcpy(help_text, "Plugin(Curl) computes the curl of the field\n" diff --git a/Plugin/CutGrid.cpp b/Plugin/CutGrid.cpp index 8aaaefef1688b814b6987359c95bd878c43c8999..7df1149e9d02ea2c0a1f75071a38a5df38e0d943 100644 --- a/Plugin/CutGrid.cpp +++ b/Plugin/CutGrid.cpp @@ -1,4 +1,4 @@ -// $Id: CutGrid.cpp,v 1.19 2006-11-27 22:22:32 geuzaine Exp $ +// $Id: CutGrid.cpp,v 1.20 2007-05-04 10:45:08 geuzaine Exp $ // // Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle // @@ -189,19 +189,20 @@ void GMSH_CutGridPlugin::getName(char *name) const void GMSH_CutGridPlugin::getInfos(char *author, char *copyright, char *help_text) const { - strcpy(author, "J.-F. Remacle (remacle@scorec.rpi.edu)"); + strcpy(author, "J.-F. Remacle"); strcpy(copyright, "DGR (www.multiphysics.com)"); strcpy(help_text, "Plugin(CutGrid) cuts the view `iView' with a\n" "rectangular grid defined by the 3 points\n" - "(`X0',`Y0',`Z0') (origin), (`X1',`Y1',`Z1') (axis of U)\n" - "and (`X2',`Y2',`Z2') (axis of V). The number of points\n" - "along U and V is set with the options `nPointsU'\n" - "and `nPointsV'. If `ConnectPoints' is zero, the\n" - "plugin creates points; otherwise, the plugin\n" - "generates quadrangles, lines or points depending\n" - "on the values of `nPointsU' and `nPointsV'. If\n" - "`iView' < 0, the plugin is run on the current view.\n" + "(`X0',`Y0',`Z0') (origin), (`X1',`Y1',`Z1') (axis of\n" + "U) and (`X2',`Y2',`Z2') (axis of V). The number of\n" + "points along U and V is set with the options\n" + "`nPointsU' and `nPointsV'. If `ConnectPoints' is\n" + "zero, the plugin creates points; otherwise, the\n" + "plugin generates quadrangles, lines or points\n" + " depending on the values of `nPointsU' and\n" + "`nPointsV'. If `iView' < 0, the plugin is run on\n" + "the current view.\n" "\n" "Plugin(CutGrid) creates one new view.\n"); } diff --git a/Plugin/CutMap.cpp b/Plugin/CutMap.cpp index c007f42ab7900c76541e1ac47b7e28bd891681a2..0da3c707271c9c15fcdaa679cd708612f09df7c3 100644 --- a/Plugin/CutMap.cpp +++ b/Plugin/CutMap.cpp @@ -1,4 +1,4 @@ -// $Id: CutMap.cpp,v 1.52 2007-01-08 16:42:42 geuzaine Exp $ +// $Id: CutMap.cpp,v 1.53 2007-05-04 10:45:08 geuzaine Exp $ // // Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle // @@ -110,7 +110,7 @@ void GMSH_CutMapPlugin::getName(char *name) const void GMSH_CutMapPlugin::getInfos(char *author, char *copyright, char *help_text) const { - strcpy(author, "J.-F. Remacle (remacle@scorec.rpi.edu)"); + strcpy(author, "J.-F. Remacle"); strcpy(copyright, "DGR (www.multiphysics.com)"); strcpy(help_text, "Plugin(CutMap) extracts the isosurface of value\n" diff --git a/Plugin/CutParametric.cpp b/Plugin/CutParametric.cpp index 0d4704d0d74863ecc1617ea8c1a843ea680b3924..01ecb90c8ddc33774ac39f9ce42cd8e1bac24a5f 100644 --- a/Plugin/CutParametric.cpp +++ b/Plugin/CutParametric.cpp @@ -1,4 +1,4 @@ -// $Id: CutParametric.cpp,v 1.18 2006-11-27 22:22:32 geuzaine Exp $ +// $Id: CutParametric.cpp,v 1.19 2007-05-04 10:45:08 geuzaine Exp $ // // Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle // @@ -221,7 +221,7 @@ void GMSH_CutParametricPlugin::getName(char *name) const void GMSH_CutParametricPlugin::getInfos(char *author, char *copyright, char *help_text) const { - strcpy(author, "C. Geuzaine (geuzaine@acm.caltech.edu)"); + strcpy(author, "C. Geuzaine"); strcpy(copyright, "DGR (www.multiphysics.com)"); strcpy(help_text, "Plugin(CutParametric) cuts the view `iView' with\n" diff --git a/Plugin/CutPlane.cpp b/Plugin/CutPlane.cpp index c26a7395aedd8b6f569b0f8c28c9f7bcfdc1d99a..c1b2dc7b6323662ae35c442943e9ef76357f37ef 100644 --- a/Plugin/CutPlane.cpp +++ b/Plugin/CutPlane.cpp @@ -1,4 +1,4 @@ -// $Id: CutPlane.cpp,v 1.51 2007-01-08 16:42:42 geuzaine Exp $ +// $Id: CutPlane.cpp,v 1.52 2007-05-04 10:45:08 geuzaine Exp $ // // Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle // @@ -141,7 +141,7 @@ void GMSH_CutPlanePlugin::getName(char *name) const void GMSH_CutPlanePlugin::getInfos(char *author, char *copyright, char *help_text) const { - strcpy(author, "J.-F. Remacle (remacle@scorec.rpi.edu)"); + strcpy(author, "J.-F. Remacle"); strcpy(copyright, "DGR (www.multiphysics.com)"); strcpy(help_text, "Plugin(CutPlane) cuts the view `iView' with\n" diff --git a/Plugin/CutSphere.cpp b/Plugin/CutSphere.cpp index bec911e4bec832d61dbf468b0085bd179c45382c..b4778bda6f8d0336052e86990be0f63acf0cedc9 100644 --- a/Plugin/CutSphere.cpp +++ b/Plugin/CutSphere.cpp @@ -1,4 +1,4 @@ -// $Id: CutSphere.cpp,v 1.46 2006-11-27 22:22:32 geuzaine Exp $ +// $Id: CutSphere.cpp,v 1.47 2007-05-04 10:45:08 geuzaine Exp $ // // Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle // @@ -138,7 +138,7 @@ void GMSH_CutSpherePlugin::getName(char *name) const void GMSH_CutSpherePlugin::getInfos(char *author, char *copyright, char *help_text) const { - strcpy(author, "J.-F. Remacle (remacle@scorec.rpi.edu)"); + strcpy(author, "J.-F. Remacle"); strcpy(copyright, "DGR (www.multiphysics.com)"); strcpy(help_text, "Plugin(CutSphere) cuts the view `iView' with the\n" diff --git a/Plugin/DecomposeInSimplex.cpp b/Plugin/DecomposeInSimplex.cpp index 92cc9ed9bac45cb0480d3fced75984d6592be559..8e6f5e9a69cfeb674c4a56f3fdf8859a989b913e 100644 --- a/Plugin/DecomposeInSimplex.cpp +++ b/Plugin/DecomposeInSimplex.cpp @@ -1,4 +1,4 @@ -// $Id: DecomposeInSimplex.cpp,v 1.21 2006-11-27 22:22:32 geuzaine Exp $ +// $Id: DecomposeInSimplex.cpp,v 1.22 2007-05-04 10:45:08 geuzaine Exp $ // // Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle // @@ -55,7 +55,7 @@ void GMSH_DecomposeInSimplexPlugin::getName(char *name) const void GMSH_DecomposeInSimplexPlugin::getInfos(char *author, char *copyright, char *help_text) const { - strcpy(author, "C. Geuzaine (geuz@geuz.org)"); + strcpy(author, "C. Geuzaine"); strcpy(copyright, "DGR (www.multiphysics.com)"); strcpy(help_text, "Plugin(DecomposeInSimplex) decomposes all\n" diff --git a/Plugin/Divergence.cpp b/Plugin/Divergence.cpp index e83a6ab219c2b7f95cbc19eba634c28bdeab2a6e..ad324523962c9dbce0b6ed495e9cba54271f665c 100644 --- a/Plugin/Divergence.cpp +++ b/Plugin/Divergence.cpp @@ -1,4 +1,4 @@ -// $Id: Divergence.cpp,v 1.3 2006-11-27 22:22:32 geuzaine Exp $ +// $Id: Divergence.cpp,v 1.4 2007-05-04 10:45:08 geuzaine Exp $ // // Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle // @@ -54,7 +54,7 @@ void GMSH_DivergencePlugin::getName(char *name) const void GMSH_DivergencePlugin::getInfos(char *author, char *copyright, char *help_text) const { - strcpy(author, "C. Geuzaine (geuz@geuz.org)"); + strcpy(author, "C. Geuzaine"); strcpy(copyright, "DGR (www.multiphysics.com)"); strcpy(help_text, "Plugin(Divergence) computes the divergence of the\n" diff --git a/Plugin/Eigenvalues.cpp b/Plugin/Eigenvalues.cpp index 4bda10ddafc7bcf573a8b7331a80d0e817c626a4..4fb91b051a6bca92dd14ad098b65beab99baaeba 100644 --- a/Plugin/Eigenvalues.cpp +++ b/Plugin/Eigenvalues.cpp @@ -1,4 +1,4 @@ -// $Id: Eigenvalues.cpp,v 1.3 2006-11-27 22:22:32 geuzaine Exp $ +// $Id: Eigenvalues.cpp,v 1.4 2007-05-04 10:45:08 geuzaine Exp $ // // Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle // @@ -53,7 +53,7 @@ void GMSH_EigenvaluesPlugin::getName(char *name) const void GMSH_EigenvaluesPlugin::getInfos(char *author, char *copyright, char *help_text) const { - strcpy(author, "C. Geuzaine (geuz@geuz.org)"); + strcpy(author, "C. Geuzaine"); strcpy(copyright, "DGR (www.multiphysics.com)"); strcpy(help_text, "Plugin(Eigenvalues) computes the three real\n" diff --git a/Plugin/Eigenvectors.cpp b/Plugin/Eigenvectors.cpp index d41d615218e4d031e9981d95d8c1db0738266ddb..884280e3222667ce84daa8363a2c60e9251b8d2f 100644 --- a/Plugin/Eigenvectors.cpp +++ b/Plugin/Eigenvectors.cpp @@ -1,4 +1,4 @@ -// $Id: Eigenvectors.cpp,v 1.7 2006-11-27 22:22:32 geuzaine Exp $ +// $Id: Eigenvectors.cpp,v 1.8 2007-05-04 10:45:08 geuzaine Exp $ // // Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle // @@ -55,7 +55,7 @@ void GMSH_EigenvectorsPlugin::getName(char *name) const void GMSH_EigenvectorsPlugin::getInfos(char *author, char *copyright, char *help_text) const { - strcpy(author, "C. Geuzaine (geuz@geuz.org)"); + strcpy(author, "C. Geuzaine"); strcpy(copyright, "DGR (www.multiphysics.com)"); strcpy(help_text, "Plugin(Eigenvectors) computes the three (right)\n" diff --git a/Plugin/Evaluate.cpp b/Plugin/Evaluate.cpp index aa124a80ae35aaf1574fb090de0e746771357bdc..4d396b1dd041ec385bda6939fa124c5cff1443ce 100644 --- a/Plugin/Evaluate.cpp +++ b/Plugin/Evaluate.cpp @@ -1,4 +1,4 @@ -// $Id: Evaluate.cpp,v 1.28 2006-11-27 22:22:32 geuzaine Exp $ +// $Id: Evaluate.cpp,v 1.29 2007-05-04 10:45:08 geuzaine Exp $ // // Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle // @@ -66,7 +66,7 @@ void GMSH_EvaluatePlugin::getName(char *name) const void GMSH_EvaluatePlugin::getInfos(char *author, char *copyright, char *help_text) const { - strcpy(author, "C. Geuzaine (geuz@geuz.org)"); + strcpy(author, "C. Geuzaine"); strcpy(copyright, "DGR (www.multiphysics.com)"); strcpy(help_text, "Plugin(Evaluate) sets the `Component'-th\n" diff --git a/Plugin/Extract.cpp b/Plugin/Extract.cpp index c7dc7e80c00d12e09e50e5e7b0f1d1a967f116c5..79703e2f5c88765791cba3930800ca102b9ca12e 100644 --- a/Plugin/Extract.cpp +++ b/Plugin/Extract.cpp @@ -1,4 +1,4 @@ -// $Id: Extract.cpp,v 1.22 2006-11-27 22:22:32 geuzaine Exp $ +// $Id: Extract.cpp,v 1.23 2007-05-04 10:45:08 geuzaine Exp $ // // Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle // @@ -73,7 +73,7 @@ void GMSH_ExtractPlugin::getName(char *name) const void GMSH_ExtractPlugin::getInfos(char *author, char *copyright, char *help_text) const { - strcpy(author, "C. Geuzaine (geuz@geuz.org)"); + strcpy(author, "C. Geuzaine"); strcpy(copyright, "DGR (www.multiphysics.com)"); strcpy(help_text, "Plugin(Extract) extracts a combination of\n" diff --git a/Plugin/ExtractElements.cpp b/Plugin/ExtractElements.cpp index 31235f9ef81de2d4ed40746410f4454469b3ad9e..afd2ae7dc9a03fec8d20bc0fa23d4a509142c82b 100644 --- a/Plugin/ExtractElements.cpp +++ b/Plugin/ExtractElements.cpp @@ -1,4 +1,4 @@ -// $Id: ExtractElements.cpp,v 1.7 2006-11-27 22:22:32 geuzaine Exp $ +// $Id: ExtractElements.cpp,v 1.8 2007-05-04 10:45:09 geuzaine Exp $ // // Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle // @@ -55,7 +55,7 @@ void GMSH_ExtractElementsPlugin::getName(char *name) const void GMSH_ExtractElementsPlugin::getInfos(char *author, char *copyright, char *help_text) const { - strcpy(author, "C. Geuzaine (geuz@geuz.org)"); + strcpy(author, "C. Geuzaine"); strcpy(copyright, "DGR (www.multiphysics.com)"); strcpy(help_text, "Plugin(ExtractElements) extracts the elements\n" diff --git a/Plugin/Gradient.cpp b/Plugin/Gradient.cpp index fbef55761de260fdba15bbb6757e2a9d6c60bb34..85aaafb1ab84c19bfb40907a50bb40c1061ae5c4 100644 --- a/Plugin/Gradient.cpp +++ b/Plugin/Gradient.cpp @@ -1,4 +1,4 @@ -// $Id: Gradient.cpp,v 1.7 2006-11-27 22:22:32 geuzaine Exp $ +// $Id: Gradient.cpp,v 1.8 2007-05-04 10:45:09 geuzaine Exp $ // // Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle // @@ -54,7 +54,7 @@ void GMSH_GradientPlugin::getName(char *name) const void GMSH_GradientPlugin::getInfos(char *author, char *copyright, char *help_text) const { - strcpy(author, "C. Geuzaine (geuz@geuz.org)"); + strcpy(author, "C. Geuzaine"); strcpy(copyright, "DGR (www.multiphysics.com)"); strcpy(help_text, "Plugin(Gradient) computes the gradient of the\n" diff --git a/Plugin/HarmonicToTime.cpp b/Plugin/HarmonicToTime.cpp index 702da6655b39c22599af085d2710a94fd770e439..b613aa48a5f5612b4fddf078261234c5541b7e51 100644 --- a/Plugin/HarmonicToTime.cpp +++ b/Plugin/HarmonicToTime.cpp @@ -1,4 +1,4 @@ -// $Id: HarmonicToTime.cpp,v 1.9 2006-11-27 22:22:32 geuzaine Exp $ +// $Id: HarmonicToTime.cpp,v 1.10 2007-05-04 10:45:09 geuzaine Exp $ // // Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle // @@ -57,7 +57,7 @@ void GMSH_HarmonicToTimePlugin::getName(char *name) const void GMSH_HarmonicToTimePlugin::getInfos(char *author, char *copyright, char *help_text) const { - strcpy(author, "C. Geuzaine (geuz@geuz.org)"); + strcpy(author, "C. Geuzaine"); strcpy(copyright, "DGR (www.multiphysics.com)"); strcpy(help_text, "Plugin(HarmonicToTime) takes the values in the\n" diff --git a/Plugin/Integrate.cpp b/Plugin/Integrate.cpp index b5e4ea9b7dc9a142c9cc874ebb1f1da87b0b0068..b30ab74ad59ab77395a5418e88a8f378322c6269 100644 --- a/Plugin/Integrate.cpp +++ b/Plugin/Integrate.cpp @@ -1,4 +1,4 @@ -// $Id: Integrate.cpp,v 1.19 2006-11-27 22:22:32 geuzaine Exp $ +// $Id: Integrate.cpp,v 1.20 2007-05-04 10:45:09 geuzaine Exp $ // // Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle // @@ -30,7 +30,6 @@ extern Context_T CTX; StringXNumber IntegrateOptions_Number[] = { - {GMSH_FULLRC, "ComputeLevelsetPositive", NULL, 0.}, {GMSH_FULLRC, "iView", NULL, -1.} }; @@ -55,16 +54,14 @@ void GMSH_IntegratePlugin::getName(char *name) const void GMSH_IntegratePlugin::getInfos(char *author, char *copyright, char *help_text) const { - strcpy(author, "C. Geuzaine (geuz@geuz.org)"); + strcpy(author, "C. Geuzaine"); strcpy(copyright, "DGR (www.multiphysics.com)"); strcpy(help_text, "Plugin(Integrate) integrates scalar fields over\n" "all the elements in the view `iView', as well\n" "as the circulation/flux of vector fields over\n" "line/surface elements. If `iView' < 0, the\n" - "plugin is run on the current view. If\n" - "`ComputeLevelsetPositive' is set, the plugin\n" - "computes the positive area (volume) of the map.\n" + "plugin is run on the current view.\n" "\n" "Plugin(Integrate) creates one new view.\n"); } @@ -89,8 +86,6 @@ static double integrate(int nbList, List_T *list, int dim, { if(!nbList) return 0.; - const int levelsetPositive = (int)IntegrateOptions_Number[0].def; - double res = 0.; int nb = List_Nbr(list) / nbList; for(int i = 0; i < List_Nbr(list); i += nb) { @@ -103,10 +98,7 @@ static double integrate(int nbList, List_T *list, int dim, element *element = factory.create(nbNod, dim, x, y, z); if(!element) return 0.; if(nbComp == 1){ - if(!levelsetPositive) - res += element->integrate(v); - else - res += element->integrateLevelsetPositive(v); + res += element->integrate(v); } else if(nbComp == 3){ if(dim == 1) diff --git a/Plugin/ModulusPhase.cpp b/Plugin/ModulusPhase.cpp index a7436f6df761fc233a287e2013b1ef1ddc98623d..1cb562b41b50dbf039bfb68dc891bf83fed384bf 100644 --- a/Plugin/ModulusPhase.cpp +++ b/Plugin/ModulusPhase.cpp @@ -1,4 +1,4 @@ -// $Id: ModulusPhase.cpp,v 1.4 2006-11-27 22:22:32 geuzaine Exp $ +// $Id: ModulusPhase.cpp,v 1.5 2007-05-04 10:45:09 geuzaine Exp $ // // Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle // @@ -56,7 +56,7 @@ void GMSH_ModulusPhasePlugin::getName(char *name) const void GMSH_ModulusPhasePlugin::getInfos(char *author, char *copyright, char *help_text) const { - strcpy(author, "C. Geuzaine (geuz@geuz.org)"); + strcpy(author, "C. Geuzaine"); strcpy(copyright, "DGR (www.multiphysics.com)"); strcpy(help_text, "Plugin(ModulusPhase) interprets the time steps\n" diff --git a/Plugin/Probe.cpp b/Plugin/Probe.cpp index 5ab5b3eb9a59393400a9a0e2008b6117550e6069..5b283273a36976dc34079cf7f04d94c10491d282 100644 --- a/Plugin/Probe.cpp +++ b/Plugin/Probe.cpp @@ -1,4 +1,4 @@ -// $Id: Probe.cpp,v 1.13 2006-11-27 22:22:32 geuzaine Exp $ +// $Id: Probe.cpp,v 1.14 2007-05-04 10:45:09 geuzaine Exp $ // // Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle // @@ -129,7 +129,7 @@ void GMSH_ProbePlugin::getName(char *name) const void GMSH_ProbePlugin::getInfos(char *author, char *copyright, char *help_text) const { - strcpy(author, "C. Geuzaine (geuzaine@acm.caltech.edu)"); + strcpy(author, "C. Geuzaine"); strcpy(copyright, "DGR (www.multiphysics.com)"); strcpy(help_text, "Plugin(Probe) gets the value of the view `iView' at\n" diff --git a/Plugin/Remove.cpp b/Plugin/Remove.cpp index 3ac72b052ed65e666075e85b1b0cbc359ad237f0..575ca1b4ca6e689ce6d4eec903ce14e57e47d4d9 100644 --- a/Plugin/Remove.cpp +++ b/Plugin/Remove.cpp @@ -1,4 +1,4 @@ -// $Id: Remove.cpp,v 1.8 2006-11-27 22:22:32 geuzaine Exp $ +// $Id: Remove.cpp,v 1.9 2007-05-04 10:45:09 geuzaine Exp $ // // Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle // @@ -66,7 +66,7 @@ void GMSH_RemovePlugin::getName(char *name) const void GMSH_RemovePlugin::getInfos(char *author, char *copyright, char *help_text) const { - strcpy(author, "C. Geuzaine (geuz@geuz.org)"); + strcpy(author, "C. Geuzaine"); strcpy(copyright, "DGR (www.multiphysics.com)"); strcpy(help_text, "Plugin(Remove) removes the marked items\n" diff --git a/Plugin/Skin.cpp b/Plugin/Skin.cpp index 8f45ca9ce2744ecd5d29ff175e663bddd314d26f..92f5c248c464e0296f3e1d01f55b9e8e8725271f 100644 --- a/Plugin/Skin.cpp +++ b/Plugin/Skin.cpp @@ -1,4 +1,4 @@ -// $Id: Skin.cpp,v 1.32 2006-11-27 22:22:32 geuzaine Exp $ +// $Id: Skin.cpp,v 1.33 2007-05-04 10:45:09 geuzaine Exp $ // // Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle // @@ -60,7 +60,7 @@ void GMSH_SkinPlugin::getName(char *name) const void GMSH_SkinPlugin::getInfos(char *author, char *copyright, char *help_text) const { - strcpy(author, "C. Geuzaine (geuz@geuz.org)"); + strcpy(author, "C. Geuzaine"); strcpy(copyright, "DGR (www.multiphysics.com)"); strcpy(help_text, "Plugin(Skin) extracts the skin (the boundary) of\n" diff --git a/Plugin/Smooth.cpp b/Plugin/Smooth.cpp index 219bce99c2b6833281077078733a9eefea35a372..959447d99a12ea41eaf0c5912816c7b2f334e69d 100644 --- a/Plugin/Smooth.cpp +++ b/Plugin/Smooth.cpp @@ -1,4 +1,4 @@ -// $Id: Smooth.cpp,v 1.23 2006-11-27 22:22:32 geuzaine Exp $ +// $Id: Smooth.cpp,v 1.24 2007-05-04 10:45:09 geuzaine Exp $ // // Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle // @@ -53,7 +53,7 @@ void GMSH_SmoothPlugin::getName(char *name) const void GMSH_SmoothPlugin::getInfos(char *author, char *copyright, char *help_text) const { - strcpy(author, "C. Geuzaine (geuz@geuz.org)"); + strcpy(author, "C. Geuzaine"); strcpy(copyright, "DGR (www.multiphysics.com)"); strcpy(help_text, "Plugin(Smooth) averages the values at the nodes\n" diff --git a/Plugin/StreamLines.cpp b/Plugin/StreamLines.cpp index f4726ea79af13293eaffb224acf058a9af8264b2..b2ff5fbc858ae0b6fc5c9038ad24e75ff1dc6c12 100644 --- a/Plugin/StreamLines.cpp +++ b/Plugin/StreamLines.cpp @@ -1,4 +1,4 @@ -// $Id: StreamLines.cpp,v 1.24 2006-11-27 22:22:32 geuzaine Exp $ +// $Id: StreamLines.cpp,v 1.25 2007-05-04 10:45:09 geuzaine Exp $ // // Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle // @@ -167,7 +167,7 @@ void GMSH_StreamLinesPlugin::getName(char *name) const void GMSH_StreamLinesPlugin::getInfos(char *author, char *copyright, char *help_text) const { - strcpy(author, "J.-F. Remacle (remacle@scorec.rpi.edu)"); + strcpy(author, "J.-F. Remacle"); strcpy(copyright, "DGR (www.multiphysics.com)"); strcpy(help_text, "Plugin(StreamLines) computes stream lines\n" diff --git a/Plugin/Transform.cpp b/Plugin/Transform.cpp index 3725543431a94b45334de8ba55e41077d79487c9..cbb70f5d95aaa8f37e8b274f41bd9f1312d37fa3 100644 --- a/Plugin/Transform.cpp +++ b/Plugin/Transform.cpp @@ -1,4 +1,4 @@ -// $Id: Transform.cpp,v 1.33 2006-11-29 20:40:47 geuzaine Exp $ +// $Id: Transform.cpp,v 1.34 2007-05-04 10:45:09 geuzaine Exp $ // // Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle // @@ -66,7 +66,7 @@ void GMSH_TransformPlugin::getName(char *name) const void GMSH_TransformPlugin::getInfos(char *author, char *copyright, char *help_text) const { - strcpy(author, "C. Geuzaine (geuz@geuz.org)"); + strcpy(author, "C. Geuzaine"); strcpy(copyright, "DGR (www.multiphysics.com)"); strcpy(help_text, "Plugin(Transform) transforms the homogeneous\n" diff --git a/Plugin/Triangulate.cpp b/Plugin/Triangulate.cpp index 2c49d0f5f8325a497e5ae7c7093ead82a5911ff5..811a9b60c382723cb7735a46afb380a5d1894ef6 100644 --- a/Plugin/Triangulate.cpp +++ b/Plugin/Triangulate.cpp @@ -1,4 +1,4 @@ -// $Id: Triangulate.cpp,v 1.34 2007-01-16 11:31:42 geuzaine Exp $ +// $Id: Triangulate.cpp,v 1.35 2007-05-04 10:45:09 geuzaine Exp $ // // Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle // @@ -56,7 +56,7 @@ void GMSH_TriangulatePlugin::getName(char *name) const void GMSH_TriangulatePlugin::getInfos(char *author, char *copyright, char *help_text) const { - strcpy(author, "C. Geuzaine (geuz@geuz.org)"); + strcpy(author, "C. Geuzaine"); strcpy(copyright, "DGR (www.multiphysics.com)"); strcpy(help_text, "Plugin(Triangulate) triangulates the points in the\n" diff --git a/Plugin/Warp.cpp b/Plugin/Warp.cpp index dfa361640e47465bc483a4f2b955068987984c50..e378e22a875961413e4df462f251b5684a0d02dd 100644 --- a/Plugin/Warp.cpp +++ b/Plugin/Warp.cpp @@ -1,4 +1,4 @@ -// $Id: Warp.cpp,v 1.6 2007-02-26 08:25:46 geuzaine Exp $ +// $Id: Warp.cpp,v 1.7 2007-05-04 10:45:09 geuzaine Exp $ // // Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle // @@ -59,7 +59,7 @@ void GMSH_WarpPlugin::getName(char *name) const void GMSH_WarpPlugin::getInfos(char *author, char *copyright, char *help_text) const { - strcpy(author, "C. Geuzaine (geuz@geuz.org)"); + strcpy(author, "C. Geuzaine"); strcpy(copyright, "DGR (www.multiphysics.com)"); strcpy(help_text, "Plugin(Warp) transforms the elements in the\n" diff --git a/doc/TODO b/doc/TODO index 28d68affa54f219888d983d5771b6cdff3b79fcf..3e0319634a8f91fe088e12df66931e280863c3f3 100644 --- a/doc/TODO +++ b/doc/TODO @@ -1,4 +1,16 @@ -$Id: TODO,v 1.55 2007-03-23 08:44:41 geuzaine Exp $ +$Id: TODO,v 1.56 2007-05-04 10:45:09 geuzaine Exp $ + +******************************************************************** + +change the plugin GUI: have a single plugin dialog box, similar to the +option dialog, but with 2 browsers: views and plugins. Allow multiple +views selected at once. Add shortcut to this plugin panel (shift+u?). + +******************************************************************** + +remove "Apply next changes to all views" & co: just modify view +browser so that we can select multiple views, and apply changes to all +selected views? ******************************************************************** diff --git a/doc/VERSIONS b/doc/VERSIONS index edb92136f58f22e9fe7231c0e3b27739553a9afb..bfe3d2e114bdae1e97dd0a5aa588878d560a9ba2 100644 --- a/doc/VERSIONS +++ b/doc/VERSIONS @@ -1,4 +1,4 @@ -$Id: VERSIONS,v 1.383 2007-04-21 19:40:01 geuzaine Exp $ +$Id: VERSIONS,v 1.384 2007-05-04 10:45:09 geuzaine Exp $ new since 2.0: volumes can now be defined from external CAD surfaces; Delaunay/Tetgen algorithm is now used by default when available; @@ -8,7 +8,7 @@ limited set of geometrical primitives available in the GEO language, of course--so trying to convert e.g. a trimmed NURBS from a STEP file into a GEO file will fail); "lateral" entities are now added at the end of the list returned by extrusion commands; unused vertices are -not saved in mesh files anymore; fixed various bugs. +not saved in mesh files anymore; new plugin GUI; fixed various bugs. 2.0 (February 5, 2007): new geometry and mesh databases, with support for STEP and IGES import via OpenCascade; complete rewrite of geometry diff --git a/doc/texinfo/opt_general.texi b/doc/texinfo/opt_general.texi index 1f265fa7e16f7a30f1e00d66a60908cb49b925de..f5a4aaa2f2084109c7b85f990f3de781b5beab6c 100644 --- a/doc/texinfo/opt_general.texi +++ b/doc/texinfo/opt_general.texi @@ -674,6 +674,16 @@ Orthographic projection mode (0=perspective projection)@* Default value: @code{1}@* Saved in: @code{General.OptionsFileName} +@item General.PluginPositionX +Horizontal position (in pixels) of the upper left corner of the plugin window@* +Default value: @code{650}@* +Saved in: @code{General.SessionFileName} + +@item General.PluginPositionY +Vertical position (in pixels) of the upper left corner of the plugin window@* +Default value: @code{550}@* +Saved in: @code{General.SessionFileName} + @item General.PointSize Display size of points (in pixels)@* Default value: @code{3}@* diff --git a/doc/texinfo/opt_mesh.texi b/doc/texinfo/opt_mesh.texi index 536f5c78fafd6dc8b3da08759a53df1ff96bacfb..543b985a2f8f9367565378d994959e4e4b625760 100644 --- a/doc/texinfo/opt_mesh.texi +++ b/doc/texinfo/opt_mesh.texi @@ -99,6 +99,11 @@ Element order (1=linear elements, N (<6) = elements of higher order)@* Default value: @code{1}@* Saved in: @code{General.OptionsFileName} +@item Mesh.C1Continuity +Impose C1 continuity to high order meshes, only valid in 2D plane and ElemenOrder = 2 and 3 (todo) (Default : C0 continuity)@* +Default value: @code{0}@* +Saved in: @code{General.OptionsFileName} + @item Mesh.SmoothInternalEdges Number of smoothing steps of internal edges for high order meshes@* Default value: @code{0}@* diff --git a/doc/texinfo/opt_plugin.texi b/doc/texinfo/opt_plugin.texi index 37d32025759d1343575a60fd6e41020ba814fae5..8ea083e1cdde496a9224146fbf416951c570d2e5 100644 --- a/doc/texinfo/opt_plugin.texi +++ b/doc/texinfo/opt_plugin.texi @@ -5,15 +5,15 @@ @ftable @code @item Plugin(Annotate) -Plugin(Annotate) adds the text string `Text', in -font `Font' and size `FontSize', in the view `iView'. -If `3D' is equal to 1, the plugin inserts the -string in model coordinates at the position +Plugin(Annotate) adds the text string `Text', +in font `Font' and size `FontSize', in the view +`iView'. If `3D' is equal to 1, the plugin inserts +the string in model coordinates at the position (`X',`Y',`Z'). If `3D' is equal to 0, the plugin -inserts the string in screen coordinates at the -position (`X',`Y'). The string is aligned according -to `Align'. If `iView' < 0, the plugin is run on the -current view. +inserts the string in screen coordinates at +the position (`X',`Y'). The string is aligned +according to `Align'. If `iView' < 0, the plugin +is run on the current view. Plugin(Annotate) is executed in-place. @@ -58,14 +58,15 @@ Default value: @code{-1} @item Plugin(CutGrid) Plugin(CutGrid) cuts the view `iView' with a rectangular grid defined by the 3 points -(`X0',`Y0',`Z0') (origin), (`X1',`Y1',`Z1') (axis of U) -and (`X2',`Y2',`Z2') (axis of V). The number of points -along U and V is set with the options `nPointsU' -and `nPointsV'. If `ConnectPoints' is zero, the -plugin creates points; otherwise, the plugin -generates quadrangles, lines or points depending -on the values of `nPointsU' and `nPointsV'. If -`iView' < 0, the plugin is run on the current view. +(`X0',`Y0',`Z0') (origin), (`X1',`Y1',`Z1') (axis of +U) and (`X2',`Y2',`Z2') (axis of V). The number of +points along U and V is set with the options +`nPointsU' and `nPointsV'. If `ConnectPoints' is +zero, the plugin creates points; otherwise, the +plugin generates quadrangles, lines or points + depending on the values of `nPointsU' and +`nPointsV'. If `iView' < 0, the plugin is run on +the current view. Plugin(CutGrid) creates one new view. @@ -470,16 +471,12 @@ Plugin(Integrate) integrates scalar fields over all the elements in the view `iView', as well as the circulation/flux of vector fields over line/surface elements. If `iView' < 0, the -plugin is run on the current view. If -`ComputeLevelsetPositive' is set, the plugin -computes the positive area (volume) of the map. +plugin is run on the current view. Plugin(Integrate) creates one new view. Numeric options: @table @code -@item ComputeLevelsetPositive -Default value: @code{0} @item iView Default value: @code{-1} @end table diff --git a/doc/texinfo/shortcuts.texi b/doc/texinfo/shortcuts.texi index 9f73d22588f6a6e28f83b0e760983070c2d13956..3756899ff4f4d7181f0498e744954bb4cea03394 100644 --- a/doc/texinfo/shortcuts.texi +++ b/doc/texinfo/shortcuts.texi @@ -51,6 +51,8 @@ Show general options Show post-processing options @item Shift+s Show solver options +@item Shift+u +Show post-processing plugins @item Shift+w Show post-processing view options