Skip to content
Snippets Groups Projects
Select Git revision
  • 3f147e49852e19b79b873f3f88edaff2314ae196
  • master default protected
  • alphashapes
  • patch_releases_4_14
  • fix_alphaShapes
  • hierarchical-basis-refactor
  • hierarchical-basis
  • revert-ef4a3a4f
  • overlaps_tags_and_distributed_export
  • overlaps_tags_and_distributed_export_rebased
  • relaying
  • steplayer
  • bl
  • pluginMeshQuality
  • fixBugsAmaury
  • new_export_boris
  • oras_vs_osm
  • reassign_partitions
  • distributed_fwi
  • rename-classes
  • fix/fortran-api-example-t4
  • gmsh_4_14_1
  • 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
41 results

closestVertex.h

Blame
  • closestVertex.h 1.05 KiB
    // Gmsh - Copyright (C) 1997-2019 C. Geuzaine, J.-F. Remacle
    //
    // See the LICENSE.txt file for license information. Please report all
    // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
    
    #ifndef CLOSEST_VERTEX_H
    #define CLOSEST_VERTEX_H
    
    #include "GmshConfig.h"
    
    #if defined(HAVE_ANN)
    #include "ANN/ANN.h"
    #endif
    
    #include "SPoint3.h"
    
    #include <vector>
    #include <cstring>
    
    class GEntity;
    class MVertex;
    
    // object for locating closest mesh (principal) vertex on the entity,
    // in/excluding the closure
    
    class closestVertexFinder {
    #if defined(HAVE_ANN)
      ANNkd_tree *kdtree;
      ANNpointArray vCoord;
      ANNidxArray index;
      ANNdistArray dist;
      MVertex **vertex;
    #endif
    
      unsigned int nbVtcs;
    
    public:
      closestVertexFinder(GEntity *ge, bool includeClosure);
      ~closestVertexFinder();
    
      // find closest vertex for given point
      MVertex *operator()(const SPoint3 &p);
      // find closest vertex for transformation of given point
      MVertex *operator()(const SPoint3 &p, const std::vector<double> &tfo);
    
      unsigned int getNbVtcs() const { return nbVtcs; }
    };
    
    #endif