diff --git a/Fltk/Callbacks.cpp b/Fltk/Callbacks.cpp index 3150c466a06661abc93df5b028185bdcf6c0884f..d69cf6ce9b38579ebf02128d54045385909d7c63 100644 --- a/Fltk/Callbacks.cpp +++ b/Fltk/Callbacks.cpp @@ -1,4 +1,4 @@ -// $Id: Callbacks.cpp,v 1.329 2005-01-13 09:22:03 geuzaine Exp $ +// $Id: Callbacks.cpp,v 1.330 2005-01-18 00:12:34 geuzaine Exp $ // // Copyright (C) 1997-2005 C. Geuzaine, J.-F. Remacle // @@ -1108,29 +1108,19 @@ void visibility_sort_cb(CALLBACK_ARGS) void visibility_number_cb(CALLBACK_ARGS) { - int pos, mode, type = WID->vis_input_mode->value(), val = (int)(long)data; - char *str = (char *)WID->vis_input->value(); + int pos, mode, type = (int)(long)data; - if(val){ // show - switch (WID->vis_browser_mode->value()) { - case 0: - mode = VIS_GEOM | VIS_MESH; - CTX.mesh.changed = 1; - break; - case 1: - mode = VIS_GEOM; - break; - default: - mode = VIS_MESH; - CTX.mesh.changed = 1; - break; - } + if(type >= 100){ // show + mode = VIS_GEOM | VIS_MESH; + type -= 100; + CTX.mesh.changed = 1; } else{ // hide mode = 0; CTX.mesh.changed = 1; } - + + char *str = (char *)WID->vis_input[type]->value(); SetVisibilityByNumber(str, type, mode); pos = WID->vis_browser->position(); visibility_cb(NULL, NULL); diff --git a/Fltk/GUI.cpp b/Fltk/GUI.cpp index a7ee66336df77c23205e89b0fa6d3d804fbea547..462ee3638037c0a7b085ec2ad098d428a883bd41 100644 --- a/Fltk/GUI.cpp +++ b/Fltk/GUI.cpp @@ -1,4 +1,4 @@ -// $Id: GUI.cpp,v 1.412 2005-01-13 20:35:35 geuzaine Exp $ +// $Id: GUI.cpp,v 1.413 2005-01-18 00:12:34 geuzaine Exp $ // // Copyright (C) 1997-2005 C. Geuzaine, J.-F. Remacle // @@ -3466,6 +3466,25 @@ void GUI::reset_visibility() } } +class Vis_Browser : public Fl_Browser{ + // special browser that reacts differently to Enter key + int handle(int event) + { + if(event == FL_KEYBOARD){ + switch(Fl::event_key()) { + case FL_Enter: + case FL_KP_Enter: + visibility_ok_cb(NULL, NULL); + return 1; + } + } + return Fl_Browser::handle(event); + } +public: + Vis_Browser(int x, int y, int w , int h, const char* c = 0) + : Fl_Browser(x, y, w, h, c){} +}; + void GUI::create_visibility_window() { @@ -3487,81 +3506,106 @@ void GUI::create_visibility_window() {"Mesh", 0, (Fl_Callback *) visibility_cb}, {0} }; - static Fl_Menu_Item input_mode_table[] = { - {"Node", 0, 0}, - {"Element", 0, 0}, - {"Point", 0, 0}, - {"Line", 0, 0}, - {"Surface", 0, 0}, - {"Volume", 0, 0}, - {0} - }; - int width = cols[0] + cols[1] + cols[2] + cols[3] + 2 * WB; + int width = cols[0] + cols[1] + cols[2] + cols[3] + 4 * WB; int height = 15 * BH; vis_window = new Dialog_Window(width, height, "Visibility"); vis_window->box(GMSH_WINDOW_BOX); - int brw = width - 2 * WB; - - vis_type = new Fl_Choice(1 * WB, 1 * WB + 0 * BH, brw / 3, BH); - vis_type->menu(type_table); + 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, "Browser"); - vis_browser_mode = new Fl_Choice(2 * WB + (brw - 2 * WB) / 3, 1 * WB + 0 * BH, (brw - 2 * WB) / 3, BH); - vis_browser_mode->menu(browser_mode_table); + int brw = width - 4 * WB; + int buw = (brw - 2 * WB)/3; - vis_butt[0] = new Fl_Check_Button(3 * WB + 2 * (brw - 2 * WB) / 3, 1 * WB + 0 * BH, (brw - 2 * WB) / 3, BH, "Recursive"); - vis_butt[0]->type(FL_TOGGLE_BUTTON); - vis_butt[0]->down_box(GMSH_TOGGLE_BOX); - vis_butt[0]->selection_color(GMSH_TOGGLE_COLOR); - vis_butt[0]->value(1); + vis_type = new Fl_Choice(2 * WB, 2 * WB + 1 * BH, buw, BH); + vis_type->menu(type_table); - Fl_Button *o0 = new Fl_Button(1 * WB, 2 * WB + 1 * BH, cols[0], BH, "*"); - o0->callback(visibility_sort_cb, (void *)0); + vis_browser_mode = new Fl_Choice(2 * WB + buw + WB, 2 * WB + 1 * BH, buw, BH); + vis_browser_mode->menu(browser_mode_table); - Fl_Button *o1 = new Fl_Button(1 * WB + cols[0], 2 * WB + 1 * BH, cols[1], BH, "Type"); - o1->align(FL_ALIGN_LEFT | FL_ALIGN_INSIDE); - o1->callback(visibility_sort_cb, (void *)1); + vis_butt[0] = new Fl_Check_Button(2 * WB + 2 * buw + 2 * WB, 2 * WB + 1 * BH, buw, BH, "Recursive"); + vis_butt[0]->type(FL_TOGGLE_BUTTON); + vis_butt[0]->down_box(GMSH_TOGGLE_BOX); + vis_butt[0]->selection_color(GMSH_TOGGLE_COLOR); + vis_butt[0]->value(1); - Fl_Button *o2 = new Fl_Button(1 * WB + cols[0] + cols[1], 2 * WB + 1 * BH, cols[2], BH, "Number"); - o2->align(FL_ALIGN_LEFT | FL_ALIGN_INSIDE); - o2->callback(visibility_sort_cb, (void *)2); + Fl_Button *o0 = new Fl_Button(2 * WB, 3 * WB + 2 * BH, cols[0], BH, "*"); + o0->callback(visibility_sort_cb, (void *)0); + + Fl_Button *o1 = new Fl_Button(2 * WB + cols[0], 3 * WB + 2 * BH, cols[1], BH, "Type"); + o1->align(FL_ALIGN_LEFT | FL_ALIGN_INSIDE); + o1->callback(visibility_sort_cb, (void *)1); - Fl_Button *o3 = new Fl_Button(1 * WB + cols[0] + cols[1] + cols[2], 2 * WB + 1 * BH, cols[3], BH, "Name"); - o3->align(FL_ALIGN_LEFT | FL_ALIGN_INSIDE); - o3->callback(visibility_sort_cb, (void *)3); + Fl_Button *o2 = new Fl_Button(2 * WB + cols[0] + cols[1], 3 * WB + 2 * BH, cols[2], BH, "Number"); + o2->align(FL_ALIGN_LEFT | FL_ALIGN_INSIDE); + o2->callback(visibility_sort_cb, (void *)2); - vis_browser = new Fl_Browser(1 * WB, 2 * WB + 2 * BH, brw, height - 5 * WB - 4 * BH); - vis_browser->textfont(FL_COURIER); - vis_browser->type(FL_MULTI_BROWSER); - vis_browser->column_widths(cols); + Fl_Button *o3 = new Fl_Button(2 * WB + cols[0] + cols[1] + cols[2], 3 * WB + 2 * BH, cols[3], BH, "Name"); + o3->align(FL_ALIGN_LEFT | FL_ALIGN_INSIDE); + o3->callback(visibility_sort_cb, (void *)3); + + { + Fl_Group *o = new Fl_Group(2 * WB, 3 * WB + 3 * BH, brw, height - 7 * WB - 5 * BH); + + vis_browser = new Vis_Browser(2 * WB, 3 * WB + 3 * BH, brw, height - 7 * WB - 5 * BH); + vis_browser->textfont(FL_COURIER); + vis_browser->type(FL_MULTI_BROWSER); + vis_browser->column_widths(cols); + + o->end(); + Fl_Group::current()->resizable(o); + } - vis_window->resizable(new Fl_Box(width - 3 * WB - 2 * BB - 10, 3 * WB + 2 * BH + 10, 10, 10)); - vis_window->size_range(width, 5 * BH + 5 * WB); + Fl_Return_Button *b = new Fl_Return_Button(width - BB - 2 * WB, height - 2 * BH - 3 * WB, BB, BH, "Apply"); + b->callback(visibility_ok_cb); + o->end(); + Fl_Group::current()->resizable(o); + } { - int ww = (((brw - 2 * WB) / 3) - WB) / 2; + Fl_Group *o = new Fl_Group(WB, WB + BH, width - 2 * WB, height - 3 * WB - BH, "Numeric Input"); + o->resizable(NULL); - Fl_Button *o1 = new Fl_Button(1 * WB, height - 2 * WB - 2 * BH, ww, BH, "Show"); - o1->callback(visibility_number_cb, (void *)1); - Fl_Button *o2 = new Fl_Button(2 * WB + ww, height - 2 * WB - 2 * BH, ww, BH, "Hide"); - o2->callback(visibility_number_cb, (void *)0); + for(int i = 0; i < 6; i++){ + vis_input[i] = new Fl_Input(width/2-WB/2-IW, 2 * WB + (i+1) * BH, IW, BH); + vis_input[i]->align(FL_ALIGN_LEFT); + vis_input[i]->value("*"); - vis_input_mode = new Fl_Choice(2 * WB + (brw - 2 * WB) / 3, height - 2 * WB - 2 * BH, - (brw - 2 * WB) / 3, BH); - vis_input_mode->menu(input_mode_table); - - vis_input = new Fl_Input(3 * WB + 2 * (brw - 2 * WB) / 3, height - 2 * WB - 2 * BH, - (brw - 2 * WB) / 3, BH); - vis_input->value("*"); - vis_input->tooltip("Enter an entity number, or *"); - } + Fl_Button *o1 = new Fl_Button(width/2+WB/2, 2 * WB + (i+1) * BH, BB, BH, "Show"); + o1->callback(visibility_number_cb, (void *)(100+i)); - { - Fl_Return_Button *o = new Fl_Return_Button(width - 2 * BB - 2 * WB, height - BH - WB, BB, BH, "Apply"); - o->callback(visibility_ok_cb); + Fl_Button *o2 = new Fl_Button(width/2+WB/2+BB+WB, 2 * WB + (i+1) * BH, BB, BH, "Hide"); + o2->callback(visibility_number_cb, (void *)i); + } + + vis_input[0]->label("Node"); + vis_input[0]->tooltip("Enter node number, or *"); + + vis_input[1]->label("Element"); + vis_input[1]->tooltip("Enter element number, or *"); + + vis_input[2]->label("Point"); + vis_input[2]->tooltip("Enter point number, or *"); + + vis_input[3]->label("Line"); + vis_input[3]->tooltip("Enter line number, or *"); + + vis_input[4]->label("Surface"); + vis_input[4]->tooltip("Enter surface number, or *"); + + vis_input[5]->label("Volume"); + vis_input[5]->tooltip("Enter volume number, or *"); + + o->end(); } + o->end(); + + vis_window->resizable(o); + vis_window->size_range(width, 8 * BH + 5 * WB, width); + { Fl_Button *o = new Fl_Button(width - BB - WB, height - BH - WB, BB, BH, "Cancel"); o->callback(cancel_cb, (void *)vis_window); diff --git a/Fltk/GUI.h b/Fltk/GUI.h index 3e3592f997ccdb09d4139ed21cb1fa069d752a09..4fd4baafb55ecad129ac58c2f4f6c0554d7f2d60 100644 --- a/Fltk/GUI.h +++ b/Fltk/GUI.h @@ -220,7 +220,7 @@ public: Fl_Choice *vis_type, *vis_browser_mode, *vis_input_mode ; Fl_Browser *vis_browser ; Fl_Check_Button *vis_butt[20] ; - Fl_Input *vis_input; + Fl_Input *vis_input[10]; // clipping planes window Fl_Window *clip_window ; diff --git a/Makefile b/Makefile index d8eb53855f28f6225910ecfe8bdb0f6cc11d37ee..013319ace25d2229538597855e5eec2810f1f345 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.386 2005-01-03 04:10:54 geuzaine Exp $ +# $Id: Makefile,v 1.387 2005-01-18 00:12:34 geuzaine Exp $ # # Copyright (C) 1997-2005 C. Geuzaine, J.-F. Remacle # @@ -22,8 +22,8 @@ include variables GMSH_MAJOR_VERSION = 1 -GMSH_MINOR_VERSION = 58 -GMSH_PATCH_VERSION = 1 +GMSH_MINOR_VERSION = 59 +GMSH_PATCH_VERSION = 0 GMSH_EXTRA_VERSION = "-cvs" GMSH_VERSION = ${GMSH_MAJOR_VERSION}.${GMSH_MINOR_VERSION}.${GMSH_PATCH_VERSION}${GMSH_EXTRA_VERSION} diff --git a/doc/VERSIONS b/doc/VERSIONS index 3bcae94dcde5ddda7bfa649df505d02a88bdb538..886296c5f2be5874993c18f9ee57fcd72e5e1e24 100644 --- a/doc/VERSIONS +++ b/doc/VERSIONS @@ -1,6 +1,6 @@ -$Id: VERSIONS,v 1.303 2005-01-14 22:53:21 geuzaine Exp $ +$Id: VERSIONS,v 1.304 2005-01-18 00:12:35 geuzaine Exp $ -New since 1.58: better support for discrete (triangulated) surfaces, +New in 1.59: added support for discrete (triangulated) surfaces, either in STL format or with the new "Discrete Surface" command; added STL and Text output format for post-processing views and STL output format for surface meshes; all levelset-based plugins can now also @@ -10,8 +10,8 @@ Plugin(CutGrid); new plugins (Eigenvalues, Gradient, Curl, Divergence); changed default colormap to match Matlab's "Jet" colormap; new transformation matrix option for views (for non-destructive rotations, symmetries, etc.); improved solver -interface to keep the GUI responsive during solver calls; fixed small -bugs. +interface to keep the GUI responsive during solver calls; simplified +Tools->Visibility GUI; fixed small bugs. New in 1.58: fixed UNIX socket interface on Windows (broken by the TCP solver patch in 1.57); bumped version number of default diff --git a/doc/gmsh.html b/doc/gmsh.html index f5b36966e26b368078d4861bdad15d1aedc9c34a..1ee679d98ca2908f693fec23f8387f71e9614953 100644 --- a/doc/gmsh.html +++ b/doc/gmsh.html @@ -25,7 +25,7 @@ generator with built-in pre- and post-processing facilities</h1> <p> <h3 align="center">Christophe Geuzaine and Jean-Fran�ois Remacle</h3> <p> -<h3 align=center>Version <a href="doc/VERSIONS">1.58</a>, January 1st 2005</h3> +<h3 align=center>Version <a href="doc/VERSIONS">1.59</a>, 17 January 2005</h3> <p> <center> <a href="#Description">Description</a> | @@ -106,11 +106,11 @@ Linux and Mac OS X. The tutorial and demo files are included in the archives. <ul> -<li><a href="/gmsh/bin/Windows/gmsh-1.58.0-Windows.zip">Windows zip archive (95/98/NT/2000/XP)</a> -<li><a href="/gmsh/bin/Linux/gmsh-1.58.0-1.i386.rpm">Linux RPM (i386, Red Hat >= 7.3)</a> -<li><a href="/gmsh/bin/Linux/gmsh-1.58.0-Linux.tgz">Linux tarball (i386, glibc >= 2.2)</a> -<li><a href="/gmsh/bin/MacOSX/gmsh-1.58.0-MacOSX.tgz">Mac OS X tarball (Mac OS X >= 10.2)</a> -<li><a href="/gmsh/src/gmsh-1.58.0-source.tgz">Source tarball (all platforms)</a> +<li><a href="/gmsh/bin/Windows/gmsh-1.59.0-Windows.zip">Windows zip archive (95/98/NT/2000/XP)</a> +<li><a href="/gmsh/bin/Linux/gmsh-1.59.0-1.i386.rpm">Linux RPM (i386, Red Hat >= 7.3)</a> +<li><a href="/gmsh/bin/Linux/gmsh-1.59.0-Linux.tgz">Linux tarball (i386, glibc >= 2.2)</a> +<li><a href="/gmsh/bin/MacOSX/gmsh-1.59.0-MacOSX.tgz">Mac OS X tarball (Mac OS X >= 10.2)</a> +<li><a href="/gmsh/src/gmsh-1.59.0-source.tgz">Source tarball (all platforms)</a> <a href="#build-footnote" name="build-footmark"><sup>2</sup></a> </ul> diff --git a/doc/texinfo/gmsh.texi b/doc/texinfo/gmsh.texi index e556d48bdb394ddb23e59fe09577c67f555fb328..84f13ff61281bc2350a48f973c217df1fa28dbe0 100644 --- a/doc/texinfo/gmsh.texi +++ b/doc/texinfo/gmsh.texi @@ -1,5 +1,5 @@ \input texinfo.tex @c -*-texinfo-*- -@c $Id: gmsh.texi,v 1.167 2005-01-14 17:54:01 geuzaine Exp $ +@c $Id: gmsh.texi,v 1.168 2005-01-18 00:12:35 geuzaine Exp $ @c @c Copyright (C) 1997-2005 C. Geuzaine, J.-F. Remacle @c @@ -37,8 +37,8 @@ @c ========================================================================= @c %**start of header @setfilename gmsh.info -@set EDITION 1.29 -@set GMSH-VERSION 1.58 +@set EDITION 1.30 +@set GMSH-VERSION 1.59 @set GMSH-WEB @uref{http://www.geuz.org/gmsh/} @set COPYRIGHT @copyright{} 1997-2005 Christophe Geuzaine, Jean-Fran@,{c}ois Remacle @c