Skip to content
Snippets Groups Projects
Commit 1c29ae39 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

draw string with min/max of the bounding box (very useful when we have no
geometry points to check the coorrdinates from!)
parent 2e0bb5b0
No related branches found
No related tags found
No related merge requests found
// $Id: Mesh.cpp,v 1.79 2004-04-24 06:13:45 geuzaine Exp $
// $Id: Mesh.cpp,v 1.80 2004-04-24 15:05:40 geuzaine Exp $
//
// Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle
//
......@@ -119,6 +119,18 @@ void Draw_Mesh(Mesh * M)
glVertex3d(CTX.min[0], CTX.max[1], CTX.min[2]);
glVertex3d(CTX.min[0], CTX.max[1], CTX.max[2]);
glEnd();
char label[256];
double offset = 0.5 * CTX.gl_fontsize * CTX.pixel_equiv_x;
glRasterPos3d(CTX.min[0] + offset / CTX.s[0],
CTX.min[1] + offset / CTX.s[0],
CTX.min[2] + offset / CTX.s[0]);
sprintf(label, "(%.1g,%.1g,%.1g)", CTX.min[0], CTX.min[1], CTX.min[2]);
Draw_String(label);
glRasterPos3d(CTX.max[0] + offset / CTX.s[0],
CTX.max[1] + offset / CTX.s[0],
CTX.max[2] + offset / CTX.s[0]);
sprintf(label, "(%.1g,%.1g,%.1g)", CTX.max[0], CTX.max[1], CTX.max[2]);
Draw_String(label);
}
// draw the mesh
......
// $Id: Post.cpp,v 1.55 2004-04-20 19:15:14 geuzaine Exp $
// $Id: Post.cpp,v 1.56 2004-04-24 15:05:40 geuzaine Exp $
//
// Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle
//
......@@ -359,6 +359,18 @@ void Draw_Post(void)
glVertex3d(v->BBox[0], v->BBox[3], v->BBox[4]);
glVertex3d(v->BBox[0], v->BBox[3], v->BBox[5]);
glEnd();
char label[256];
double offset = 0.5 * CTX.gl_fontsize * CTX.pixel_equiv_x;
glRasterPos3d(v->BBox[0] + offset / CTX.s[0],
v->BBox[2] + offset / CTX.s[0],
v->BBox[4] + offset / CTX.s[0]);
sprintf(label, "(%.1g,%.1g,%.1g)", v->BBox[0], v->BBox[2], v->BBox[4]);
Draw_String(label);
glRasterPos3d(v->BBox[1] + offset / CTX.s[0],
v->BBox[3] + offset / CTX.s[0],
v->BBox[5] + offset / CTX.s[0]);
sprintf(label, "(%.1g,%.1g,%.1g)", v->BBox[1], v->BBox[3], v->BBox[5]);
Draw_String(label);
}
}
return;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment