Select Git revision
Callbacks.cpp
Forked from
gmsh / gmsh
Source project has a limited visibility.
-
Christophe Geuzaine authoredChristophe Geuzaine authored
PostElement.cpp 33.73 KiB
// $Id: PostElement.cpp,v 1.30 2004-05-29 00:47:06 geuzaine Exp $
//
// Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems to <gmsh@geuz.org>.
//
// Contributor(s):
// Laurent Stainier
// Jean-Luc Flejou
#include "Gmsh.h"
#include "GmshUI.h"
#include "Geo.h"
#include "Mesh.h"
#include "Draw.h"
#include "Iso.h"
#include "Context.h"
#include "Numeric.h"
#define POINT 0
#define LINE 1
#define TRIANGLE 2
#define QUADRANGLE 3
#define TETRAHEDRON 4
#define HEXAHEDRON 5
#define PRISM 6
#define PYRAMID 7
extern Context_T CTX;
void Draw_ElementBoundary(int type, Post_View * View, double *X, double *Y,
double *Z, double Raise[3][8])
{
double xx[8], yy[8], zz[8];
glColor4ubv((GLubyte *) & CTX.color.fg);
switch (type) {
case POINT:
Draw_Point(View->PointType, View->PointSize, X, Y, Z, Raise, View->Light);
break;
case LINE:
Draw_Line(0, View->LineWidth, X, Y, Z, Raise, View->Light);
break;
case TRIANGLE:
glBegin(GL_LINE_LOOP);
for(int k = 0; k < 3; k++)
glVertex3d(X[k] + Raise[0][k], Y[k] + Raise[1][k], Z[k] + Raise[2][k]);
glEnd();
break;
case TETRAHEDRON:
for(int k = 0; k < 4; k++) {
xx[k] = X[k] + Raise[0][k];
yy[k] = Y[k] + Raise[1][k];
zz[k] = Z[k] + Raise[2][k];
}