mirror of
https://github.com/NGSolve/netgen.git
synced 2025-01-27 13:20:34 +05:00
fix crash on solution double click (no colormeshsize)
This commit is contained in:
parent
31587d6097
commit
1b275bf988
@ -1109,35 +1109,35 @@ namespace netgen
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else // not high order
|
else // not high order
|
||||||
{
|
{
|
||||||
glBegin (GL_TRIANGLES);
|
glBegin (GL_TRIANGLES);
|
||||||
|
|
||||||
const Point<3> & lp0 = (*mesh) [el[0]];
|
const Point<3> & lp0 = (*mesh) [el[0]];
|
||||||
const Point<3> & lp1 = (*mesh) [el[1]];
|
const Point<3> & lp1 = (*mesh) [el[1]];
|
||||||
const Point<3> & lp2 = (*mesh) [el[2]];
|
const Point<3> & lp2 = (*mesh) [el[2]];
|
||||||
|
|
||||||
Vec<3> n = Cross (lp1-lp0, lp2-lp0).Normalize();
|
Vec<3> n = Cross (lp1-lp0, lp2-lp0).Normalize();
|
||||||
glNormal3dv (n);
|
glNormal3dv (n);
|
||||||
|
|
||||||
if (vispar.colormeshsize)
|
if (vispar.colormeshsize)
|
||||||
{
|
{
|
||||||
SetOpenGlColor (locms(el[0]-1), minh, maxh, 0);
|
SetOpenGlColor (locms(el[0]-1), minh, maxh, 0);
|
||||||
glVertex3dv (lp0);
|
glVertex3dv (lp0);
|
||||||
SetOpenGlColor (locms(el[1]-1), minh, maxh, 0);
|
SetOpenGlColor (locms(el[1]-1), minh, maxh, 0);
|
||||||
glVertex3dv (lp1);
|
glVertex3dv (lp1);
|
||||||
SetOpenGlColor (locms(el[2]-1), minh, maxh, 0);
|
SetOpenGlColor (locms(el[2]-1), minh, maxh, 0);
|
||||||
glVertex3dv (lp2);
|
glVertex3dv (lp2);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
glVertex3dv (lp0);
|
glVertex3dv (lp0);
|
||||||
glVertex3dv (lp1);
|
glVertex3dv (lp1);
|
||||||
glVertex3dv (lp2);
|
glVertex3dv (lp2);
|
||||||
}
|
}
|
||||||
|
|
||||||
glEnd();
|
glEnd();
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case QUAD:
|
case QUAD:
|
||||||
|
@ -580,7 +580,7 @@ namespace netgen
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
vispar.colormeshsize = 1;
|
// vispar.colormeshsize = 1;
|
||||||
|
|
||||||
// recalc clipping plane
|
// recalc clipping plane
|
||||||
SetClippingPlane ();
|
SetClippingPlane ();
|
||||||
|
@ -4475,7 +4475,6 @@ namespace netgen
|
|||||||
vispar.drawnetgenlogo = atoi (Tcl_GetVar (interp, "::viewoptions.drawnetgenlogo", TCL_GLOBAL_ONLY));
|
vispar.drawnetgenlogo = atoi (Tcl_GetVar (interp, "::viewoptions.drawnetgenlogo", TCL_GLOBAL_ONLY));
|
||||||
vispar.stereo = atoi (Tcl_GetVar (interp, "::viewoptions.stereo", TCL_GLOBAL_ONLY));
|
vispar.stereo = atoi (Tcl_GetVar (interp, "::viewoptions.stereo", TCL_GLOBAL_ONLY));
|
||||||
vispar.colormeshsize = atoi (Tcl_GetVar (interp, "::viewoptions.colormeshsize", TCL_GLOBAL_ONLY));
|
vispar.colormeshsize = atoi (Tcl_GetVar (interp, "::viewoptions.colormeshsize", TCL_GLOBAL_ONLY));
|
||||||
|
|
||||||
VisualScene :: SetBackGroundColor (vispar.whitebackground ? 1 : 0);
|
VisualScene :: SetBackGroundColor (vispar.whitebackground ? 1 : 0);
|
||||||
|
|
||||||
strcpy (vispar.selectvisual, Tcl_GetVar (interp, "::selectvisual", TCL_GLOBAL_ONLY));
|
strcpy (vispar.selectvisual, Tcl_GetVar (interp, "::selectvisual", TCL_GLOBAL_ONLY));
|
||||||
|
@ -70,23 +70,23 @@ int main (int argc, char ** argv)
|
|||||||
cout << "meshing done" << endl;
|
cout << "meshing done" << endl;
|
||||||
|
|
||||||
// volume mesh output
|
// volume mesh output
|
||||||
// np = Ng_GetNP(mesh);
|
np = Ng_GetNP(mesh);
|
||||||
// cout << "Points: " << np << endl;
|
cout << "Points: " << np << endl;
|
||||||
|
|
||||||
// for (i = 1; i <= np; i++)
|
for (i = 1; i <= np; i++)
|
||||||
// {
|
{
|
||||||
// Ng_GetPoint (mesh, i, point);
|
Ng_GetPoint (mesh, i, point);
|
||||||
// cout << i << ": " << point[0] << " " << point[1] << " " << point[2] << endl;
|
cout << i << ": " << point[0] << " " << point[1] << " " << point[2] << endl;
|
||||||
// }
|
}
|
||||||
|
|
||||||
// ne = Ng_GetNE(mesh);
|
ne = Ng_GetNE(mesh);
|
||||||
// cout << "Elements: " << ne << endl;
|
cout << "Elements: " << ne << endl;
|
||||||
// for (i = 1; i <= ne; i++)
|
for (i = 1; i <= ne; i++)
|
||||||
// {
|
{
|
||||||
// Ng_GetVolumeElement (mesh, i, tet);
|
Ng_GetVolumeElement (mesh, i, tet);
|
||||||
// cout << i << ": " << tet[0] << " " << tet[1]
|
cout << i << ": " << tet[0] << " " << tet[1]
|
||||||
// << " " << tet[2] << " " << tet[3] << endl;
|
<< " " << tet[2] << " " << tet[3] << endl;
|
||||||
// }
|
}
|
||||||
|
|
||||||
Ng_SaveMesh(mesh,"test.vol");
|
Ng_SaveMesh(mesh,"test.vol");
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user