From 568ce660bb3e84b84f9f4fbb15b37d4108b4bd72 Mon Sep 17 00:00:00 2001 From: Christophe Geuzaine <cgeuzaine@ulg.ac.be> Date: Wed, 9 Mar 2005 08:07:35 +0000 Subject: [PATCH] added arrows to show the orientation of the cut plane --- Graphics/Entity.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Graphics/Entity.cpp b/Graphics/Entity.cpp index ca4ce8725f..9af59771f2 100644 --- a/Graphics/Entity.cpp +++ b/Graphics/Entity.cpp @@ -1,4 +1,4 @@ -// $Id: Entity.cpp,v 1.54 2005-03-09 02:18:40 geuzaine Exp $ +// $Id: Entity.cpp,v 1.55 2005-03-09 08:07:35 geuzaine Exp $ // // Copyright (C) 1997-2005 C. Geuzaine, J.-F. Remacle // @@ -102,6 +102,12 @@ void Draw_PlaneInBoundingBox(double xmin, double ymin, double zmin, {8, 9, 10, 11} }; + double n[3] = {a,b,c}; + norme(n); + n[0] *= 50 * CTX.pixel_equiv_x / CTX.s[0]; + n[1] *= 50 * CTX.pixel_equiv_x / CTX.s[1]; + n[2] *= 50 * CTX.pixel_equiv_x / CTX.s[2]; + for(int i = 0; i < 6; i++){ int nb = 0; point p[4]; @@ -112,8 +118,12 @@ void Draw_PlaneInBoundingBox(double xmin, double ymin, double zmin, if(nb > 1){ glBegin(GL_LINE_STRIP); for(int j = 0; j < nb; j++) - glVertex3d(p[j].x, p[j].y, p[j].z); + glVertex3d(p[j].x, p[j].y, p[j].z); glEnd(); + for(int j = 0; j < nb; j++) + Draw_Vector(CTX.vector_type, 0, CTX.arrow_rel_head_radius, + CTX.arrow_rel_stem_length, CTX.arrow_rel_stem_radius, + p[j].x, p[j].y, p[j].z, n[0], n[1], n[2], 1); } } } -- GitLab