diff --git a/Common/Context.h b/Common/Context.h index f3ae108b0bd6bd9a1e5e1cd9bc2d122561190ed2..75bb5f9a208a9638d52c36b1d645db7719d8c315 100644 --- a/Common/Context.h +++ b/Common/Context.h @@ -154,7 +154,6 @@ public : // post processing options struct{ int draw, scales, link ; - int point_size, line_width; int smooth ; int nb_views ; double anim_delay ; diff --git a/Common/DefaultOptions.h b/Common/DefaultOptions.h index c56f4f94bdde0455fd51ea13a5dfbac29c9836a9..077b4a45a7e9cc0ede2ca9b4d3c3bb41a29a2873 100644 --- a/Common/DefaultOptions.h +++ b/Common/DefaultOptions.h @@ -429,10 +429,6 @@ StringXNumber PostProcessingOptions_Number[] = { "Delay (in seconds) between to animation frames" }, { F, "NbViews" , opt_post_nb_views , 0. , "Current number of views merged (do _not_ change this!)" }, - { F|O, "PointSize" , opt_post_point_size , 2. , - "Display size of points (in pixels)" }, - { F|O, "LineWidth" , opt_post_line_width , 1. , - "Display width of lines (in pixels)" }, { 0, NULL , NULL , 0. } } ; @@ -511,6 +507,10 @@ StringXNumber ViewOptions_Number[] = { "Vector display type (1=segment, 2=arrow, 3=pyramid, 4=cone, 5=displacement)" }, { F|O, "ArrowLocation" , opt_view_arrow_location , DRAW_POST_LOCATE_COG , "Arrow location (1=cog, 2=vertex)" }, + { F|O, "PointSize" , opt_view_point_size , 2. , + "Display size of points (in pixels)" }, + { F|O, "LineWidth" , opt_view_line_width , 1. , + "Display width of lines (in pixels)" }, { 0, NULL , NULL , 0. , NULL } } ; diff --git a/Common/Options.cpp b/Common/Options.cpp index 7fe48eb51922ed2c7897ac3bb10cf54aab05fa44..8bc4d25733f7c0f1d1c91da180b60da65ba13882 100644 --- a/Common/Options.cpp +++ b/Common/Options.cpp @@ -1,4 +1,4 @@ -// $Id: Options.cpp,v 1.47 2001-09-25 08:20:50 geuzaine Exp $ +// $Id: Options.cpp,v 1.48 2001-09-26 08:28:12 geuzaine Exp $ #include "Gmsh.h" #include "GmshUI.h" @@ -1595,16 +1595,6 @@ double opt_post_nb_views(OPT_ARGS_NUM){ CTX.post.nb_views = (int)val; return CTX.post.nb_views; } -double opt_post_point_size(OPT_ARGS_NUM){ - if(action & GMSH_SET) - CTX.post.point_size = (int)val; - return CTX.post.point_size; -} -double opt_post_line_width(OPT_ARGS_NUM){ - if(action & GMSH_SET) - CTX.post.line_width = (int)val; - return CTX.post.line_width; -} @@ -2066,6 +2056,22 @@ double opt_view_arrow_location(OPT_ARGS_NUM){ #endif return v->ArrowLocation; } +double opt_view_point_size(OPT_ARGS_NUM){ + GET_VIEW(0.) ; + if(action & GMSH_SET){ + v->PointSize = (int)val; + v->Changed = 1; + } + return v->PointSize; +} +double opt_view_line_width(OPT_ARGS_NUM){ + GET_VIEW(0.) ; + if(action & GMSH_SET){ + v->LineWidth = (int)val; + v->Changed = 1; + } + return v->LineWidth; +} double opt_print_format(OPT_ARGS_NUM){ diff --git a/Common/Options.h b/Common/Options.h index f40ab364b3b60cb3da993f682065664fe055146d..c19f6008b934e782c12e3d50b3c9ff60f018078d 100644 --- a/Common/Options.h +++ b/Common/Options.h @@ -198,8 +198,6 @@ double opt_post_smooth(OPT_ARGS_NUM); double opt_post_anim_delay(OPT_ARGS_NUM); double opt_post_nb_views(OPT_ARGS_NUM); double opt_post_color_scheme(OPT_ARGS_NUM); -double opt_post_point_size(OPT_ARGS_NUM); -double opt_post_line_width(OPT_ARGS_NUM); double opt_view_nb_timestep(OPT_ARGS_NUM); double opt_view_timestep(OPT_ARGS_NUM); double opt_view_min(OPT_ARGS_NUM); @@ -237,6 +235,8 @@ double opt_view_scale_type(OPT_ARGS_NUM); double opt_view_range_type(OPT_ARGS_NUM); double opt_view_arrow_type(OPT_ARGS_NUM); double opt_view_arrow_location(OPT_ARGS_NUM); +double opt_view_point_size(OPT_ARGS_NUM); +double opt_view_line_width(OPT_ARGS_NUM); double opt_print_format(OPT_ARGS_NUM); double opt_print_eps_quality(OPT_ARGS_NUM); double opt_print_eps_background(OPT_ARGS_NUM); diff --git a/Common/Views.cpp b/Common/Views.cpp index 417ebf1e2925d3db93ce31f4dcf8eef72f3ea2c4..2d6f1905ccae6f87e0815fca790ac2450ee9d245 100644 --- a/Common/Views.cpp +++ b/Common/Views.cpp @@ -1,4 +1,4 @@ -// $Id: Views.cpp,v 1.53 2001-08-23 18:03:45 geuzaine Exp $ +// $Id: Views.cpp,v 1.54 2001-09-26 08:28:12 geuzaine Exp $ #include <set> #include "Gmsh.h" @@ -420,6 +420,8 @@ void CopyViewOptions(Post_View *src, Post_View *dest){ dest->ArrowType = src->ArrowType; dest->ArrowLocation = src->ArrowLocation; dest->TimeStep = src->TimeStep; + dest->PointSize = src->PointSize; + dest->LineWidth = src->LineWidth; ColorTable_Copy(&src->CT); ColorTable_Paste(&dest->CT); } diff --git a/Common/Views.h b/Common/Views.h index cd514cb40f4d102edc53b45e38e7b7b6d1e1ef97..6c9f43abf7d54d8e00ed2ffb4cdc18f6aa967ecc 100644 --- a/Common/Views.h +++ b/Common/Views.h @@ -38,7 +38,7 @@ class Post_View{ int TimeStep; int DrawPoints, DrawLines, DrawTriangles, DrawTetrahedra; int DrawScalars, DrawVectors, DrawTensors; - int Boundary; + int Boundary, PointSize, LineWidth; ColorTable CT; // dynamic diff --git a/Graphics/Post.cpp b/Graphics/Post.cpp index 8262821fb4898daf5f595ed7262cadddbd6521e9..cd8cebab48b6c7cf777dd5012295bb8d56679be2 100644 --- a/Graphics/Post.cpp +++ b/Graphics/Post.cpp @@ -1,4 +1,4 @@ -// $Id: Post.cpp,v 1.24 2001-09-25 08:20:50 geuzaine Exp $ +// $Id: Post.cpp,v 1.25 2001-09-26 08:28:12 geuzaine Exp $ #include "Gmsh.h" #include "GmshUI.h" @@ -141,12 +141,6 @@ void Draw_Post (void) { if(!Post_ViewList) return; - glPointSize(CTX.post.point_size); - gl2psPointSize(CTX.post.point_size * CTX.print.eps_point_size_factor); - - glLineWidth(CTX.post.line_width); - gl2psLineWidth(CTX.post.line_width * CTX.print.eps_line_width_factor); - if(!CTX.post.draw){ // draw only the bbox of the visible views for(iView=0 ; iView<List_Nbr(Post_ViewList) ; iView++){ v = (Post_View*)List_Pointer(Post_ViewList,iView); @@ -198,6 +192,12 @@ void Draw_Post (void) { glNewList(v->Num, GL_COMPILE_AND_EXECUTE); } + glPointSize(v->PointSize); + gl2psPointSize(v->PointSize * CTX.print.eps_point_size_factor); + + glLineWidth(v->LineWidth); + gl2psLineWidth(v->LineWidth * CTX.print.eps_line_width_factor); + if(v->Light) InitShading(); else diff --git a/Graphics/Scale.cpp b/Graphics/Scale.cpp index e3d5ec76246bb99e3f63f51bad077a070c2f9dd6..cdd30c6f41882a58a4b97bbb4f17cddefba1e4de 100644 --- a/Graphics/Scale.cpp +++ b/Graphics/Scale.cpp @@ -1,4 +1,4 @@ -// $Id: Scale.cpp,v 1.21 2001-08-11 23:28:32 geuzaine Exp $ +// $Id: Scale.cpp,v 1.22 2001-09-26 08:28:12 geuzaine Exp $ #include "Gmsh.h" #include "GmshUI.h" @@ -7,6 +7,7 @@ #include "Draw.h" #include "Context.h" #include "Views.h" +#include "gl2ps.h" extern Context_T CTX; @@ -66,7 +67,12 @@ void draw_scale(Post_View *v, double xmin, double ymin, double *width, double he cv_h = cs_h ; /* valuescale height */ cv_bh = 0.0 ; /* valuescale box height: to be computed */ + glPointSize(v->PointSize); + gl2psPointSize(v->PointSize * CTX.print.eps_point_size_factor); + glLineWidth(v->LineWidth); + gl2psLineWidth(v->LineWidth * CTX.print.eps_line_width_factor); + if(v->IntervalsType == DRAW_POST_CONTINUOUS) glShadeModel(GL_SMOOTH); else diff --git a/demos/.gmsh-options b/demos/.gmsh-options index ccf8652f10ea01afcb3e579703cea7c696934723..2f6f0ecd273d251a91d8507daae77bf59730de9e 100644 --- a/demos/.gmsh-options +++ b/demos/.gmsh-options @@ -165,8 +165,6 @@ PostProcessing.Scales = 1; // Show value scales PostProcessing.Link = 0; // Link post-processing views (0=none, 1,2=changes in visible/all, 3,4=everything in visible/all) PostProcessing.Smoothing = 0; // Apply (non-reversible) smoothing to post-processing view when merged PostProcessing.AnimationDelay = 0.25; // Delay (in seconds) between to animation frames -PostProcessing.PointSize = 2; // Display size of points (in pixels) -PostProcessing.LineWidth = 1; // Display width of lines (in pixels) // // View options // @@ -195,6 +193,8 @@ View.ScaleType = 1; // Value scale type (1=linear, 2=logarithmic, 3=double logar View.RangeType = 1; // Value scale range type (1=default, 2=custom) View.ArrowType = 2; // Vector display type (1=segment, 2=arrow, 3=pyramid, 4=cone, 5=displacement) View.ArrowLocation = 1; // Arrow location (1=cog, 2=vertex) +View.PointSize = 2; // Display size of points (in pixels) +View.LineWidth = 1; // Display width of lines (in pixels) View.ColorTable = { {17, 246, 238, 255}, {17, 246, 238, 255}, {17, 245, 238, 255}, {17, 245, 238, 255}, {17, 244, 238, 255}, {17, 244, 238, 255}, {18, 243, 237, 255}, {18, 243, 237, 255}, @@ -265,7 +265,7 @@ View.ColorTable = { // Print options // Print.EpsFont = "Courier"; // Font used for postscript printing -Print.Format = 10; // Print format +Print.Format = 10; // Print format (10=automatic) Print.EpsQuality = 2; // Postscript quality (1=simple sort, 2=recursive sort) Print.EpsBackground = 0; // Save image background in postscript output Print.EpsFontSize = 12; // Font size used for postscript printing