Commit 48c2a09d authored by Pierre Kraemer's avatar Pierre Kraemer

pliant remeshing v1 ok

parent 33275120
......@@ -668,6 +668,31 @@ void MyGlutWin::myKeyboard(unsigned char keycode, int x, int y)
break ;
}
case '0':
{
GLint t1 = glutGet(GLUT_ELAPSED_TIME) ;
Algo::Modelisation::reverseOrientation<PFP>(myMap) ;
GLint t2 = glutGet(GLUT_ELAPSED_TIME) ;
GLfloat seconds = (t2 - t1) / 1000.0f ;
std::cout << "pliant remeshing: "<< seconds << "sec" << std::endl ;
t1 = glutGet(GLUT_ELAPSED_TIME) ;
updateVBOprimitives(Algo::Render::VBO::TRIANGLES | Algo::Render::VBO::LINES | Algo::Render::VBO::POINTS) ;
updateVBOdata(Algo::Render::VBO::POSITIONS | Algo::Render::VBO::NORMALS) ;
topo_render->updateData<PFP>(myMap, position, 0.9f, 0.9f) ;
t2 = glutGet(GLUT_ELAPSED_TIME) ;
seconds = (t2 - t1) / 1000.0f ;
std::cout << "display update: "<< seconds << "sec" << std::endl ;
glutPostRedisplay() ;
break ;
}
case '9':
{
CellMarker markVisit(myMap, VERTEX_CELL) ;
......
......@@ -64,8 +64,8 @@ typename PFP::VEC3 faceNormal(typename PFP::MAP& map, Dart d, const typename PFP
do
{
VEC3 n = triangleNormal<PFP>(map, it, position) ;
//if(!std::isnan(n[0]))
if (n[0] == n[0])
//if(!std::isnan(n[0]) && !std::isnan(n[1]) && !std::isnan(n[2]))
if (n[0] == n[0] && n[1] == n[1] && n[2] == n[2])
N += n ;
it = map.phi1(it) ;
} while (it != d) ;
......
......@@ -280,7 +280,7 @@ template <unsigned int DIM, typename T>
inline bool Vector<DIM,T>::hasNan() const
{
for(unsigned int i = 0 ; i < DIM ; ++i)
if(isnan(m_data[i]))
if(m_data[i] != m_data[i])
return true ;
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