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

recurFindCavity -> findCavity (thanks to Sauli Ruuska!)

parent bfa34f3b
No related branches found
No related tags found
No related merge requests found
......@@ -316,49 +316,31 @@ int makeCavityStarShaped (std::list<faceXtet> & shell,
return 1;
}
void recurFindCavity(std::list<faceXtet> & shell,
void findCavity(std::list<faceXtet> & shell,
std::list<MTet4*> & cavity,
MVertex *v,
MTet4 *t)
{
t->setDeleted(true);
cavity.push_back(t);
for (std::list<MTet4*>::iterator it = --cavity.end(); it != cavity.end(); ++it) {
for (int i = 0; i < 4; i++) {
MTet4 *neigh = t->getNeigh(i) ;
faceXtet fxt (t, i);
MTet4 *neigh = (*it)->getNeigh(i);
faceXtet fxt(*it, i);
if (!neigh)
shell.push_back(fxt);
else if (!neigh->isDeleted()) {
int circ = neigh->inCircumSphere(v);
if (circ && (neigh->onWhat() == t->onWhat()))
recurFindCavity(shell, cavity, v, neigh);
if (circ && (neigh->onWhat() == (*it)->onWhat())) {
neigh->setDeleted(true);
cavity.push_back(neigh);
}
else {
shell.push_back(fxt);
}
}
}
}
void recurFindCavity(std::vector<faceXtet> & shell,
std::vector<MTet4*> & cavity,
MVertex *v ,
MTet4 *t)
{
t->setDeleted(true);
cavity.push_back(t);
for (int i = 0; i < 4; i++){
MTet4 *neigh = t->getNeigh(i) ;
faceXtet fxt (t, i);
if (!neigh)
shell.push_back(fxt);
else if (!neigh->isDeleted()){
int circ = neigh->inCircumSphere(v);
if (circ && (neigh->onWhat() == t->onWhat()))
recurFindCavity(shell, cavity, v, neigh);
else
shell.push_back(fxt);
}
}
}
void printTets (const char *fn, std::list<MTet4*> &cavity, bool force = false )
......@@ -506,10 +488,9 @@ bool insertVertex(MVertex *v,
std::list<faceXtet> shell;
std::list<MTet4*> cavity;
recurFindCavity(shell, cavity, v, t);
findCavity(shell, cavity, v, t);
return insertVertexB(shell,cavity,v,t,myFactory,allTets,vSizes,vSizesBGM,activeTets);
}
static void setLcs(MTriangle *t, std::map<MVertex*, double> &vSizes,
......@@ -1306,7 +1287,7 @@ void insertVerticesInRegion (GRegion *gr, int maxVert, bool _classify)
std::list<faceXtet> shell;
std::list<MTet4*> cavity;
MVertex vv (center[0], center[1], center[2], worst->onWhat());
recurFindCavity(shell, cavity, &vv, worst);
findCavity(shell, cavity, &vv, worst);
bool FOUND = false;
for (std::list<MTet4*>::iterator itc = cavity.begin(); itc != cavity.end(); ++itc){
......@@ -1653,4 +1634,3 @@ void delaunayMeshIn3D(std::vector<MVertex*> &v, std::vector<MTetrahedron*> &resu
double t2 = Cpu();
Msg::Info("Tetrahedrization of %d points in %g seconds",v.size(),t2-t1);
}
......@@ -137,4 +137,4 @@ Hackbarth, Peter Wainwright, Jiri Hnidek, Thierry Thomas, Konstantinos Poulios,
Laurent Van Miegroet, Shahrokh Ghavamian, Geordie McBain, Jose Paulo Moitinho de
Almeida, Guillaume Demesy, Wendy Merks-Swolfs, Cosmin Stefan Deaconu, Nigel
Nunn, Serban Georgescu, Julien Troufflard, Michele Mocciola, Matthijs Sypkens
Smit.
Smit, Sauli Ruuska.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment