From fa966461621755a97d8bdcab62d58eda06fa6358 Mon Sep 17 00:00:00 2001 From: Christophe Geuzaine <cgeuzaine@ulg.ac.be> Date: Tue, 31 Jul 2001 10:41:38 +0000 Subject: [PATCH] Draw bbox of mesh if no geometry --- Graphics/Mesh.cpp | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/Graphics/Mesh.cpp b/Graphics/Mesh.cpp index db2545bc9a..343de43776 100644 --- a/Graphics/Mesh.cpp +++ b/Graphics/Mesh.cpp @@ -1,4 +1,4 @@ -// $Id: Mesh.cpp,v 1.33 2001-06-28 17:42:08 geuzaine Exp $ +// $Id: Mesh.cpp,v 1.34 2001-07-31 10:41:38 geuzaine Exp $ #include "Gmsh.h" #include "GmshUI.h" @@ -74,6 +74,33 @@ void Draw_Mesh (Mesh *M) { if(CTX.mesh.hidden) glEnable(GL_POLYGON_OFFSET_FILL); + // draw the bbox of the mesh in fast redraw mode if there is no geometry + if(!CTX.mesh.draw && !Tree_Nbr(M->Points)){ + glColor4ubv((GLubyte*)&CTX.color.fg); + glBegin(GL_LINE_LOOP); + glVertex3d(CTX.min[0], CTX.min[1], CTX.min[2]); + glVertex3d(CTX.max[0], CTX.min[1], CTX.min[2]); + glVertex3d(CTX.max[0], CTX.max[1], CTX.min[2]); + glVertex3d(CTX.min[0], CTX.max[1], CTX.min[2]); + glEnd(); + glBegin(GL_LINE_LOOP); + glVertex3d(CTX.min[0], CTX.min[1], CTX.max[2]); + glVertex3d(CTX.max[0], CTX.min[1], CTX.max[2]); + glVertex3d(CTX.max[0], CTX.max[1], CTX.max[2]); + glVertex3d(CTX.min[0], CTX.max[1], CTX.max[2]); + glEnd(); + glBegin(GL_LINES); + glVertex3d(CTX.min[0], CTX.min[1], CTX.min[2]); + glVertex3d(CTX.min[0], CTX.min[1], CTX.max[2]); + glVertex3d(CTX.max[0], CTX.min[1], CTX.min[2]); + glVertex3d(CTX.max[0], CTX.min[1], CTX.max[2]); + glVertex3d(CTX.max[0], CTX.max[1], CTX.min[2]); + glVertex3d(CTX.max[0], CTX.max[1], CTX.max[2]); + glVertex3d(CTX.min[0], CTX.max[1], CTX.min[2]); + glVertex3d(CTX.min[0], CTX.max[1], CTX.max[2]); + glEnd(); + } + switch(M->status) { case 3 : if(CTX.mesh.draw && -- GitLab