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

.classpath

Blame
  • Forked from gmsh / gmsh
    Source project has a limited visibility.
    Probe.cpp 5.05 KiB
    // Gmsh - Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle
    //
    // See the LICENSE.txt file for license information. Please report all
    // bugs and problems to <gmsh@geuz.org>.
    
    #include "Probe.h"
    #include "Context.h"
    #include "OctreePost.h"
    
    #if defined(HAVE_FLTK)
    #include "GmshUI.h"
    #include "Draw.h"
    #endif
    
    extern Context_T CTX;
    
    int GMSH_ProbePlugin::iview = 0;
    
    StringXNumber ProbeOptions_Number[] = {
      {GMSH_FULLRC, "X", GMSH_ProbePlugin::callbackX, 0.},
      {GMSH_FULLRC, "Y", GMSH_ProbePlugin::callbackY, 0.},
      {GMSH_FULLRC, "Z", GMSH_ProbePlugin::callbackZ, 0.},
      {GMSH_FULLRC, "iView", NULL, -1.},
    };
    
    extern "C"
    {
      GMSH_Plugin *GMSH_RegisterProbePlugin()
      {
        return new GMSH_ProbePlugin();
      }
    }
    
    void GMSH_ProbePlugin::draw()
    {
    #if defined(HAVE_FLTK)
      int num = (int)ProbeOptions_Number[3].def;
      if(num < 0) num = iview;
      if(num >= 0 && num < (int)PView::list.size()){
        double x = ProbeOptions_Number[0].def;
        double y = ProbeOptions_Number[1].def;
        double z = ProbeOptions_Number[2].def;
        glColor4ubv((GLubyte *) & CTX.color.fg);
        glLineWidth(CTX.line_width);
        SBoundingBox3d bb = PView::list[num]->getData()->getBoundingBox();
        if(x >= bb.min().x() && x <= bb.max().x() &&
           y >= bb.min().y() && y <= bb.max().y() &&
           z >= bb.min().z() && z <= bb.max().z()){
          // we're inside the bounding box: draw a large cross
          glBegin(GL_LINES);
          glVertex3d(bb.min().x(), y, z); glVertex3d(bb.max().x(), y, z);
          glVertex3d(x, bb.min().y(), z); glVertex3d(x, bb.max().y(), z);
          glVertex3d(x, y, bb.min().z()); glVertex3d(x, y, bb.max().z());
          glEnd();
        }
        else{
          // draw 10-pixel marker
          double d = 10 * CTX.pixel_equiv_x / CTX.s[0];
          glBegin(GL_LINES);
          glVertex3d(x - d, y, z); glVertex3d(x + d, y, z);
          glVertex3d(x, y - d, z); glVertex3d(x, y + d, z);
          glVertex3d(x, y, z - d); glVertex3d(x, y, z + d);
          glEnd();
        }
        Draw_Sphere(CTX.point_size, x, y, z, 1);
      }
    #endif
    }
    
    double GMSH_ProbePlugin::callback(int num, int action, double value, double *opt)