Commit 2959efd3 authored by CGoGN GIT Supervisor's avatar CGoGN GIT Supervisor

Merge branch 'master' of /home/kraemer/CGoGN

Conflicts:
	Apps/Examples/miniTest.cpp
parents 69eb1c3b 059b23c9
......@@ -540,7 +540,6 @@ void MyGlutWin::myKeyboard(unsigned char keycode, int x, int y)
break ;
}
case 'v':
{
srand(time(NULL)) ;
......@@ -554,6 +553,8 @@ void MyGlutWin::myKeyboard(unsigned char keycode, int x, int y)
updateVBOdata(Algo::Render::VBO::POSITIONS | Algo::Render::VBO::NORMALS) ;
topo_render->updateData<PFP>(myMap, position, 0.9f, 0.9f) ;
}
glutPostRedisplay() ;
break ;
}
case 'x':
......
......@@ -160,7 +160,7 @@ void coarsenFace(typename PFP::MAP& map, Dart d, typename PFP::TVEC3& position)
do
{
map.setCurrentLevel(cur + 1) ;
map.removeVertex(map.phi1(map.phi1(fit))) ;
map.deleteVertex(map.phi1(map.phi1(fit))) ;
map.setCurrentLevel(cur) ;
fit = map.phi1(fit) ;
} while(fit != d) ;
......
......@@ -100,6 +100,13 @@ public:
*/
virtual void splitVertex(Dart d, Dart e);
//! Delete the vertex of d (works only for internal vertices)
/*! All the faces around the vertex are merged into one face
* @param d a dart of the vertex to delete
* @return true if the deletion has been executed, false otherwise
*/
virtual bool deleteVertex(Dart d) ;
//! Cut the edge of d and its opposite edge if it exists
/*! @param d a dart of the edge to cut
*/
......
......@@ -56,6 +56,23 @@ void GMap2::splitVertex(Dart d, Dart e)
phi2sew(phi1(dd),phi1(ee)); // Sew the two faces along the new edge
}
bool GMap2::deleteVertex(Dart d)
{
if(isBoundaryVertex(d))
return false ;
Dart vit = d ;
do
{
Dart f = phi_1(phi2(vit)) ;
phi1sew(vit, f) ;
vit = alpha1(vit) ;
} while(vit != d) ;
GMap1::deleteFace(d) ;
return true ;
}
void GMap2::cutEdge(Dart d)
{
GMap1::cutEdge(d); // Cut the edge of d
......@@ -396,7 +413,7 @@ bool GMap2::isBoundaryVertex(Dart d)
{
if(beta2(dNext) == dNext)
return true ;
dNext = alpha1(d) ;
dNext = alpha1(dNext) ;
} while (dNext != d) ;
return false ;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment