Skip to content
Snippets Groups Projects
Select Git revision
  • 07645e162dc1e738223084d3f5463d4f2fae3226
  • 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

drawContext.cpp

Blame
  • Forked from gmsh / gmsh
    Source project has a limited visibility.
    drawContext.cpp 31.41 KiB
    // Gmsh - Copyright (C) 1997-2013 C. Geuzaine, J.-F. Remacle
    //
    // See the LICENSE.txt file for license information. Please report all
    // bugs and problems to the public mailing list <gmsh@geuz.org>.
    
    #include <string>
    #include <stdio.h>
    #include "Gmsh.h"
    #include "GmshConfig.h"
    #include "GmshMessage.h"
    #include "drawContext.h"
    #include "Trackball.h"
    #include "Context.h"
    #include "Numeric.h"
    #include "GModel.h"
    #include "MElement.h"
    #include "PView.h"
    #include "PViewOptions.h"
    #include "VertexArray.h"
    #include "gl2ps.h"
    
    #if defined(HAVE_FLTK)
    #include <FL/Fl_JPEG_Image.H>
    #include <FL/Fl_PNG_Image.H>
    #include <FL/gl.h>
    #endif
    
    #if defined(HAVE_POPPLER)
    #include "gmshPopplerWrapper.h"
    #endif
    
    
    drawContextGlobal *drawContext::_global = 0;
    
    drawContext::drawContext(drawTransform *transform)
      : _transform(transform)
    {
      // initialize from temp values in global context
      for(int i = 0; i < 3; i++){
        r[i] = CTX::instance()->tmpRotation[i];
        t[i] = CTX::instance()->tmpTranslation[i];
        s[i] = CTX::instance()->tmpScale[i];
      }
      for(int i = 0; i < 4; i++){
        quaternion[i] = CTX::instance()->tmpQuaternion[i];
      }
      viewport[0] = viewport[1] = 0;
      viewport[2] = CTX::instance()->glSize[0];
      viewport[3] = CTX::instance()->glSize[1];
    
      render_mode = GMSH_RENDER;
      vxmin = vymin = vxmax = vymax = 0.;
      pixel_equiv_x = pixel_equiv_y = 0.;
    
      _bgImageSize[0] = _bgImageSize[1] = 0;
    
      _quadric = 0; // cannot create it here: needs valid opengl context
      _displayLists = 0;
    }
    
    drawContext::~drawContext()
    {
      invalidateQuadricsAndDisplayLists();
    }
    
    drawContextGlobal *drawContext::global()
    {
      if(!_global) _global = new drawContextGlobal(); // create dummy default
      return _global;
    }