Skip to content
Snippets Groups Projects
Commit d6538c00 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

fix compile without ANN

parent facca73b
No related branches found
No related tags found
No related merge requests found
......@@ -16,7 +16,6 @@
#include "MElement.h"
#include "Numeric.h"
#include "cartesian.h"
#include <ANN/ANN.h>
void insertActiveCells(double x, double y, double z, double rmax,
cartesianBox<double> &box)
......@@ -888,6 +887,7 @@ void gLevelsetMathEvalAll::hessian (double x, double y, double z,
}
}
#if defined(HAVE_ANN)
gLevelsetDistMesh::gLevelsetDistMesh(GModel *gm, std::string physical, int nbClose)
: _gm(gm), _nbClose(nbClose)
{
......@@ -929,11 +929,8 @@ gLevelsetDistMesh::gLevelsetDistMesh(GModel *gm, std::string physical, int nbClo
_kdtree = new ANNkd_tree(_nodes, _all.size(), 3);
_index = new ANNidx[_nbClose];
_dist = new ANNdist[_nbClose];
}
#if defined(HAVE_ANN)
gLevelsetDistMesh::~gLevelsetDistMesh()
{
delete [] _index;
......@@ -982,11 +979,6 @@ double gLevelsetDistMesh::operator () (const double x, const double y, const dou
}
return -1.0*minDistance;
}
#else
double gLevelsetDistMesh::operator () (double x, double y, double z)
{
Msg::Fatal ("impossible to compute distance to a mesh without ANN");
}
#endif
......
......@@ -332,11 +332,11 @@ public:
int type() const { return UNKNOWN; }
};
#if defined(HAVE_ANN)
class gLevelsetDistMesh: public gLevelsetPrimitive
{
GModel * _gm;
const int _nbClose;
#if defined(HAVE_ANN)
std::vector<GEntity*> _entities;
std::vector<MVertex*> _vertices;
std::multimap<MVertex*,MElement*> _v2e;
......@@ -344,16 +344,13 @@ class gLevelsetDistMesh: public gLevelsetPrimitive
ANNpointArray _nodes;
ANNidxArray _index;
ANNdistArray _dist;
#endif
public :
gLevelsetDistMesh(GModel *gm, std::string physical, int nbClose = 5);
double operator () (const double x, const double y, const double z) const;
#if defined(HAVE_ANN)
~gLevelsetDistMesh();
#endif
int type() const { return UNKNOWN; }
};
#endif
#if defined(HAVE_POST)
class gLevelsetPostView : public gLevelsetPrimitive
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment