diff --git a/Common/Context.h b/Common/Context.h index cc2a451c6e7e7a7e3eef00aa4067dd082740115f..8c2900debc4c32b115a149bcdfde7a9b6fb1eb59 100644 --- a/Common/Context.h +++ b/Common/Context.h @@ -168,7 +168,7 @@ public : double gamma_inf, gamma_sup, radius_inf, radius_sup; double scaling_factor, lc_factor, rand_factor; int dual, interactive; - int solid, light; + int light; int format, nb_smoothing, algo, order; int point_insertion, speed_max, min_circ_points, constrained_bgmesh; int histogram, initial_only; diff --git a/Common/DefaultOptions.h b/Common/DefaultOptions.h index 05a39168ff4b2d7352b7305bb2ed66ba70a3fad2..1ab63e4eab94cecebd390e4be975d45c1d18361b 100644 --- a/Common/DefaultOptions.h +++ b/Common/DefaultOptions.h @@ -810,13 +810,11 @@ StringXNumber MeshOptions_Number[] = { "Global scaling factor applied to the saved mesh" }, { F|O, "Smoothing" , opt_mesh_nb_smoothing , 0. , "Number of smoothing steps applied to the final mesh" }, - { F|O, "Solid" , opt_mesh_solid , 0. , - "Draw mesh as solid (1) or wireframe (0)?" }, { F|O, "SpeedMax" , opt_mesh_speed_max , 0. , "Disable dubious point insertion tests" }, { F|O, "SurfaceEdges" , opt_mesh_surfaces_edges , 1. , "Display edges of surface mesh?" }, - { F|O, "SurfaceFaces" , opt_mesh_surfaces_faces , 1. , + { F|O, "SurfaceFaces" , opt_mesh_surfaces_faces , 0. , "Display faces of surface mesh?" }, { F|O, "SurfaceNumbers" , opt_mesh_surfaces_num , 0. , "Display surface mesh element numbers?" }, diff --git a/Common/Options.cpp b/Common/Options.cpp index 024b892831dfa4b3a2cb30bf08ab22e22825a7f9..11d5bddcbc4de1ed71342ce5c69087b1cf38c8e9 100644 --- a/Common/Options.cpp +++ b/Common/Options.cpp @@ -1,4 +1,4 @@ -// $Id: Options.cpp,v 1.145 2004-04-19 21:59:14 geuzaine Exp $ +// $Id: Options.cpp,v 1.146 2004-04-20 21:47:36 geuzaine Exp $ // // Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle // @@ -3349,19 +3349,6 @@ double opt_mesh_line_type(OPT_ARGS_NUM) return CTX.mesh.line_type; } -double opt_mesh_solid(OPT_ARGS_NUM) -{ - if(action & GMSH_SET) { - CTX.mesh.solid = (int)val; - CTX.mesh.changed = 1; - } -#if defined(HAVE_FLTK) - if(WID && (action & GMSH_GUI)) - WID->mesh_butt[16]->value(CTX.mesh.solid); -#endif - return CTX.mesh.solid; -} - double opt_mesh_light(OPT_ARGS_NUM) { if(action & GMSH_SET) diff --git a/Common/Options.h b/Common/Options.h index 15872fae86e2897b30aa8540c2083b3f8cc9b189..861c679a71bb6ab94ebf95fcc1d32483c13b7a3c 100644 --- a/Common/Options.h +++ b/Common/Options.h @@ -363,7 +363,6 @@ double opt_mesh_point_size(OPT_ARGS_NUM); double opt_mesh_point_type(OPT_ARGS_NUM); double opt_mesh_line_width(OPT_ARGS_NUM); double opt_mesh_line_type(OPT_ARGS_NUM); -double opt_mesh_solid(OPT_ARGS_NUM); double opt_mesh_light(OPT_ARGS_NUM); double opt_mesh_format(OPT_ARGS_NUM); double opt_mesh_msh_file_version(OPT_ARGS_NUM); diff --git a/Fltk/Callbacks.cpp b/Fltk/Callbacks.cpp index 2f4bd343b67ca73128977d31182b89f96334f255..2f99f05bdb004d95827086e10e3a543547fd4688 100644 --- a/Fltk/Callbacks.cpp +++ b/Fltk/Callbacks.cpp @@ -1,4 +1,4 @@ -// $Id: Callbacks.cpp,v 1.215 2004-04-19 21:59:14 geuzaine Exp $ +// $Id: Callbacks.cpp,v 1.216 2004-04-20 21:47:36 geuzaine Exp $ // // Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle // @@ -1087,7 +1087,6 @@ void mesh_options_ok_cb(CALLBACK_ARGS) opt_mesh_lines_num(0, GMSH_SET, WID->mesh_butt[13]->value()); opt_mesh_surfaces_num(0, GMSH_SET, WID->mesh_butt[14]->value()); opt_mesh_volumes_num(0, GMSH_SET, WID->mesh_butt[15]->value()); - opt_mesh_solid(0, GMSH_SET, WID->mesh_butt[16]->value()); opt_mesh_light(0, GMSH_SET, WID->mesh_butt[17]->value()); opt_mesh_color_carousel(0, GMSH_SET, WID->mesh_butt[18]->value()? 0 : diff --git a/Fltk/GUI.cpp b/Fltk/GUI.cpp index 68d660371c108e7b6b9ffaf3c806c3e6bf6a2322..720c5581a4c64be3c6fbff7a8f95b4841cf0826f 100644 --- a/Fltk/GUI.cpp +++ b/Fltk/GUI.cpp @@ -1,4 +1,4 @@ -// $Id: GUI.cpp,v 1.284 2004-04-19 21:59:14 geuzaine Exp $ +// $Id: GUI.cpp,v 1.285 2004-04-20 21:47:36 geuzaine Exp $ // // Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle // @@ -548,8 +548,8 @@ int GUI::global_shortcuts(int event) return 1; } else if(Fl::test_shortcut(FL_ALT + 'd')) { - opt_mesh_solid(0, GMSH_SET | GMSH_GUI, - !opt_mesh_solid(0, GMSH_GET, 0)); + opt_mesh_surfaces_faces(0, GMSH_SET | GMSH_GUI, + !opt_mesh_surfaces_faces(0, GMSH_GET, 0)); redraw_opengl(); return 1; } @@ -1848,23 +1848,21 @@ void GUI::create_option_window() { Fl_Group *o = new Fl_Group(WB, WB + BH, width - 2 * WB, height - 2 * WB - BH, "Aspect"); o->hide(); - mesh_butt[16] = new Fl_Check_Button(2 * WB, 2 * WB + 1 * BH, BW, BH, "Draw as solid (hidden surfaces)"); - mesh_butt[17] = new Fl_Check_Button(2 * WB, 2 * WB + 2 * BH, BW, BH, "Enable lighting"); - for(i = 16; i < 18; i++) { - mesh_butt[i]->type(FL_TOGGLE_BUTTON); - mesh_butt[i]->down_box(TOGGLE_BOX); - mesh_butt[i]->selection_color(TOGGLE_COLOR); - mesh_butt[i]->selection_color(RADIO_COLOR); - } - mesh_value[9] = new Fl_Value_Input(2 * WB, 2 * WB + 3 * BH, IW, BH, "Explode elements"); + mesh_butt[17] = new Fl_Check_Button(2 * WB, 2 * WB + 1 * BH, BW, BH, "Enable lighting"); + mesh_butt[17]->type(FL_TOGGLE_BUTTON); + mesh_butt[17]->down_box(TOGGLE_BOX); + mesh_butt[17]->selection_color(TOGGLE_COLOR); + mesh_butt[17]->selection_color(RADIO_COLOR); + + mesh_value[9] = new Fl_Value_Input(2 * WB, 2 * WB + 2 * BH, IW, BH, "Explode elements"); mesh_value[9]->minimum(0); mesh_value[9]->maximum(1); mesh_value[9]->step(0.01); - mesh_value[10] = new Fl_Value_Input(2 * WB, 2 * WB + 5 * BH, IW, BH, "Point size"); + mesh_value[10] = new Fl_Value_Input(2 * WB, 2 * WB + 4 * BH, IW, BH, "Point size"); mesh_value[10]->minimum(0.1); mesh_value[10]->maximum(50); mesh_value[10]->step(0.1); - mesh_value[11] = new Fl_Value_Input(2 * WB, 2 * WB + 7 * BH, IW, BH, "Line width"); + mesh_value[11] = new Fl_Value_Input(2 * WB, 2 * WB + 6 * BH, IW, BH, "Line width"); mesh_value[11]->minimum(0.1); mesh_value[11]->maximum(50); mesh_value[11]->step(0.1); @@ -1872,11 +1870,11 @@ void GUI::create_option_window() mesh_value[i]->align(FL_ALIGN_RIGHT); } - mesh_choice[0] = new Fl_Choice(2 * WB, 2 * WB + 4 * BH, IW, BH, "Point display"); + mesh_choice[0] = new Fl_Choice(2 * WB, 2 * WB + 3 * BH, IW, BH, "Point display"); mesh_choice[0]->menu(menu_point_display); mesh_choice[0]->align(FL_ALIGN_RIGHT); - mesh_choice[1] = new Fl_Choice(2 * WB, 2 * WB + 6 * BH, IW, BH, "Line display"); + mesh_choice[1] = new Fl_Choice(2 * WB, 2 * WB + 5 * BH, IW, BH, "Line display"); mesh_choice[1]->menu(menu_line_display); mesh_choice[1]->align(FL_ALIGN_RIGHT); mesh_choice[1]->deactivate(); // don't give false hopes, as it's not used anywhere right now diff --git a/Graphics/Mesh.cpp b/Graphics/Mesh.cpp index 115e18d37cf2dc74e0fbfe3551960abcfe45af2d..7be93a88c088dc17831d29ce4a167a21ea6eb24d 100644 --- a/Graphics/Mesh.cpp +++ b/Graphics/Mesh.cpp @@ -1,4 +1,4 @@ -// $Id: Mesh.cpp,v 1.73 2004-04-20 20:55:41 geuzaine Exp $ +// $Id: Mesh.cpp,v 1.74 2004-04-20 21:47:36 geuzaine Exp $ // // Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle // @@ -368,7 +368,10 @@ void Draw_Simplex_Volume(void *a, void *b) return; } - if(!CTX.mesh.solid){ + if(CTX.mesh.surfaces_faces || CTX.mesh.volumes_faces){ + glColor4ubv((GLubyte *) & CTX.color.mesh.line); + } + else{ if(theColor.type) glColor4ubv((GLubyte *) & theColor.mesh); else if(CTX.mesh.color_carousel == 1) @@ -380,8 +383,6 @@ void Draw_Simplex_Volume(void *a, void *b) else glColor4ubv((GLubyte *) & CTX.color.mesh.tetrahedron); } - else - glColor4ubv((GLubyte *) & CTX.color.mesh.line); for(int i = 0; i < 4; i++) { X[i] = Xc + CTX.mesh.explode * (s->V[i]->Pos.X - Xc); @@ -459,7 +460,7 @@ void Draw_Simplex_Volume(void *a, void *b) gl2psDisable(GL2PS_LINE_STIPPLE); } - if(CTX.mesh.volumes_faces && CTX.mesh.solid){ + if(CTX.mesh.volumes_faces){ if(theColor.type) glColor4ubv((GLubyte *) & theColor.mesh); else if(CTX.mesh.color_carousel == 1) @@ -579,7 +580,10 @@ void Draw_Simplex_Surface_Common(Simplex * s, int L, int K, if(CTX.mesh.normals || CTX.mesh.light) glNormal3verts(s->V[0], s->V[1], s->V[2], n); - if(!CTX.mesh.solid){ + if(CTX.mesh.surfaces_faces){ + glColor4ubv((GLubyte *) & CTX.color.mesh.line); + } + else{ if(theColor.type) glColor4ubv((GLubyte *) & theColor.mesh); else if(CTX.mesh.color_carousel == 1) @@ -593,9 +597,6 @@ void Draw_Simplex_Surface_Common(Simplex * s, int L, int K, else glColor4ubv((GLubyte *) & CTX.color.mesh.quadrangle); } - else { - glColor4ubv((GLubyte *) & CTX.color.mesh.line); - } if(CTX.mesh.surfaces_edges){ glBegin(GL_LINE_LOOP); @@ -605,7 +606,7 @@ void Draw_Simplex_Surface_Common(Simplex * s, int L, int K, glEnd(); } - if(CTX.mesh.surfaces_faces && CTX.mesh.solid) { + if(CTX.mesh.surfaces_faces) { if(theColor.type) glColor4ubv((GLubyte *) & theColor.mesh); @@ -790,7 +791,7 @@ void Draw_Simplex_Surface(void *a, void *b) Draw_Simplex_Surface_Common(s, L, K, pX, pY, pZ, n); if(CTX.mesh.surfaces_num) { - if(CTX.mesh.solid) + if(CTX.mesh.surfaces_faces) glColor4ubv((GLubyte *) & CTX.color.mesh.line); sprintf(Num, "%d", s->Num); glRasterPos3d(Xc, Yc, Zc); @@ -931,7 +932,10 @@ void Draw_Hexahedron_Volume(void *a, void *b) return; } - if(!CTX.mesh.solid){ + if(CTX.mesh.surfaces_faces || CTX.mesh.volumes_faces){ + glColor4ubv((GLubyte *) & CTX.color.mesh.line); + } + else{ if(theColor.type) glColor4ubv((GLubyte *) & theColor.mesh); else if(CTX.mesh.color_carousel == 1) @@ -943,8 +947,6 @@ void Draw_Hexahedron_Volume(void *a, void *b) else glColor4ubv((GLubyte *) & CTX.color.mesh.hexahedron); } - else - glColor4ubv((GLubyte *) & CTX.color.mesh.line); for(i = 0; i < 8; i++) { X[i] = Xc + CTX.mesh.explode * (h->V[i]->Pos.X - Xc); @@ -1085,7 +1087,10 @@ void Draw_Prism_Volume(void *a, void *b) return; } - if(!CTX.mesh.solid){ + if(CTX.mesh.surfaces_faces || CTX.mesh.volumes_faces){ + glColor4ubv((GLubyte *) & CTX.color.mesh.line); + } + else{ if(theColor.type) glColor4ubv((GLubyte *) & theColor.mesh); else if(CTX.mesh.color_carousel == 1) @@ -1097,8 +1102,6 @@ void Draw_Prism_Volume(void *a, void *b) else glColor4ubv((GLubyte *) & CTX.color.mesh.prism); } - else - glColor4ubv((GLubyte *) & CTX.color.mesh.line); for(i = 0; i < 6; i++) { X[i] = Xc + CTX.mesh.explode * (p->V[i]->Pos.X - Xc); @@ -1221,7 +1224,10 @@ void Draw_Pyramid_Volume(void *a, void *b) return; } - if(!CTX.mesh.solid){ + if(CTX.mesh.surfaces_faces || CTX.mesh.volumes_faces){ + glColor4ubv((GLubyte *) & CTX.color.mesh.line); + } + else{ if(theColor.type) glColor4ubv((GLubyte *) & theColor.mesh); else if(CTX.mesh.color_carousel == 1) @@ -1233,8 +1239,6 @@ void Draw_Pyramid_Volume(void *a, void *b) else glColor4ubv((GLubyte *) & CTX.color.mesh.pyramid); } - else - glColor4ubv((GLubyte *) & CTX.color.mesh.line); for(i = 0; i < 5; i++) { X[i] = Xc + CTX.mesh.explode * (p->V[i]->Pos.X - Xc);