fix crash on solution double click (no colormeshsize)

This commit is contained in:
Joachim Schoeberl 2010-03-04 13:15:52 +00:00
parent 31587d6097
commit 1b275bf988
4 changed files with 45 additions and 46 deletions

View File

@ -1109,35 +1109,35 @@ namespace netgen
}
}
else // not high order
{
glBegin (GL_TRIANGLES);
const Point<3> & lp0 = (*mesh) [el[0]];
const Point<3> & lp1 = (*mesh) [el[1]];
const Point<3> & lp2 = (*mesh) [el[2]];
Vec<3> n = Cross (lp1-lp0, lp2-lp0).Normalize();
glNormal3dv (n);
if (vispar.colormeshsize)
{
SetOpenGlColor (locms(el[0]-1), minh, maxh, 0);
glVertex3dv (lp0);
SetOpenGlColor (locms(el[1]-1), minh, maxh, 0);
glVertex3dv (lp1);
SetOpenGlColor (locms(el[2]-1), minh, maxh, 0);
glVertex3dv (lp2);
}
else
{
glVertex3dv (lp0);
glVertex3dv (lp1);
glVertex3dv (lp2);
}
glEnd();
}
{
glBegin (GL_TRIANGLES);
const Point<3> & lp0 = (*mesh) [el[0]];
const Point<3> & lp1 = (*mesh) [el[1]];
const Point<3> & lp2 = (*mesh) [el[2]];
Vec<3> n = Cross (lp1-lp0, lp2-lp0).Normalize();
glNormal3dv (n);
if (vispar.colormeshsize)
{
SetOpenGlColor (locms(el[0]-1), minh, maxh, 0);
glVertex3dv (lp0);
SetOpenGlColor (locms(el[1]-1), minh, maxh, 0);
glVertex3dv (lp1);
SetOpenGlColor (locms(el[2]-1), minh, maxh, 0);
glVertex3dv (lp2);
}
else
{
glVertex3dv (lp0);
glVertex3dv (lp1);
glVertex3dv (lp2);
}
glEnd();
}
break;
}
case QUAD:

View File

@ -580,7 +580,7 @@ namespace netgen
}
*/
vispar.colormeshsize = 1;
// vispar.colormeshsize = 1;
// recalc clipping plane
SetClippingPlane ();

View File

@ -4475,7 +4475,6 @@ namespace netgen
vispar.drawnetgenlogo = atoi (Tcl_GetVar (interp, "::viewoptions.drawnetgenlogo", 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));
VisualScene :: SetBackGroundColor (vispar.whitebackground ? 1 : 0);
strcpy (vispar.selectvisual, Tcl_GetVar (interp, "::selectvisual", TCL_GLOBAL_ONLY));

View File

@ -70,23 +70,23 @@ int main (int argc, char ** argv)
cout << "meshing done" << endl;
// volume mesh output
// np = Ng_GetNP(mesh);
// cout << "Points: " << np << endl;
np = Ng_GetNP(mesh);
cout << "Points: " << np << endl;
// for (i = 1; i <= np; i++)
// {
// Ng_GetPoint (mesh, i, point);
// cout << i << ": " << point[0] << " " << point[1] << " " << point[2] << endl;
// }
for (i = 1; i <= np; i++)
{
Ng_GetPoint (mesh, i, point);
cout << i << ": " << point[0] << " " << point[1] << " " << point[2] << endl;
}
// ne = Ng_GetNE(mesh);
// cout << "Elements: " << ne << endl;
// for (i = 1; i <= ne; i++)
// {
// Ng_GetVolumeElement (mesh, i, tet);
// cout << i << ": " << tet[0] << " " << tet[1]
// << " " << tet[2] << " " << tet[3] << endl;
// }
ne = Ng_GetNE(mesh);
cout << "Elements: " << ne << endl;
for (i = 1; i <= ne; i++)
{
Ng_GetVolumeElement (mesh, i, tet);
cout << i << ": " << tet[0] << " " << tet[1]
<< " " << tet[2] << " " << tet[3] << endl;
}
Ng_SaveMesh(mesh,"test.vol");