Création d'un compte pour un collaborateur extérieur au laboratoire depuis l'intranet ICube : https://intranet.icube.unistra.fr/fr/labs/member/profile

Commit 55462258 authored by Pierre Kraemer's avatar Pierre Kraemer
Browse files

traversor with thread

parent 58858e5a
...@@ -24,6 +24,9 @@ ...@@ -24,6 +24,9 @@
#include "Algo/Geometry/basic.h" #include "Algo/Geometry/basic.h"
#include "Algo/Geometry/area.h" #include "Algo/Geometry/area.h"
#include "Topology/generic/traversor2.h"
#include <cmath> #include <cmath>
namespace CGoGN namespace CGoGN
...@@ -53,20 +56,22 @@ typename PFP::VEC3 triangleNormal(typename PFP::MAP& map, Dart d, const typename ...@@ -53,20 +56,22 @@ typename PFP::VEC3 triangleNormal(typename PFP::MAP& map, Dart d, const typename
template<typename PFP> template<typename PFP>
typename PFP::VEC3 newellNormal(typename PFP::MAP& map, Dart d, const typename PFP::TVEC3& position) typename PFP::VEC3 newellNormal(typename PFP::MAP& map, Dart d, const typename PFP::TVEC3& position)
{ {
Dart e = d; Dart it = d;
typename PFP::VEC3 normal(0); typename PFP::VEC3 N(0);
Traversor2FV<typename PFP::MAP> t(map, d) ;
do do
{ {
const typename PFP::VEC3& P = position[e]; const typename PFP::VEC3& P = position[it];
e = map.phi1(e); it = map.phi1(it);
const typename PFP::VEC3& Q = position[e]; const typename PFP::VEC3& Q = position[it];
normal[0] += (P[1] - Q[1]) * (P[2] + Q[2]); N[0] += (P[1] - Q[1]) * (P[2] + Q[2]);
normal[1] += (P[2] - Q[2]) * (P[0] + Q[0]); N[1] += (P[2] - Q[2]) * (P[0] + Q[0]);
normal[2] += (P[0] - Q[0]) * (P[1] + Q[1]); N[2] += (P[0] - Q[0]) * (P[1] + Q[1]);
} while (e != d); } while (it != d);
N.normalize();
normal.normalize(); return N;
return normal;
} }
template <typename PFP> template <typename PFP>
......
...@@ -297,7 +297,6 @@ inline void MapRender::addTri(typename PFP::MAP& map, Dart d, std::vector<GLuint ...@@ -297,7 +297,6 @@ inline void MapRender::addTri(typename PFP::MAP& map, Dart d, std::vector<GLuint
if (map.phi1(c) != a) if (map.phi1(c) != a)
{ {
std::cout << "non triangle face" << std::endl ;
addEarTri<PFP>(map, d, tableIndices); addEarTri<PFP>(map, d, tableIndices);
return; return;
} }
......
...@@ -40,7 +40,7 @@ private: ...@@ -40,7 +40,7 @@ private:
Dart current ; Dart current ;
public: public:
TraversorCell(MAP& map) : m(map), mark(map) TraversorCell(MAP& map, unsigned int thread = 0) : m(map), mark(map, thread)
{} {}
Dart begin() Dart begin()
...@@ -77,28 +77,28 @@ template <typename MAP> ...@@ -77,28 +77,28 @@ template <typename MAP>
class TraversorV : public TraversorCell<MAP, VERTEX> class TraversorV : public TraversorCell<MAP, VERTEX>
{ {
public: public:
TraversorV(MAP& m) : TraversorCell<MAP, VERTEX>(m) {} TraversorV(MAP& m, unsigned int thread = 0) : TraversorCell<MAP, VERTEX>(m, thread) {}
}; };
template <typename MAP> template <typename MAP>
class TraversorE : public TraversorCell<MAP, EDGE> class TraversorE : public TraversorCell<MAP, EDGE>
{ {
public: public:
TraversorE(MAP& m) : TraversorCell<MAP, EDGE>(m) {} TraversorE(MAP& m, unsigned int thread = 0) : TraversorCell<MAP, EDGE>(m, thread) {}
}; };
template <typename MAP> template <typename MAP>
class TraversorF : public TraversorCell<MAP, FACE> class TraversorF : public TraversorCell<MAP, FACE>
{ {
public: public:
TraversorF(MAP& m) : TraversorCell<MAP, FACE>(m) {} TraversorF(MAP& m, unsigned int thread = 0) : TraversorCell<MAP, FACE>(m, thread) {}
}; };
template <typename MAP> template <typename MAP>
class TraversorW : public TraversorCell<MAP, VOLUME> class TraversorW : public TraversorCell<MAP, VOLUME>
{ {
public: public:
TraversorW(MAP& m) : TraversorCell<MAP, VOLUME>(m) {} TraversorW(MAP& m, unsigned int thread = 0) : TraversorCell<MAP, VOLUME>(m, thread) {}
}; };
} // namespace CGoGN } // namespace CGoGN
......
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