diff --git a/Common/Context.h b/Common/Context.h index afd1bb815b03689c5b98ff71f148af7c838600fb..9ad3591423dbe1d47a950c068956f676fc9f795b 100644 --- a/Common/Context.h +++ b/Common/Context.h @@ -127,6 +127,7 @@ public : int points, lines, surfaces, volumes; int points_num, lines_num, surfaces_num, volumes_num; double point_size, line_width, point_sel_size, line_sel_width; + int point_type; // flat or 3D sphere int hidden, shade; int highlight; int level, old_circle, circle_points, extrude_spline_points, old_newreg; diff --git a/Common/DefaultOptions.h b/Common/DefaultOptions.h index 62ce930e87cd1caa7828159be891b04dedd80953..f7248e5a7a32b2388706c693c87e494741a19fa2 100644 --- a/Common/DefaultOptions.h +++ b/Common/DefaultOptions.h @@ -611,6 +611,8 @@ StringXNumber GeometryOptions_Number[] = { "Display size of selected points (in pixels)" }, { F|O, "PointSize" , opt_geometry_point_size , 3. , "Display size of points (in pixels)" }, + { F|O, "PointType" , opt_geometry_point_type , 0. , + "Display points as solid color dots or 3D spheres" }, { F|O, "ScalingFactor" , opt_geometry_scaling_factor , 1.0 , "Global geometry scaling factor" }, diff --git a/Common/Options.cpp b/Common/Options.cpp index ea84860f9030904faa50d42c95774782a78f6f19..c0a831a542844d02e67ba51b2f3d62935afeddc9 100644 --- a/Common/Options.cpp +++ b/Common/Options.cpp @@ -1,4 +1,4 @@ -// $Id: Options.cpp,v 1.87 2002-10-12 19:41:13 geuzaine Exp $ +// $Id: Options.cpp,v 1.88 2002-11-01 22:27:33 geuzaine Exp $ // // Copyright (C) 1997 - 2002 C. Geuzaine, J.-F. Remacle // @@ -1591,8 +1591,23 @@ double opt_geometry_point_size(OPT_ARGS_NUM){ double opt_geometry_point_sel_size(OPT_ARGS_NUM){ if(action & GMSH_SET) CTX.geom.point_sel_size = val; +#ifdef _FLTK + if(WID && (action & GMSH_GUI)) + WID->geo_value[5]->value(CTX.geom.point_sel_size); +#endif return CTX.geom.point_sel_size; } +double opt_geometry_point_type(OPT_ARGS_NUM){ + if(action & GMSH_SET){ + CTX.geom.point_type = (int)val; + } +#ifdef _FLTK + if(WID && (action & GMSH_GUI)){ + WID->geo_choice[0]->value(CTX.geom.point_type); + } +#endif + return CTX.geom.point_type; +} double opt_geometry_line_width(OPT_ARGS_NUM){ if(action & GMSH_SET) CTX.geom.line_width = val; diff --git a/Common/Options.h b/Common/Options.h index 0403bec0f4820cf62228ab3dee92adbd9d05a8c6..95412388acdcf4cb9415cb7c269736a202877bd5 100644 --- a/Common/Options.h +++ b/Common/Options.h @@ -302,6 +302,7 @@ double opt_geometry_surfaces_num(OPT_ARGS_NUM); double opt_geometry_volumes_num(OPT_ARGS_NUM); double opt_geometry_point_size(OPT_ARGS_NUM); double opt_geometry_point_sel_size(OPT_ARGS_NUM); +double opt_geometry_point_type(OPT_ARGS_NUM); double opt_geometry_line_width(OPT_ARGS_NUM); double opt_geometry_line_sel_width(OPT_ARGS_NUM); double opt_geometry_aspect(OPT_ARGS_NUM); diff --git a/Fltk/Callbacks.cpp b/Fltk/Callbacks.cpp index 614951dcc81bd80a4b74ad2dc2e5ce282fbec07e..8e07e3f1d8243407a9b0c067c60a3cb297e84adb 100644 --- a/Fltk/Callbacks.cpp +++ b/Fltk/Callbacks.cpp @@ -1,4 +1,4 @@ -// $Id: Callbacks.cpp,v 1.145 2002-11-01 19:00:29 geuzaine Exp $ +// $Id: Callbacks.cpp,v 1.146 2002-11-01 22:27:33 geuzaine Exp $ // // Copyright (C) 1997 - 2002 C. Geuzaine, J.-F. Remacle // @@ -666,6 +666,9 @@ void opt_geometry_ok_cb(CALLBACK_ARGS) { opt_geometry_tangents(0, GMSH_SET, WID->geo_value[1]->value()); opt_geometry_point_size(0, GMSH_SET, WID->geo_value[3]->value()); opt_geometry_line_width(0, GMSH_SET, WID->geo_value[4]->value()); + opt_geometry_point_sel_size(0, GMSH_SET, WID->geo_value[5]->value()); + + opt_geometry_point_type(0, GMSH_SET, WID->geo_choice[0]->value()); Draw(); } diff --git a/Fltk/GUI.cpp b/Fltk/GUI.cpp index ee326e6d46b279630ab52402c03e59cd7466cd7d..1555096f0c336a9823b55017d228b15717bc55c5 100644 --- a/Fltk/GUI.cpp +++ b/Fltk/GUI.cpp @@ -1,4 +1,4 @@ -// $Id: GUI.cpp,v 1.202 2002-11-01 19:00:29 geuzaine Exp $ +// $Id: GUI.cpp,v 1.203 2002-11-01 22:27:33 geuzaine Exp $ // // Copyright (C) 1997 - 2002 C. Geuzaine, J.-F. Remacle // @@ -1320,11 +1320,27 @@ void GUI::create_geometry_options_window(){ geo_value[3]->minimum(0.1); geo_value[3]->maximum(50); geo_value[3]->step(0.1); - geo_value[4] = new Fl_Value_Input(2*WB, 2*WB+2*BH, IW, BH, "Line width"); + + geo_value[5] = new Fl_Value_Input(2*WB, 2*WB+2*BH, IW, BH, "Highlighted point size"); + geo_value[5]->minimum(0.1); + geo_value[5]->maximum(50); + geo_value[5]->step(0.1); + + static Fl_Menu_Item menu_geopointtype[] = { + {"Color dot", 0, 0, 0}, + {"3D sphere", 0, 0, 0}, + {0} + }; + geo_choice[0] = new Fl_Choice(2*WB, 2*WB+3*BH, IW, BH, "Point display"); + geo_choice[0]->menu(menu_geopointtype); + geo_choice[0]->align(FL_ALIGN_RIGHT); + + geo_value[4] = new Fl_Value_Input(2*WB, 2*WB+4*BH, IW, BH, "Line width"); geo_value[4]->minimum(0.1); geo_value[4]->maximum(50); geo_value[4]->step(0.1); - for(i=3 ; i<= 4 ; i++){ + + for(i=3 ; i<= 5 ; i++){ geo_value[i]->align(FL_ALIGN_RIGHT); } o->end(); diff --git a/Fltk/GUI.h b/Fltk/GUI.h index 191e8031d7ae0fe76f9bbf261b9270ec0eda071c..71af658ac1c398c2fca477766f6d95fd9c204ae7 100644 --- a/Fltk/GUI.h +++ b/Fltk/GUI.h @@ -161,6 +161,7 @@ public: Fl_Input *geo_input ; Fl_Value_Input *geo_value[10] ; Fl_Button *geo_col[50] ; + Fl_Choice *geo_choice[5] ; // mesh options window Fl_Window *mesh_window ; diff --git a/Graphics/Geom.cpp b/Graphics/Geom.cpp index 6b5e6aeb2a2deb32a067dc66d9c6775fd8592a32..e08c2862b7f26ed4253cc2d72a636e885e4bd4b1 100644 --- a/Graphics/Geom.cpp +++ b/Graphics/Geom.cpp @@ -1,4 +1,4 @@ -// $Id: Geom.cpp,v 1.38 2002-09-20 19:53:08 geuzaine Exp $ +// $Id: Geom.cpp,v 1.39 2002-11-01 22:27:33 geuzaine Exp $ // // Copyright (C) 1997 - 2002 C. Geuzaine, J.-F. Remacle // @@ -69,9 +69,27 @@ void Draw_GeoPoint (void *a, void *b){ } if(CTX.geom.points){ - glBegin(GL_POINTS); - glVertex3d(v->Pos.X, v->Pos.Y, v->Pos.Z); - glEnd(); + + if(CTX.geom.point_type){ + static GLUquadricObj *qua; + static int first=1; + if(first){ + first=0; + qua = gluNewQuadric(); + } + glPushMatrix(); + glTranslatef(v->Pos.X, v->Pos.Y, v->Pos.Z); + if(v->Frozen || Highlighted) + gluSphere(qua, CTX.geom.point_sel_size*CTX.pixel_equiv_x/CTX.s[0], 20,20); + else + gluSphere(qua, CTX.geom.point_size*CTX.pixel_equiv_x/CTX.s[0], 20,20); + glPopMatrix(); + } + else{ + glBegin(GL_POINTS); + glVertex3d(v->Pos.X, v->Pos.Y, v->Pos.Z); + glEnd(); + } } if(CTX.geom.points_num){ @@ -616,8 +634,11 @@ void Draw_Geom (Mesh *m) { if(m->status == -1) return; - if(CTX.geom.points || CTX.geom.points_num) + if(CTX.geom.points || CTX.geom.points_num){ + if(CTX.geom.point_type) InitShading(); Tree_Action(m->Points, Draw_GeoPoint); + if(CTX.geom.point_type && !CTX.geom.shade) InitNoShading(); + } if(CTX.geom.lines || CTX.geom.lines_num) Tree_Action(m->Curves, Draw_Curve ); if(CTX.geom.surfaces || CTX.geom.surfaces_num)