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

* don't try to reorient discrete surfaces

* don't allocate 0-sized kdtree 
parent 2c2ad501
No related branches found
No related tags found
No related merge requests found
......@@ -28,9 +28,10 @@ class MVertexPositionSet{
std::vector<MVertex*> &_vertices;
public:
MVertexPositionSet(std::vector<MVertex*> &vertices, int maxDuplicates=10)
: _vertices(vertices), _maxDuplicates(maxDuplicates)
: _kdtree(0), _maxDuplicates(maxDuplicates), _vertices(vertices)
{
int totpoints = vertices.size();
if(!totpoints) return;
_zeronodes = annAllocPts(totpoints, 3);
for(int i = 0; i < totpoints; i++){
vertices[i]->setIndex(0);
......@@ -44,6 +45,7 @@ class MVertexPositionSet{
}
~MVertexPositionSet()
{
if(!_kdtree) return;
delete _kdtree;
annDeallocPts(_zeronodes);
delete [] _index;
......@@ -51,6 +53,7 @@ class MVertexPositionSet{
}
MVertex *find(double x, double y, double z, double tolerance)
{
if(!_kdtree) return 0;
double xyz[3] = {x, y, z};
_kdtree->annkSearch(xyz, _maxDuplicates, _index, _dist);
for(int i = 0; i < _maxDuplicates; i++){
......
......@@ -1795,6 +1795,7 @@ void orientMeshGFace::operator()(GFace *gf)
{
gf->model()->setCurrentMeshEntity(gf);
if(gf->geomType() == GEntity::DiscreteSurface) return;
if(gf->geomType() == GEntity::ProjectionFace) return;
if(gf->geomType() == GEntity::CompoundSurface) return;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment