Select Git revision
GModelIO_P3D.cpp
-
Christophe Geuzaine authoredChristophe Geuzaine authored
Mesh.cpp 25.46 KiB
// $Id: Mesh.cpp,v 1.49 2002-05-18 07:18:02 geuzaine Exp $
//
// Copyright (C) 1997 - 2002 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., 675 Mass Ave, Cambridge, MA 02139, USA.
#include "Gmsh.h"
#include "GmshUI.h"
#include "Geo.h"
#include "CAD.h"
#include "Mesh.h"
#include "Draw.h"
#include "Context.h"
#include "MinMax.h"
#include "gl2ps.h"
#include "Verif.h"
#include "Numeric.h"
extern Mesh *THEM;
extern Context_T CTX;
void draw_polygon_2d (double r, double g, double b, int n,
double *x, double *y, double *z){
int i ;
CalculateMinMax(THEM->Points,NULL);
InitOpengl();
InitPosition();
glDisable(GL_DEPTH_TEST);
glDrawBuffer(GL_FRONT);
glColor3f(r,g,b);
glBegin(GL_LINE_STRIP);
for(i=0 ; i<n ; i++)
if(z)glVertex3d(x[i], y[i],z[i]);
else glVertex2d(x[i], y[i]);
glEnd();
glFlush();
glDrawBuffer(GL_BACK);
glEnable(GL_DEPTH_TEST);
}
static int iColor;
static DrawingColor theColor;
void ColorSwitch(int i){
glColor4ubv((GLubyte*)&CTX.color.mesh.carousel[i%10]);
}
static int DrawVertexSupp ;
void Draw_Mesh (Mesh *M) {
int i;
if(!CTX.moving_light) InitRenderModel();
if(CTX.mesh.shade)