mirror of
https://github.com/NGSolve/netgen.git
synced 2025-01-12 22:20:35 +05:00
* Bugfix: Surface Mesh colouring based on mesh size was not working due to a local redefinition of the variables "minh" and "maxh".... corrected
* Bugfix: Displaying tets in the domain switched surface mesh colouring mode from GL_SMOOTH to GL_FLAT even when not showing the tets anymore.... corrected * Changed from logarithmic scaling to linear scaling for mesh size based colouring
This commit is contained in:
parent
17a0d73514
commit
19db925ed2
@ -55,6 +55,9 @@ namespace netgen
|
||||
selpoint = -1;
|
||||
selpoint2 = -1;
|
||||
seledge = -1;
|
||||
|
||||
minh = 0.0;
|
||||
maxh = 0.0;
|
||||
}
|
||||
|
||||
VisualSceneMesh :: ~VisualSceneMesh ()
|
||||
@ -964,9 +967,10 @@ namespace netgen
|
||||
if (vispar.colormeshsize)
|
||||
{
|
||||
glEnable (GL_COLOR_MATERIAL);
|
||||
glShadeModel (GL_SMOOTH);
|
||||
locms.SetSize (mesh->GetNP());
|
||||
double maxh = -1;
|
||||
double minh = 1e99;
|
||||
maxh = -1;
|
||||
minh = 1e99;
|
||||
for (int i = 1; i <= locms.Size(); i++)
|
||||
{
|
||||
Point3d p = mesh->Point(i);
|
||||
@ -975,7 +979,10 @@ namespace netgen
|
||||
if (locms(i-1) < minh) minh = locms(i-1);
|
||||
}
|
||||
if (!locms.Size())
|
||||
{ minh = 1; maxh = 10; }
|
||||
{
|
||||
minh = 1;
|
||||
maxh = 10;
|
||||
}
|
||||
}
|
||||
else
|
||||
glDisable (GL_COLOR_MATERIAL);
|
||||
@ -1114,11 +1121,11 @@ namespace netgen
|
||||
|
||||
if (vispar.colormeshsize)
|
||||
{
|
||||
SetOpenGlColor (locms(el[0]-1), minh, maxh, 1);
|
||||
SetOpenGlColor (locms(el[0]-1), minh, maxh, 0);
|
||||
glVertex3dv (lp0);
|
||||
SetOpenGlColor (locms(el[1]-1), minh, maxh, 1);
|
||||
SetOpenGlColor (locms(el[1]-1), minh, maxh, 0);
|
||||
glVertex3dv (lp1);
|
||||
SetOpenGlColor (locms(el[2]-1), minh, maxh, 1);
|
||||
SetOpenGlColor (locms(el[2]-1), minh, maxh, 0);
|
||||
glVertex3dv (lp2);
|
||||
}
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user