diff --git a/Apps/Examples/miniTest.cpp b/Apps/Examples/miniTest.cpp index fabf2abf50becc6bca39ab1b2e2f0ad4a717eb0c..d7d47d98e6a2a522b3ea9861fc32b3c4c134d134 100644 --- a/Apps/Examples/miniTest.cpp +++ b/Apps/Examples/miniTest.cpp @@ -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(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(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) ; diff --git a/include/Algo/Geometry/normal.hpp b/include/Algo/Geometry/normal.hpp index e2f340d26c3730576ef265151c45d63402dfa80e..816172d214d53b24492f5087525fb434cd4ed53f 100644 --- a/include/Algo/Geometry/normal.hpp +++ b/include/Algo/Geometry/normal.hpp @@ -64,8 +64,8 @@ typename PFP::VEC3 faceNormal(typename PFP::MAP& map, Dart d, const typename PFP do { VEC3 n = triangleNormal(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) ; diff --git a/include/Geometry/vector_gen.hpp b/include/Geometry/vector_gen.hpp index db3de8774a6e8de7da21cd5f4bfc066aa8806d74..fa89bb317c750b07a3c2fb4645c6fc46bdaefa8d 100644 --- a/include/Geometry/vector_gen.hpp +++ b/include/Geometry/vector_gen.hpp @@ -280,7 +280,7 @@ template inline bool Vector::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 ; }