Commit 2d102c8d authored by Sylvain Thery's avatar Sylvain Thery

debug // version of curvature

parent 5feedc27
......@@ -117,7 +117,7 @@ void computeCurvatureVertex_NormalCycles(
VertexAttribute<typename PFP::VEC3>& Kmin,
VertexAttribute<typename PFP::VEC3>& Knormal, unsigned int thread=0) ;
} // namespace Geometry
namespace Parallel
{
......@@ -135,8 +135,21 @@ void computeCurvatureVertices_NormalCycles(
VertexAttribute<typename PFP::VEC3>& Knormal,
const FunctorSelect& select = allDarts, unsigned int nbth = 0, unsigned int current_thread=0) ;
}
template <typename PFP>
void computeCurvatureVertices_QuadraticFitting(
typename PFP::MAP& map,
const VertexAttribute<typename PFP::VEC3>& position,
const VertexAttribute<typename PFP::VEC3>& normal,
VertexAttribute<typename PFP::REAL>& kmax,
VertexAttribute<typename PFP::REAL>& kmin,
VertexAttribute<typename PFP::VEC3>& Kmax,
VertexAttribute<typename PFP::VEC3>& Kmin,
const FunctorSelect& select = allDarts, unsigned int nbth=0, unsigned int current_thread=0);
} // namespace Parallel
} // namespace Geometry
} // namespace Algo
......
......@@ -415,12 +415,12 @@ public:
m_kmin(kmin),
m_Kmax(Kmax),
m_Kmin(Kmin),
m_Knormal(normal)
m_Knormal(Knormal)
{ }
void run(Dart d, unsigned int threadID)
{
computeCurvatureVertex_NormalCycles<PFP>(map, d, radius, position, normal, edgeangle, kmax, kmin, Kmax, Kmin, Knormal,threadID) ;
computeCurvatureVertex_NormalCycles<PFP>(this->m_map, d, m_radius, m_position, m_normal, m_edgeangle, m_kmax, m_kmin, m_Kmax, m_Kmin, m_Knormal, threadID) ;
}
};
......@@ -438,12 +438,78 @@ void computeCurvatureVertices_NormalCycles(
VertexAttribute<typename PFP::VEC3>& Knormal,
const FunctorSelect& select, unsigned int nbth, unsigned int current_thread)
{
// WAHOO BIG PROBLEM WITH LAZZY EMBEDDING !!!
if (!map. template isOrbitEmbedded<VERTEX>())
{
CellMarkerNoUnmark<VERTEX> cm(map);
map. template initOrbitEmbedding<VERTEX>();
}
if (!map. template isOrbitEmbedded<EDGE>())
{
CellMarkerNoUnmark<EDGE> cm(map);
map. template initOrbitEmbedding<EDGE>();
}
if (!map. template isOrbitEmbedded<FACE>())
{
CellMarkerNoUnmark<FACE> cm(map);
map. template initOrbitEmbedding<FACE>();
}
FunctorComputeCurvatureVertices_NormalCycles<PFP> funct(map, radius, position, normal, edgeangle, kmax, kmin, Kmax, Kmin, Knormal);
Algo::Parallel::foreach_cell<typename PFP::MAP,VERTEX>(map, funct, nbth, true, select, current_thread);
}
template <typename PFP>
class FunctorComputeCurvatureVertices_QuadraticFitting: public FunctorMapThreaded<typename PFP::MAP >
{
const VertexAttribute<typename PFP::VEC3>& m_position;
const VertexAttribute<typename PFP::VEC3>& m_normal;
VertexAttribute<typename PFP::REAL>& m_kmax;
VertexAttribute<typename PFP::REAL>& m_kmin;
VertexAttribute<typename PFP::VEC3>& m_Kmax;
VertexAttribute<typename PFP::VEC3>& m_Kmin;
public:
FunctorComputeCurvatureVertices_QuadraticFitting( typename PFP::MAP& map,
const VertexAttribute<typename PFP::VEC3>& position,
const VertexAttribute<typename PFP::VEC3>& normal,
VertexAttribute<typename PFP::REAL>& kmax,
VertexAttribute<typename PFP::REAL>& kmin,
VertexAttribute<typename PFP::VEC3>& Kmax,
VertexAttribute<typename PFP::VEC3>& Kmin):
FunctorMapThreaded<typename PFP::MAP>(map),
m_position(position),
m_normal(normal),
m_kmax(kmax),
m_kmin(kmin),
m_Kmax(Kmax),
m_Kmin(Kmin)
{ }
void run(Dart d, unsigned int threadID)
{
computeCurvatureVertex_QuadraticFitting<PFP>(this->m_map, d, m_position, m_normal, m_kmax, m_kmin, m_Kmax, m_Kmin) ;
}
};
template <typename PFP>
void computeCurvatureVertices_QuadraticFitting(
typename PFP::MAP& map,
const VertexAttribute<typename PFP::VEC3>& position,
const VertexAttribute<typename PFP::VEC3>& normal,
VertexAttribute<typename PFP::REAL>& kmax,
VertexAttribute<typename PFP::REAL>& kmin,
VertexAttribute<typename PFP::VEC3>& Kmax,
VertexAttribute<typename PFP::VEC3>& Kmin,
const FunctorSelect& select, unsigned int nbth, unsigned int current_thread)
{
FunctorComputeCurvatureVertices_QuadraticFitting<PFP> funct(map, position, normal, kmax, kmin, Kmax, Kmin);
Algo::Parallel::foreach_cell<typename PFP::MAP,VERTEX>(map, funct, nbth, true, select, current_thread);
}
} // namespace Parallel
} // namespace Geometry
......
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