Select Git revision
GModelIO_Mesh.cpp
Forked from
gmsh / gmsh
Source project has a limited visibility.
-
Christophe Geuzaine authored
refactor occMeshConstraints + add missing writeOCC functions
Christophe Geuzaine authoredrefactor occMeshConstraints + add missing writeOCC functions
Mesh.cpp 24.98 KiB
// $Id: Mesh.cpp,v 1.46 2002-02-01 14:34:05 remacle Exp $
#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;
/* ------------------------------------------------------------------------ */
/* D r a w _ M e s h */
/* ------------------------------------------------------------------------ */
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;
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)
InitShading();
else
InitNoShading();
InitPosition();
if(CTX.moving_light) InitRenderModel();
for(i = 0 ; i < 6 ; i++)
if(CTX.clip[i])
glClipPlane((GLenum)(GL_CLIP_PLANE0 + i), CTX.clip_plane[i]);
glPointSize(CTX.mesh.point_size);