gmsh-TingyuanDoc  0.1
An Open-Source Timing-driven Analytical Mixed-size FPGA Placer
closestVertex.h
Go to the documentation of this file.
1 // Gmsh - Copyright (C) 1997-2022 C. Geuzaine, J.-F. Remacle
2 //
3 // See the LICENSE.txt file in the Gmsh root directory for license information.
4 // Please report all issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
5 
6 #ifndef CLOSEST_VERTEX_H
7 #define CLOSEST_VERTEX_H
8 
9 #include "GmshConfig.h"
10 
11 #if defined(HAVE_ANN)
12 #include "ANN/ANN.h"
13 #endif
14 
15 #include "SPoint3.h"
16 
17 #include <vector>
18 #include <cstring>
19 
20 class GEntity;
21 class MVertex;
22 
23 // object for locating closest mesh (principal) vertex on the entity,
24 // in/excluding the closure
25 
27 #if defined(HAVE_ANN)
28  ANNkd_tree *kdtree;
29  ANNpointArray vCoord;
30  ANNidxArray index;
31  ANNdistArray dist;
32  MVertex **vertex;
33 #endif
34 
35  unsigned int nbVtcs;
36 
37 public:
38  closestVertexFinder(GEntity *ge, bool includeClosure);
40 
41  // find closest vertex for given point
42  MVertex *operator()(const SPoint3 &p);
43  // find closest vertex for transformation of given point
44  MVertex *operator()(const SPoint3 &p, const std::vector<double> &tfo);
45 
46  unsigned int getNbVtcs() const { return nbVtcs; }
47 };
48 
49 #endif
closestVertexFinder::nbVtcs
unsigned int nbVtcs
Definition: closestVertex.h:35
MVertex
Definition: MVertex.h:24
SPoint3
Definition: SPoint3.h:14
GEntity
Definition: GEntity.h:31
closestVertexFinder::getNbVtcs
unsigned int getNbVtcs() const
Definition: closestVertex.h:46
closestVertexFinder::closestVertexFinder
closestVertexFinder(GEntity *ge, bool includeClosure)
Definition: closestVertex.cpp:12
closestVertexFinder::~closestVertexFinder
~closestVertexFinder()
Definition: closestVertex.cpp:40
closestVertexFinder::operator()
MVertex * operator()(const SPoint3 &p)
Definition: closestVertex.cpp:53
closestVertexFinder
Definition: closestVertex.h:26
SPoint3.h