Skip to content
Snippets Groups Projects
Select Git revision
  • c4f25e5d9afa4709eeb17964850b2914de67f0f4
  • master default
  • cgnsUnstructured
  • partitioning
  • poppler
  • HighOrderBLCurving
  • gmsh_3_0_4
  • gmsh_3_0_3
  • gmsh_3_0_2
  • gmsh_3_0_1
  • gmsh_3_0_0
  • gmsh_2_16_0
  • gmsh_2_15_0
  • gmsh_2_14_1
  • gmsh_2_14_0
  • gmsh_2_13_2
  • gmsh_2_13_1
  • gmsh_2_12_0
  • gmsh_2_11_0
  • gmsh_2_10_1
  • gmsh_2_10_0
  • gmsh_2_9_3
  • gmsh_2_9_2
  • gmsh_2_9_1
  • gmsh_2_9_0
  • gmsh_2_8_6
26 results

GModelIO_Mesh.cpp

Blame
  • Forked from gmsh / gmsh
    Source project has a limited visibility.
    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);