Skip to content
Snippets Groups Projects
Commit ade94911 authored by Matti Pellika's avatar Matti Pellika
Browse files

Added a function to find all mesh elements by coordinates.

parent 92bb2f31
No related branches found
No related tags found
No related merge requests found
...@@ -697,6 +697,14 @@ MElement *GModel::getMeshElementByCoord(SPoint3 &p, int dim) ...@@ -697,6 +697,14 @@ MElement *GModel::getMeshElementByCoord(SPoint3 &p, int dim)
} }
return _octree->find(p.x(), p.y(), p.z(), dim); return _octree->find(p.x(), p.y(), p.z(), dim);
} }
std::vector<MElement*> GModel::getMeshElementsByCoord(SPoint3 &p, int dim)
{
if(!_octree){
Msg::Debug("Rebuilding mesh element octree");
_octree = new MElementOctree(this);
}
return _octree->findAll(p.x(), p.y(), p.z(), dim);
}
MVertex *GModel::getMeshVertexByTag(int n) MVertex *GModel::getMeshVertexByTag(int n)
{ {
......
...@@ -297,6 +297,7 @@ class GModel ...@@ -297,6 +297,7 @@ class GModel
// access a mesh element by coordinates (using an octree search) // access a mesh element by coordinates (using an octree search)
MElement *getMeshElementByCoord(SPoint3 &p, int dim = -1); MElement *getMeshElementByCoord(SPoint3 &p, int dim = -1);
std::vector<MElement*> getMeshElementsByCoord(SPoint3 &p, int dim = -1);
// access a mesh element by tag, using the element cache // access a mesh element by tag, using the element cache
MElement *getMeshElementByTag(int n); MElement *getMeshElementByTag(int n);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment