Commit edb26f50 authored by Sylvain Thery's avatar Sylvain Thery

Merge branch 'optimizedTraversors' into develop

parents 70470eec 0c249b1a
......@@ -272,31 +272,31 @@ void Viewer::cb_keyPress(int keycode)
if(!pos2.isValid())
pos2 = myMap.addAttribute<VEC3, VERTEX>("pos2") ;
foreach_cell_EvenOddd<VERTEX>(myMap, [&] (Vertex d)
{
pos2[d] = VEC3(0,0,0);
int nb=0;
foreach_adjacent2<FACE>(myMap,d,[&](Vertex e)
{
pos2[d] += position[e];
nb++;
});
pos2[d]/=nb;
},
[&] (Vertex d)
{
position[d] = VEC3(0,0,0);
int nb=0;
foreach_adjacent2<FACE>(myMap,d,[&](Vertex e)
{
position[d] += pos2[e];
nb++;
});
position[d]/=nb;
},
3);
std::cout << "Even/Odd "<< ch.elapsed()<< " ms "<< std::endl;
// foreach_cell_EvenOddd<VERTEX>(myMap, [&] (Vertex d)
// {
// pos2[d] = VEC3(0,0,0);
// int nb=0;
// foreach_adjacent2<FACE>(myMap,d,[&](Vertex e)
// {
// pos2[d] += position[e];
// nb++;
// });
// pos2[d]/=nb;
// },
// [&] (Vertex d)
// {
// position[d] = VEC3(0,0,0);
// int nb=0;
// foreach_adjacent2<FACE>(myMap,d,[&](Vertex e)
// {
// position[d] += pos2[e];
// nb++;
// });
// position[d]/=nb;
// },
// 3);
// std::cout << "Even/Odd "<< ch.elapsed()<< " ms "<< std::endl;
Algo::Surface::Geometry::computeNormalVertices<PFP>(myMap, position, normal) ;
m_positionVBO->updateData(position) ;
m_normalVBO->updateData(normal) ;
......@@ -371,45 +371,158 @@ void Viewer::cb_keyPress(int keycode)
case'A':
{
myMap.disableQuickTraversal<VERTEX>() ;
#define NBLOOP 5
Utils::Chrono ch;
ch.start();
{
TraversorCell<MAP, VERTEX,FORCE_CELL_MARKING> trav(myMap,true);
for(unsigned int i=0; i<NBLOOP; ++i)
{
for (Cell<VERTEX> v = trav.begin(), e = trav.end(); v.dart != e.dart; v = trav.next())
{
normal[v][0] = 0.0f;
}
}
std::cout << "FORCE_CELL_MARKING "<< ch.elapsed()<< " ms "<< std::endl;
}
ch.start();
{
TraversorCell<MAP, VERTEX> trav(myMap);
for(unsigned int i=0; i<NBLOOP; ++i)
{
for (Cell<VERTEX> v = trav.begin(), e = trav.end(); v.dart != e.dart; v = trav.next())
{
normal[v][0] = 0.0f;
}
}
std::cout << "auto "<< ch.elapsed()<< " ms "<< std::endl;
}
ch.start();
{
TraversorCell<MAP, VERTEX> trav(myMap,true);
for(unsigned int i=0; i<NBLOOP; ++i)
{
for (Cell<VERTEX> v = trav.begin(), e = trav.end(); v.dart != e.dart; v = trav.next())
{
normal[v][0] = 0.0f;
}
}
std::cout << "auto forcedart "<< ch.elapsed()<< " ms "<< std::endl;
}
ch.start();
{
TraversorCell<MAP, VERTEX,FORCE_DART_MARKING> trav(myMap,true);
for(unsigned int i=0; i<NBLOOP; ++i)
{
for (Cell<VERTEX> v = trav.begin(), e = trav.end(); v.dart != e.dart; v = trav.next())
{
normal[v][0] = 0.0f;
}
}
std::cout << "FORCE_DART_MARKING "<< ch.elapsed()<< " ms "<< std::endl;
}
myMap.enableQuickTraversal<VERTEX>() ;
ch.start();
{
TraversorCell<MAP, VERTEX> trav(myMap);
for(unsigned int i=0; i<NBLOOP; ++i)
{
for (Cell<VERTEX> v = trav.begin(), e = trav.end(); v.dart != e.dart; v = trav.next())
{
normal[v][0] = 0.0f;
}
}
std::cout << "auto (quick) "<< ch.elapsed()<< " ms "<< std::endl;
}
TraversorCell<MAP, VERTEX> trav(myMap,true);
for(unsigned int i=0; i<10; ++i)
ch.start();
{
for (Cell<VERTEX> v = trav.begin(), e = trav.end(); v.dart != e.dart; v = trav.next())
TraversorCell<MAP, VERTEX,FORCE_QUICK_TRAVERSAL> trav(myMap);
for(unsigned int i=0; i<NBLOOP; ++i)
{
// normal[v] = Algo::Surface::Geometry::vertexNormal<PFP>(myMap, v, position) ;
normal[v][0] = 0.0f;
for (Cell<VERTEX> v = trav.begin(), e = trav.end(); v.dart != e.dart; v = trav.next())
{
normal[v][0] = 0.0f;
}
}
std::cout << "FORCE_QUICK_TRAVERSAL "<< ch.elapsed()<< " ms "<< std::endl;
}
std::cout << "Timing 10 traversors "<< ch.elapsed()<< " ms "<< std::endl;
}
break;
case'Z':
{
Utils::Chrono ch;
ch.start();
TraversorCell<MAP, VERTEX> trav(myMap,true);
TraversorCellEven<MAP, VERTEX> tr1(trav);
TraversorCellOdd<MAP, VERTEX> tr2(trav);
for (unsigned int i=0; i<4; ++i)
Algo::Surface::Geometry::computeNormalVertices<PFP>(myMap, position, normal) ;
std::cout << "Algo::Surface::Geometry::Parallel::computeNormalVertices "<< ch.elapsed()<< " ms "<< std::endl;
for(unsigned int i=0; i<5; ++i)
{
for (Cell<VERTEX> v = tr1.begin(), e = tr1.end(); v.dart != e.dart; v = tr1.next())
{
// normal[v] = Algo::Surface::Geometry::vertexNormal<PFP>(myMap, v, position) ;
normal[v][0] = 0.0f;
}
for (Cell<VERTEX> v = tr2.begin(), e = tr2.end(); v.dart != e.dart; v = tr2.next())
ch.start();
CGoGN::Parallel::NumberOfThreads = 1;
for (unsigned int i=0; i<4; ++i)
Algo::Surface::Geometry::Parallel::computeNormalVertices<PFP>(myMap, position, normal) ;
std::cout << "Algo::Surface::Geometry::Parallel::computeNormalVertices1 "<< ch.elapsed()<< " ms "<< std::endl;
ch.start();
CGoGN::Parallel::NumberOfThreads = 2;
for (unsigned int i=0; i<4; ++i)
Algo::Surface::Geometry::Parallel::computeNormalVertices<PFP>(myMap, position, normal) ;
std::cout << "Algo::Surface::Geometry::Parallel::computeNormalVertices2 "<< ch.elapsed()<< " ms "<< std::endl;
ch.start();
CGoGN::Parallel::NumberOfThreads = 3;
for (unsigned int i=0; i<4; ++i)
Algo::Surface::Geometry::Parallel::computeNormalVertices<PFP>(myMap, position, normal) ;
std::cout << "Algo::Surface::Geometry::Parallel::computeNormalVertices3 "<< ch.elapsed()<< " ms "<< std::endl;
ch.start();
CGoGN::Parallel::NumberOfThreads = 4;
for (unsigned int i=0; i<4; ++i)
Algo::Surface::Geometry::Parallel::computeNormalVertices<PFP>(myMap, position, normal) ;
std::cout << "Algo::Surface::Geometry::Parallel::computeNormalVertices4 "<< ch.elapsed()<< " ms "<< std::endl;
ch.start();
CGoGN::Parallel::NumberOfThreads = 8;
for (unsigned int i=0; i<4; ++i)
Algo::Surface::Geometry::Parallel::computeNormalVertices<PFP>(myMap, position, normal) ;
std::cout << "Algo::Surface::Geometry::Parallel::computeNormalVertices8 "<< ch.elapsed()<< " ms "<< std::endl;
ch.start();
for (unsigned int i=0; i<4; ++i)
Parallel::foreach_cell<VERTEX>(myMap,[&](Vertex v, unsigned int th)
{
// normal[v] = Algo::Surface::Geometry::vertexNormal<PFP>(myMap, v, position) ;
normal[v][0] = 0.0f;
}
}
std::cout << "Timing 5 traversors even/odd "<< ch.elapsed()<< " ms "<< std::endl;
normal[v] = Algo::Surface::Geometry::vertexNormal<PFP>(myMap,v,position);
},false,FORCE_CELL_MARKING);
std::cout << "Parallel::foreach_cell "<< ch.elapsed()<< " ms "<< std::endl;
// ch.start();
// Parallel::foreach_cell_EO<VERTEX>(myMap,[&](Vertex v, unsigned int thr)
// {
// normal[v] = Algo::Surface::Geometry::vertexNormal<PFP>(myMap,v,position);
// },
// [&](Vertex v, unsigned int th)
// {
// normal[v] = Algo::Surface::Geometry::vertexNormal<PFP>(myMap,v,position);
// },2,4,false,FORCE_CELL_MARKING);
// std::cout << "Parallel::foreach_cell_EO "<< ch.elapsed()<< " ms "<< std::endl;
}
break;
......
......@@ -498,8 +498,6 @@ int main(int argc, char **argv)
Utils::Chrono ch;
Vertex v(myMap.begin());
VEC3 p = Algo::Volume::Geometry::vertexNeighborhoodCentroid<PFP>(myMap,v,position);
......@@ -529,7 +527,6 @@ int main(int argc, char **argv)
vol += Algo::Geometry::totalVolume<PFP>(myMap, position);
std::cout << ch.elapsed()<< " ms val="<<vol<< std::endl;
// et on attend la fin.
return app.exec();
}
......@@ -114,7 +114,7 @@ int main()
{
position[v] += VEC3(0.0,0.0,PFP::REAL(thread)*0.1f);
// WARNING thread vary here from 1 to 4 (and not from 0 to 3) !!!!
},4,false); // 4:4 thread, false for no need for markers in threaded code.
},false); // 4:4 thread, false for no need for markers in threaded code.
std::cout << "After // processing"<< std::endl;
......@@ -127,17 +127,22 @@ int main()
// Example with // accumulation
// computing the sum of area faces
// force number of threads to 4 (0 for traverse, 1,2,3 for computation)
CGoGN::Parallel::NumberOfThreads = 4;
// init nbthread values with 0
float surf[4]={0.0f,0.0f,0.0f,0.0f};
float surf[3]={0.0f,0.0f,0.0f};
// traverse face in //
Parallel::foreach_cell<FACE>(myMap,[&](Face f, unsigned int thr)
{
// for each face add surface to accumulator (-1 because counter between 1-4 not 0-3)
// for each face add surface to accumulator (-1 because counter between 1-3 not 0-3)
surf[thr-1] += Algo::Surface::Geometry::convexFaceArea<PFP>(myMap,f,position);
},4,false);
},false);
std::cout << surf[0]<< "/"<< surf[1]<< "/"<< surf[2]<< "/"<< surf[3]<< "/"<< std::endl;
std::cout << "Total="<<surf[0]+surf[1]+surf[2]+surf[3]<< std::endl;
std::cout << surf[0]<< "/"<< surf[1]<< "/"<< surf[2]<< "/"<< std::endl;
std::cout << "Total="<<surf[0]+surf[1]+surf[2]<< std::endl;
TraversorV<MAP> tv0(myMap);
......
......@@ -86,6 +86,21 @@ void computeBarycentricAreaVertices(typename PFP::MAP& map, const VertexAttribut
template <typename PFP>
void computeVoronoiAreaVertices(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP::IMPL>& position, VertexAttribute<typename PFP::REAL, typename PFP::MAP::IMPL>& vertex_area, unsigned int thread = 0) ;
namespace Parallel
{
template <typename PFP>
void computeAreaFaces(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP::IMPL>& position, FaceAttribute<typename PFP::REAL, typename PFP::MAP::IMPL>& area);
template <typename PFP>
void computeOneRingAreaVertices(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP::IMPL>& position, VertexAttribute<typename PFP::REAL, typename PFP::MAP::IMPL>& area);
template <typename PFP>
void computeBarycentricAreaVertices(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP::IMPL>& position, VertexAttribute<typename PFP::REAL, typename PFP::MAP::IMPL>& vertex_area);
template <typename PFP>
void computeVoronoiAreaVertices(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& position, VertexAttribute<typename PFP::REAL, typename PFP::MAP>& area);
} // namespace Parallel
} // namespace Geometry
} // namespace Surface
......
......@@ -76,8 +76,6 @@ typename PFP::REAL totalArea(typename PFP::MAP& map, const VertexAttribute<typen
{
typename PFP::REAL area(0) ;
// TraversorF<typename PFP::MAP> t(map) ;
foreach_cell<FACE>(map, [&] (Face f)
{
area += convexFaceArea<PFP>(map, f, position);
......@@ -91,7 +89,6 @@ template <typename PFP>
typename PFP::REAL vertexOneRingArea(typename PFP::MAP& map, Vertex v, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP::IMPL>& position)
{
typename PFP::REAL area(0) ;
// Traversor2VF<typename PFP::MAP> t(map, d) ;
foreach_incident2<FACE>(map, v, [&] (Face f)
{
......@@ -104,7 +101,6 @@ template <typename PFP>
typename PFP::REAL vertexBarycentricArea(typename PFP::MAP& map, Vertex v, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP::IMPL>& position)
{
typename PFP::REAL area(0) ;
// Traversor2VF<typename PFP::MAP> t(map, v) ;
foreach_incident2<FACE>(map, v, [&] (Face f)
{
......@@ -117,7 +113,6 @@ template <typename PFP>
typename PFP::REAL vertexVoronoiArea(typename PFP::MAP& map, Vertex v, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP::IMPL>& position)
{
typename PFP::REAL area(0) ;
// Traversor2VF<typename PFP::MAP> t(map, v) ;
foreach_incident2<FACE>(map, v, [&] (Face it)
{
const typename PFP::VEC3& p1 = position[it] ;
......@@ -144,21 +139,30 @@ typename PFP::REAL vertexVoronoiArea(typename PFP::MAP& map, Vertex v, const Ver
template <typename PFP>
void computeAreaFaces(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP::IMPL>& position, FaceAttribute<typename PFP::REAL, typename PFP::MAP::IMPL>& face_area, unsigned int thread)
{
// TraversorF<typename PFP::MAP> t(map) ;
// for(Dart d = t.begin(); d != t.end(); d = t.next())
// face_area[d] = convexFaceArea<PFP>(map, d, position) ;
if ((CGoGN::Parallel::NumberOfThreads > 1) && (thread==0))
{
Parallel::computeAreaFaces<PFP>(map,position,face_area);
return;
}
foreach_cell<FACE>(map, [&] (Face f)
{
face_area[f] = convexFaceArea<PFP>(map, f, position) ;
}
,false,thread);
,AUTO,thread);
}
template <typename PFP>
void computeOneRingAreaVertices(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP::IMPL>& position, VertexAttribute<typename PFP::REAL, typename PFP::MAP::IMPL>& vertex_area, unsigned int thread)
{
if ((CGoGN::Parallel::NumberOfThreads > 1) && (thread==0))
{
Parallel::computeOneRingAreaVertices<PFP>(map,position,vertex_area);
return;
}
FaceAutoAttribute<typename PFP::REAL,typename PFP::MAP::IMPL> areas(map);
computeAreaFaces<PFP>(map,position,areas);
......@@ -170,30 +174,40 @@ void computeOneRingAreaVertices(typename PFP::MAP& map, const VertexAttribute<ty
vertex_area[v] += areas[f];
});
}
,false,thread);
,FORCE_CELL_MARKING,thread);
}
template <typename PFP>
void computeBarycentricAreaVertices(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP::IMPL>& position, VertexAttribute<typename PFP::REAL, typename PFP::MAP::IMPL>& vertex_area, unsigned int thread)
{
// TraversorV<typename PFP::MAP> t(map) ;
if ((CGoGN::Parallel::NumberOfThreads > 1) && (thread==0))
{
Parallel::computeBarycentricAreaVertices<PFP>(map,position,vertex_area);
return;
}
foreach_cell<VERTEX>(map, [&] (Vertex v)
{
vertex_area[v] = vertexBarycentricArea<PFP>(map, v, position) ;
}
,false,thread);
,FORCE_CELL_MARKING,thread);
}
template <typename PFP>
void computeVoronoiAreaVertices(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP::IMPL>& position, VertexAttribute<typename PFP::REAL, typename PFP::MAP::IMPL>& vertex_area, unsigned int thread)
{
// TraversorV<typename PFP::MAP> t(map) ;
if ((CGoGN::Parallel::NumberOfThreads > 1) && (thread==0))
{
Parallel::computeVoronoiAreaVertices<PFP>(map,position,vertex_area);
return;
}
foreach_cell<VERTEX>(map, [&] (Vertex v)
{
vertex_area[v] = vertexVoronoiArea<PFP>(map, v, position) ;
}
,false,thread);
,FORCE_CELL_MARKING,thread);
}
......@@ -202,72 +216,56 @@ namespace Parallel
{
template <typename PFP>
class FunctorConvexFaceArea: public FunctorMapThreaded<typename PFP::MAP >
void computeAreaFaces(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP::IMPL>& position, FaceAttribute<typename PFP::REAL, typename PFP::MAP::IMPL>& area)
{
const VertexAttribute<typename PFP::VEC3, typename PFP::MAP::IMPL>& m_position;
FaceAttribute<typename PFP::REAL, typename PFP::MAP::IMPL>& m_area;
public:
FunctorConvexFaceArea<PFP>( typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP::IMPL>& position, FaceAttribute<typename PFP::REAL, typename PFP::MAP::IMPL>& area):
FunctorMapThreaded<typename PFP::MAP>(map), m_position(position), m_area(area)
{ }
void run(Dart d, unsigned int threadID)
// if (map.isOrbitEmbedded<FACE>())
// {
// Parallel::foreach_cell<FACE>(map,[&](Face f, unsigned int thr)
// {
// area[f] = convexFaceArea<PFP>(map, f, position) ;
// },nbth,false,FORCE_CELL_MARKING);
// }
// else
// {
// Parallel::foreach_cell<FACE>(map,[&](Face f, unsigned int thr)
// {
// area[f] = convexFaceArea<PFP>(map, f, position) ;
// },nbth,false,AUTO);
// }
CGoGN::Parallel::foreach_cell<FACE>(map,[&](Face f, unsigned int thr)
{
m_area[d] = convexFaceArea<PFP>(this->m_map, d, m_position) ;
}
};
template <typename PFP>
void computeAreaFaces(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP::IMPL>& position, FaceAttribute<typename PFP::REAL, typename PFP::MAP::IMPL>& area, unsigned int nbth)
{
FunctorConvexFaceArea<PFP> funct(map,position,area);
Algo::Parallel::foreach_cell<typename PFP::MAP,FACE>(map, funct, nbth, false);
area[f] = convexFaceArea<PFP>(map, f, position) ;
},false,AUTO);
}
template <typename PFP>
class FunctorVertexOneRingArea: public FunctorMapThreaded<typename PFP::MAP >
{
const VertexAttribute<typename PFP::VEC3, typename PFP::MAP::IMPL>& m_position;
VertexAttribute<typename PFP::REAL, typename PFP::MAP::IMPL>& m_area;
public:
FunctorVertexOneRingArea<PFP>( typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP::IMPL>& position, VertexAttribute<typename PFP::REAL, typename PFP::MAP::IMPL>& area):
FunctorMapThreaded<typename PFP::MAP>(map), m_position(position), m_area(area)
{ }
void run(Dart d, unsigned int threadID)
{
m_area[d] = vertexOneRingArea<PFP>(this->m_map, d, m_position) ;
}
};
template <typename PFP>
void computeOneRingAreaVertices(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP::IMPL>& position, VertexAttribute<typename PFP::REAL, typename PFP::MAP::IMPL>& area, unsigned int nbth)
void computeOneRingAreaVertices(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP::IMPL>& position, VertexAttribute<typename PFP::REAL, typename PFP::MAP::IMPL>& area)
{
FunctorConvexFaceArea<PFP> funct(map,position,area);
Algo::Parallel::foreach_cell<typename PFP::MAP,VERTEX>(map, funct, nbth, false);
CGoGN::Parallel::foreach_cell<VERTEX>(map,[&](Vertex v, unsigned int thr)
{
area[v] = vertexOneRingArea<PFP>(map, v, position) ;
},false,FORCE_CELL_MARKING);
}
template <typename PFP>
class FunctorVertexVoronoiArea: public FunctorMapThreaded<typename PFP::MAP >
void computeBarycentricAreaVertices(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP::IMPL>& position, VertexAttribute<typename PFP::REAL, typename PFP::MAP::IMPL>& vertex_area)
{
const VertexAttribute<typename PFP::VEC3, typename PFP::MAP::IMPL>& m_position;
VertexAttribute<typename PFP::REAL, typename PFP::MAP::IMPL>& m_area;
public:
FunctorVertexVoronoiArea<PFP>( typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP::IMPL>& position, VertexAttribute<typename PFP::REAL, typename PFP::MAP::IMPL>& area):
FunctorMapThreaded<typename PFP::MAP>(map), m_position(position), m_area(area)
{ }
void run(Dart d, unsigned int threadID)
CGoGN::Parallel::foreach_cell<VERTEX>(map, [&] (Vertex v, unsigned int thr)
{
m_area[d] = vertexVoronoiArea<PFP>(this->m_map, d, m_position) ;
vertex_area[v] = vertexBarycentricArea<PFP>(map, v, position) ;
}
};
,false,FORCE_CELL_MARKING);
}
template <typename PFP>
void computeVoronoiAreaVertices(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& position, VertexAttribute<typename PFP::REAL, typename PFP::MAP>& area, unsigned int nbth)
void computeVoronoiAreaVertices(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& position, VertexAttribute<typename PFP::REAL, typename PFP::MAP>& area)
{
FunctorConvexFaceArea<PFP> funct(map,position,area);
Algo::Parallel::foreach_cell<typename PFP::MAP, VERTEX>(map, funct, nbth, false);
CGoGN::Parallel::foreach_cell<VERTEX>(map,[&](Vertex v, unsigned int thr)
{
area[v] = vertexVoronoiArea<PFP>(map, v, position) ;
},false,FORCE_CELL_MARKING);
}
} // namespace Parallel
......
......@@ -140,36 +140,30 @@ namespace Parallel
* @param map the map
* @param position position vertex attribute
* @param face_centroid centroid face attribute
* @param nbth the number of threads
*/
template <typename PFP, typename V_ATT, typename F_ATT>
void computeCentroidFaces(typename PFP::MAP& map,
const V_ATT& position, F_ATT& face_centroid,
unsigned int nbth = 0) ;
const V_ATT& position, F_ATT& face_centroid) ;
/**
* Compute centroid of all faces (Edge Length Weighted)
* @param map the map
* @param position position vertex attribute
* @param face_centroid centroid face attribute
* @param nbth the number of threads
*/
template <typename PFP, typename V_ATT, typename F_ATT>
void computeCentroidELWFaces(typename PFP::MAP& map,
const V_ATT& position, F_ATT& face_centroid,
unsigned int nbth = 0) ;
const V_ATT& position, F_ATT& face_centroid) ;
/**
* Compute neighborhood centroid of all vertices (in parallel)
* @param map the map
* @param position position vertex attribute
* @param vertex_centroid centroid vertex attribute
* @param nbth the number of threads
*/
template <typename PFP, typename V_ATT>
void computeNeighborhoodCentroidVertices(typename PFP::MAP& map,
const V_ATT& position, V_ATT& vertex_centroid,
unsigned int nbth = 0) ;
const V_ATT& position, V_ATT& vertex_centroid) ;
} // namespace Parallel
......@@ -224,20 +218,17 @@ namespace Parallel
template <typename PFP, typename V_ATT, typename W_ATT>
void computeCentroidVolumes(typename PFP::MAP& map,
const V_ATT& position, W_ATT& vol_centroid,
unsigned int nbth = 0) ;
const V_ATT& position, W_ATT& vol_centroid) ;
template <typename PFP, typename V_ATT, typename W_ATT>
void computeCentroidELWVolumes(typename PFP::MAP& map,
const V_ATT& position, W_ATT& vol_centroid,
unsigned int nbth = 0) ;
const V_ATT& position, W_ATT& vol_centroid) ;
template <typename PFP, typename V_ATT>
void computeNeighborhoodCentroidVertices(typename PFP::MAP& map,
const V_ATT& position, V_ATT& vertex_centroid,
unsigned int nbth = 0) ;
const V_ATT& position, V_ATT& vertex_centroid) ;
} // namespace Parallel
......
This diff is collapsed.
......@@ -260,19 +260,30 @@ void computeCurvatureVertices_NormalCycles(
VertexAttribute<typename PFP::REAL, typename PFP::MAP::IMPL>& kmin,
VertexAttribute<typename PFP::VEC3, typename PFP::MAP::IMPL>& Kmax,
VertexAttribute<typename PFP::VEC3, typename PFP::MAP::IMPL>& Kmin,
VertexAttribute<typename PFP::VEC3, typename PFP::MAP::IMPL>& Knormal,
unsigned int nbth = 0) ;
VertexAttribute<typename PFP::VEC3, typename PFP::MAP::IMPL>& Knormal) ;
template <typename PFP>
void computeCurvatureVertices_QuadraticFitting(
void computeCurvatureVertices_NormalCycles_Projected(
typename PFP::MAP& map,
typename PFP::REAL radius,
const VertexAttribute<typename PFP::VEC3, typename PFP::MAP::IMPL>& position,
const VertexAttribute<typename PFP::VEC3, typename PFP::MAP::IMPL>& normal,
const EdgeAttribute<typename PFP::REAL, typename PFP::MAP::IMPL>& edgeangle,
VertexAttribute<typename PFP::REAL, typename PFP::MAP::IMPL>& kmax,
VertexAttribute<typename PFP::REAL, typename PFP::MAP::IMPL>& kmin,
VertexAttribute<typename PFP::VEC3, typename PFP::MAP::IMPL>& Kmax,
VertexAttribute<typename PFP::VEC3, typename PFP::MAP::IMPL>& Kmin,
unsigned int nbth = 0);
VertexAttribute<typename PFP::VEC3, typename PFP::MAP::IMPL>& Knormal) ;
template <typename PFP>
void computeCurvatureVertices_QuadraticFitting(
typename PFP::MAP& map,
const VertexAttribute<typename PFP::VEC3, typename PFP::MAP::IMPL>& position,
const VertexAttribute<typename PFP::VEC3, typename PFP::MAP::IMPL>& normal,
VertexAttribute<typename PFP::REAL, typename PFP::MAP::IMPL>& kmax,
VertexAttribute<typename PFP::REAL, typename PFP::MAP::IMPL>& kmin,
VertexAttribute<typename PFP::VEC3, typename PFP::MAP::IMPL>& Kmax,
VertexAttribute<typename PFP::VEC3, typename PFP::MAP::IMPL>& Kmin);
} // namespace Parallel
......