mirror of
https://github.com/NGSolve/netgen.git
synced 2024-12-26 05:50:32 +05:00
Merge branch 'ncols_colorbar' into 'master'
allow changing number of colors in colorbar See merge request jschoeberl/netgen!431
This commit is contained in:
commit
5e05131d90
@ -494,8 +494,6 @@ namespace netgen
|
||||
void VisualScene :: CreateTexture (int ncols, int linear, double alpha, int typ)
|
||||
{
|
||||
if (linear) ncols = 32;
|
||||
else ncols = 8;
|
||||
|
||||
|
||||
if (ntexcols != ncols)
|
||||
{
|
||||
@ -576,7 +574,7 @@ namespace netgen
|
||||
{
|
||||
if (!vispar.drawcolorbar) return;
|
||||
|
||||
CreateTexture (8, linear, 1, GL_DECAL);
|
||||
CreateTexture (GetVSSolution().numtexturecols, linear, 1, GL_DECAL);
|
||||
|
||||
if (logscale && maxval <= 0) maxval = 1;
|
||||
if (logscale && minval <= 0) minval = 1e-4 * maxval;
|
||||
|
@ -61,6 +61,7 @@ namespace netgen
|
||||
clipplane_isolinelist = 0;
|
||||
surface_vector_list = 0;
|
||||
isosurface_list = 0;
|
||||
numtexturecols = 8;
|
||||
|
||||
fieldlineslist = 0;
|
||||
pointcurvelist = 0;
|
||||
@ -387,7 +388,7 @@ namespace netgen
|
||||
|
||||
BuildScene();
|
||||
|
||||
CreateTexture (numtexturecols, lineartexture, 0.5, GL_MODULATE);
|
||||
CreateTexture (GetVSSolution().numtexturecols, lineartexture, 0.5, GL_MODULATE);
|
||||
|
||||
glClearColor(backcolor, backcolor, backcolor, 1);
|
||||
// glClearColor(backcolor, backcolor, backcolor, 0);
|
||||
|
@ -1283,6 +1283,13 @@ proc visual_dialog { } {
|
||||
-command "Ng_Vis_Set parameters; redraw;" \
|
||||
-invalidcommand "my_invalidspinbox %W;Ng_Vis_Set parameters; redraw" -from -1e10 -to 1e10 -increment 0.001
|
||||
|
||||
|
||||
ttk::label $w.as.lncols -text "N Colors"
|
||||
ttk::spinbox $w.as.snumcols -textvariable visoptions.numtexturecols -width 5 -validate focus \
|
||||
-command "Ng_Vis_Set parameters; redraw;" \
|
||||
-from 2 -to 31 -increment 1
|
||||
|
||||
|
||||
#tixControl $w.as.minval -label "Min-value: " -integer false \
|
||||
-variable visoptions.mminval \
|
||||
-command { Ng_Vis_Set parametersrange; redraw } \
|
||||
@ -1301,7 +1308,7 @@ proc visual_dialog { } {
|
||||
# }
|
||||
|
||||
pack $w.as -fill x -pady 5 -ipady 3
|
||||
grid $w.as.autoscale $w.as.lmin $w.as.smin $w.as.lmax $w.as.smax -sticky nw -padx 4
|
||||
grid $w.as.autoscale $w.as.lmin $w.as.smin $w.as.lmax $w.as.smax $w.as.lncols $w.as.snumcols -sticky nw -padx 4
|
||||
grid columnconfigure $w.as 0 -pad 20
|
||||
grid columnconfigure $w.as 2 -pad 20
|
||||
grid anchor $w.as center
|
||||
@ -1593,11 +1600,6 @@ proc visual_dialog { } {
|
||||
-variable visoptions.lineartexture \
|
||||
-command { Ng_Vis_Set parameters; redraw }
|
||||
|
||||
scale $w.numcols -orient horizontal -length 100 -from 0 -to 50 \
|
||||
-resolution 1 \
|
||||
-variable visoptions.numtexturecols \
|
||||
-command { popupcheckredraw visual_dialog_pop1 }
|
||||
|
||||
ttk::checkbutton $w.fcb.cb.showclipsolution -text "Draw Clipping Plane Solution" \
|
||||
-variable visoptions.showclipsolution \
|
||||
-command { Ng_Vis_Set parameters; redraw }
|
||||
|
@ -279,7 +279,7 @@ DLL_HEADER const char * ngscript[] = {""
|
||||
,"set visoptions.invcolor 0\n"
|
||||
,"set visoptions.imaginary 0\n"
|
||||
,"set visoptions.lineartexture 0\n"
|
||||
,"set visoptions.numtexturecols 16\n"
|
||||
,"set visoptions.numtexturecols 8\n"
|
||||
,"set visoptions.showclipsolution 1\n"
|
||||
,"set visoptions.showsurfacesolution 0\n"
|
||||
,"set visoptions.drawfieldlines 0\n"
|
||||
@ -5218,8 +5218,12 @@ DLL_HEADER const char * ngscript[] = {""
|
||||
,"-validatecommand \"Ng_Vis_Set parameters; redraw;my_validatespinbox %W %P 10\" \\\n"
|
||||
,"-command \"Ng_Vis_Set parameters; redraw;\" \\\n"
|
||||
,"-invalidcommand \"my_invalidspinbox %W;Ng_Vis_Set parameters; redraw\" -from -1e10 -to 1e10 -increment 0.001\n"
|
||||
,"ttk::label $w.as.lncols -text \"N Colors\"\n"
|
||||
,"ttk::spinbox $w.as.snumcols -textvariable visoptions.numtexturecols -width 5 -validate focus \\\n"
|
||||
,"-command \"Ng_Vis_Set parameters; redraw;\" \\\n"
|
||||
,"-from 2 -to 31 -increment 1\n"
|
||||
,"pack $w.as -fill x -pady 5 -ipady 3\n"
|
||||
,"grid $w.as.autoscale $w.as.lmin $w.as.smin $w.as.lmax $w.as.smax -sticky nw -padx 4\n"
|
||||
,"grid $w.as.autoscale $w.as.lmin $w.as.smin $w.as.lmax $w.as.smax $w.as.lncols $w.as.snumcols -sticky nw -padx 4\n"
|
||||
,"grid columnconfigure $w.as 0 -pad 20\n"
|
||||
,"grid columnconfigure $w.as 2 -pad 20\n"
|
||||
,"grid anchor $w.as center\n"
|
||||
@ -5410,10 +5414,6 @@ DLL_HEADER const char * ngscript[] = {""
|
||||
,"ttk::checkbutton $w.fcb.cb.lineartexture -text \"Use Linear Texture\" \\\n"
|
||||
,"-variable visoptions.lineartexture \\\n"
|
||||
,"-command { Ng_Vis_Set parameters; redraw }\n"
|
||||
,"scale $w.numcols -orient horizontal -length 100 -from 0 -to 50 \\\n"
|
||||
,"-resolution 1 \\\n"
|
||||
,"-variable visoptions.numtexturecols \\\n"
|
||||
,"-command { popupcheckredraw visual_dialog_pop1 }\n"
|
||||
,"ttk::checkbutton $w.fcb.cb.showclipsolution -text \"Draw Clipping Plane Solution\" \\\n"
|
||||
,"-variable visoptions.showclipsolution \\\n"
|
||||
,"-command { Ng_Vis_Set parameters; redraw }\n"
|
||||
|
@ -273,7 +273,7 @@ set visoptions.usetexture 1
|
||||
set visoptions.invcolor 0
|
||||
set visoptions.imaginary 0
|
||||
set visoptions.lineartexture 0
|
||||
set visoptions.numtexturecols 16
|
||||
set visoptions.numtexturecols 8
|
||||
set visoptions.showclipsolution 1
|
||||
set visoptions.showsurfacesolution 0
|
||||
set visoptions.drawfieldlines 0
|
||||
|
Loading…
Reference in New Issue
Block a user