Skip to content
Snippets Groups Projects
Select Git revision
  • 44f622c69e1a8386f8dd66b63bb5b07c55b00f9f
  • master default protected
  • steplayer
  • bl
  • pluginMeshQuality
  • fixBugsAmaury
  • hierarchical-basis
  • alphashapes
  • relaying
  • new_export_boris
  • oras_vs_osm
  • reassign_partitions
  • distributed_fwi
  • rename-classes
  • fix/fortran-api-example-t4
  • robust_partitions
  • reducing_files
  • fix_overlaps
  • 3115-issue-fix
  • 3023-Fillet2D-Update
  • convert_fdivs
  • gmsh_4_14_0
  • gmsh_4_13_1
  • gmsh_4_13_0
  • gmsh_4_12_2
  • gmsh_4_12_1
  • gmsh_4_12_0
  • gmsh_4_11_1
  • gmsh_4_11_0
  • gmsh_4_10_5
  • gmsh_4_10_4
  • gmsh_4_10_3
  • gmsh_4_10_2
  • gmsh_4_10_1
  • gmsh_4_10_0
  • gmsh_4_9_5
  • gmsh_4_9_4
  • gmsh_4_9_3
  • gmsh_4_9_2
  • gmsh_4_9_1
  • gmsh_4_9_0
41 results

boundaryLayersData.h

Blame
  • Probe.cpp 4.78 KiB
    // Gmsh - Copyright (C) 1997-2016 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 "GmshConfig.h"
    #include "Probe.h"
    #include "Context.h"
    #include "OctreePost.h"
    
    #if defined(HAVE_OPENGL)
    #include "drawContext.h"
    #endif
    
    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, "View", NULL, -1.},
    };
    
    extern "C"
    {
      GMSH_Plugin *GMSH_RegisterProbePlugin()
      {
        return new GMSH_ProbePlugin();
      }
    }
    
    void GMSH_ProbePlugin::draw(void *context)
    {
    #if defined(HAVE_OPENGL)
      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;
        drawContext *ctx = (drawContext*)context;
        glColor4ubv((GLubyte *) & CTX::instance()->color.fg);
        glLineWidth((float)CTX::instance()->lineWidth);
        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();
        }
        ctx->drawSphere(CTX::instance()->pointSize, x, y, z, 1);
      }
    #endif
    }
    
    double GMSH_ProbePlugin::callback(int num, int action, double value, double *opt)
    {