Skip to content
Snippets Groups Projects
Commit 735743df authored by Jonathan Lambrechts's avatar Jonathan Lambrechts
Browse files

MElementOctree : add an option to disable "tolerant" ;-) search for Tristan

parent 988a03b2
No related branches found
No related tags found
No related merge requests found
...@@ -111,7 +111,7 @@ MElementOctree::~MElementOctree() ...@@ -111,7 +111,7 @@ MElementOctree::~MElementOctree()
Octree_Delete(_octree); Octree_Delete(_octree);
} }
MElement *MElementOctree::find(double x, double y, double z, int dim) MElement *MElementOctree::find(double x, double y, double z, int dim, bool strict)
{ {
double P[3] = {x, y, z}; double P[3] = {x, y, z};
MElement *e = (MElement*)Octree_Search(P, _octree); MElement *e = (MElement*)Octree_Search(P, _octree);
...@@ -127,7 +127,7 @@ MElement *MElementOctree::find(double x, double y, double z, int dim) ...@@ -127,7 +127,7 @@ MElement *MElementOctree::find(double x, double y, double z, int dim)
} }
} }
} }
if (!e || (dim != -1 && e->getDim() != dim)){ if (!strict) {
double initialTol = MElement::getTolerance(); double initialTol = MElement::getTolerance();
double tol = initialTol; double tol = initialTol;
while (tol < 1){ while (tol < 1){
...@@ -149,6 +149,5 @@ MElement *MElementOctree::find(double x, double y, double z, int dim) ...@@ -149,6 +149,5 @@ MElement *MElementOctree::find(double x, double y, double z, int dim)
} }
MElement::setTolerance(initialTol); MElement::setTolerance(initialTol);
Msg::Warning("Point %g %g %g not found",x,y,z); Msg::Warning("Point %g %g %g not found",x,y,z);
} } return NULL;
return NULL;
} }
...@@ -20,7 +20,7 @@ class MElementOctree{ ...@@ -20,7 +20,7 @@ class MElementOctree{
MElementOctree(GModel *); MElementOctree(GModel *);
MElementOctree(std::vector<MElement*> &); MElementOctree(std::vector<MElement*> &);
~MElementOctree(); ~MElementOctree();
MElement *find(double x, double y, double z, int dim = -1); MElement *find(double x, double y, double z, int dim = -1, bool strict = false);
Octree *getInternalOctree(){ return _octree; } Octree *getInternalOctree(){ return _octree; }
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment