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

No commit message

No commit message
parent 020adf5b
No related branches found
No related tags found
No related merge requests found
......@@ -42,7 +42,8 @@ static int MElementInEle(void *a, double *x)
return e->isInside(uvw[0], uvw[1], uvw[2]) ? 1 : 0;
}
Octree * buildMElementOctree (GModel *m){
Octree *buildMElementOctree (GModel *m)
{
SBoundingBox3d bb = m->bounds();
double min[3] = {bb.min().x(), bb.min().y(), bb.min().z()};
double size[3] = {bb.max().x() - bb.min().x(),
......@@ -60,7 +61,8 @@ Octree * buildMElementOctree (GModel *m){
return _octree;
}
Octree * buildMElementOctree (std::vector<MElement*> &v){
Octree *buildMElementOctree(std::vector<MElement*> &v)
{
SBoundingBox3d bb;
for (unsigned int i=0;i<v.size();i++){
for(unsigned int j=0;j<v[i]->getNumVertices();j++){
......@@ -73,7 +75,6 @@ Octree * buildMElementOctree (std::vector<MElement*> &v){
double size[3] = {bb.max().x() - bb.min().x(),
bb.max().y() - bb.min().y(),
bb.max().z() - bb.min().z()};
// printf("%d --> %g %g %g -- %g %g %g\n",v.size(),min[0],min[1],min[2],size[0],size[1],size[2]);
const int maxElePerBucket = 100; // memory vs. speed trade-off
Octree *_octree = Octree_Create(maxElePerBucket, min, size,
MElementBB, MElementCentroid, MElementInEle);
......
......@@ -284,7 +284,7 @@ backgroundMesh::backgroundMesh(GFace *_gf)
else {
std::map<MVertex*, MVertex*>::iterator itv2 = _2Dto3D.begin();
for ( ; itv2 != _2Dto3D.end(); ++itv2){
_sizes[itv2->first] = LC_MAX;
_sizes[itv2->first] = MAX_LC;
}
}
updateSizes(_gf);
......@@ -487,7 +487,6 @@ double backgroundMesh::operator() (double u, double v, double w) const
std::map<MVertex*,double>::const_iterator itv1 = _sizes.find(e->getVertex(0));
std::map<MVertex*,double>::const_iterator itv2 = _sizes.find(e->getVertex(1));
std::map<MVertex*,double>::const_iterator itv3 = _sizes.find(e->getVertex(2));
// printf("%g %g -> %g\n",u,v, itv1->second * (1-uv2[0]-uv2[2]) + itv2->second * uv2[0] + itv3->second * uv2[1]);
return itv1->second * (1-uv2[0]-uv2[1]) + itv2->second * uv2[0] + itv3->second * uv2[1];
}
......@@ -521,6 +520,6 @@ void backgroundMesh::print (const std::string &filename, GFace *gf) const
}
fprintf(f,"};\n");
fclose(f);
}
backgroundMesh* backgroundMesh::_current = 0;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment