Commit 82cf5ae8 authored by Sylvain Thery's avatar Sylvain Thery

remove thread parameter

parent 5c0e1f36
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
IF (ONELIB) IF (ONELIB)
SET(CGoGN_LIBS cgogn) SET(CGoGN_LIBS cgogn)
ELSE (ONELIB) ELSE (ONELIB)
SET(CGoGN_LIBS topology algo container utils) SET(CGoGN_LIBS algo topology container utils)
ENDIF (ONELIB) ENDIF (ONELIB)
......
...@@ -47,7 +47,7 @@ typedef PFP::VEC3 VEC3 ; // type of R³ vector ...@@ -47,7 +47,7 @@ typedef PFP::VEC3 VEC3 ; // type of R³ vector
template <typename PFP, typename V_ATT> template <typename PFP, typename V_ATT>
typename V_ATT::DATA_TYPE localvolumeCentroidELW(typename PFP::MAP& map, Vol d, const V_ATT& attributs, unsigned int thread=0) typename V_ATT::DATA_TYPE localvolumeCentroidELW(typename PFP::MAP& map, Vol d, const V_ATT& attributs)
{ {
typedef typename V_ATT::DATA_TYPE EMB; typedef typename V_ATT::DATA_TYPE EMB;
EMB center(0.0); EMB center(0.0);
......
...@@ -143,7 +143,8 @@ IF (WITH_QT) ...@@ -143,7 +143,8 @@ IF (WITH_QT)
ADD_DEFINITIONS(${QT_DEFINITIONS}) ADD_DEFINITIONS(${QT_DEFINITIONS})
find_package(QGLViewer REQUIRED) find_package(QGLViewer REQUIRED)
SET (CGoGN_EXT_INCLUDES ${CGoGN_EXT_INCLUDES} ${QT_INCLUDE_DIR} ${QGLVIEWER_INCLUDE_DIR} ) SET (CGoGN_EXT_INCLUDES ${CGoGN_EXT_INCLUDES} ${QT_INCLUDE_DIR} ${QGLVIEWER_INCLUDE_DIR} )
SET (CGoGN_EXT_LIBS ${QT_LIBRARIES} ${QGLVIEWER_LIBRARIES} ${CGoGN_EXT_LIBS}) SET (CGoGN_EXT_LIBS ${QGLVIEWER_LIBRARIES} ${QT_LIBRARIES} ${CGoGN_EXT_LIBS})
ENDIF (WITH_QT) ENDIF (WITH_QT)
IF (WITH_GLEWMX) IF (WITH_GLEWMX)
......
...@@ -63,10 +63,10 @@ class CellSelector : public CellSelectorGen ...@@ -63,10 +63,10 @@ class CellSelector : public CellSelectorGen
typedef CellSelector<MAP, ORBIT> SELECTOR; typedef CellSelector<MAP, ORBIT> SELECTOR;
public: public:
CellSelector(MAP& map, const QString& name, unsigned int thread = 0) : CellSelector(MAP& map, const QString& name) :
CellSelectorGen(name), CellSelectorGen(name),
m_map(map), m_map(map),
m_cm(map, thread) m_cm(map)
{} {}
~CellSelector() ~CellSelector()
......
...@@ -26,7 +26,7 @@ file(STRINGS ${CGoGN_ROOT_DIR}/include/cgogn_onelib.h ONELIB_STR) ...@@ -26,7 +26,7 @@ file(STRINGS ${CGoGN_ROOT_DIR}/include/cgogn_onelib.h ONELIB_STR)
IF (ONELIB_STR EQUAL 1) IF (ONELIB_STR EQUAL 1)
SET(CGoGN_LIBS cgogn) SET(CGoGN_LIBS cgogn)
ELSE() ELSE()
SET(CGoGN_LIBS topology algo container utils) SET(CGoGN_LIBS algo topology container utils)
ENDIF() ENDIF()
IF(WIN32) IF(WIN32)
......
...@@ -58,7 +58,7 @@ typename PFP::REAL convexFaceArea(typename PFP::MAP& map, Face f, const VertexAt ...@@ -58,7 +58,7 @@ typename PFP::REAL convexFaceArea(typename PFP::MAP& map, Face f, const VertexAt
//! @param position //! @param position
//! @return //! @return
template <typename PFP> template <typename PFP>
typename PFP::REAL totalArea(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& position, unsigned int thread = 0) ; typename PFP::REAL totalArea(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& position) ;
//! \brief Compute the area of the faces around a vertex. //! \brief Compute the area of the faces around a vertex.
//! @param map //! @param map
...@@ -75,16 +75,16 @@ template <typename PFP> ...@@ -75,16 +75,16 @@ template <typename PFP>
typename PFP::REAL vertexVoronoiArea(typename PFP::MAP& map, Vertex v, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& position) ; typename PFP::REAL vertexVoronoiArea(typename PFP::MAP& map, Vertex v, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& position) ;
template <typename PFP> template <typename PFP>
void computeAreaFaces(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& position, FaceAttribute<typename PFP::REAL, typename PFP::MAP>& face_area, unsigned int thread = 0) ; void computeAreaFaces(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& position, FaceAttribute<typename PFP::REAL, typename PFP::MAP>& face_area) ;
template <typename PFP> template <typename PFP>
void computeOneRingAreaVertices(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& position, VertexAttribute<typename PFP::REAL, typename PFP::MAP>& vertex_area, unsigned int thread = 0) ; void computeOneRingAreaVertices(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& position, VertexAttribute<typename PFP::REAL, typename PFP::MAP>& vertex_area) ;
template <typename PFP> template <typename PFP>
void computeBarycentricAreaVertices(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& position, VertexAttribute<typename PFP::REAL, typename PFP::MAP>& vertex_area, unsigned int thread = 0) ; void computeBarycentricAreaVertices(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& position, VertexAttribute<typename PFP::REAL, typename PFP::MAP>& vertex_area) ;
template <typename PFP> 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>& vertex_area, unsigned int thread = 0) ; void computeVoronoiAreaVertices(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& position, VertexAttribute<typename PFP::REAL, typename PFP::MAP>& vertex_area) ;
namespace Parallel namespace Parallel
{ {
......
...@@ -72,7 +72,7 @@ typename PFP::REAL convexFaceArea(typename PFP::MAP& map, Face d, const VertexAt ...@@ -72,7 +72,7 @@ typename PFP::REAL convexFaceArea(typename PFP::MAP& map, Face d, const VertexAt
} }
template <typename PFP> template <typename PFP>
typename PFP::REAL totalArea(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& position, unsigned int thread) typename PFP::REAL totalArea(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& position)
{ {
typename PFP::REAL area(0) ; typename PFP::REAL area(0) ;
...@@ -80,7 +80,7 @@ typename PFP::REAL totalArea(typename PFP::MAP& map, const VertexAttribute<typen ...@@ -80,7 +80,7 @@ typename PFP::REAL totalArea(typename PFP::MAP& map, const VertexAttribute<typen
{ {
area += convexFaceArea<PFP>(map, f, position); area += convexFaceArea<PFP>(map, f, position);
} }
,AUTO,thread); ,AUTO);
return area ; return area ;
} }
...@@ -137,10 +137,10 @@ typename PFP::REAL vertexVoronoiArea(typename PFP::MAP& map, Vertex v, const Ver ...@@ -137,10 +137,10 @@ typename PFP::REAL vertexVoronoiArea(typename PFP::MAP& map, Vertex v, const Ver
} }
template <typename PFP> template <typename PFP>
void computeAreaFaces(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& position, FaceAttribute<typename PFP::REAL, typename PFP::MAP>& face_area, unsigned int thread) void computeAreaFaces(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& position, FaceAttribute<typename PFP::REAL, typename PFP::MAP>& face_area)
{ {
if ((CGoGN::Parallel::NumberOfThreads > 1) && (thread==0)) if (CGoGN::Parallel::NumberOfThreads > 1)
{ {
Parallel::computeAreaFaces<PFP>(map,position,face_area); Parallel::computeAreaFaces<PFP>(map,position,face_area);
return; return;
...@@ -150,14 +150,14 @@ void computeAreaFaces(typename PFP::MAP& map, const VertexAttribute<typename PFP ...@@ -150,14 +150,14 @@ void computeAreaFaces(typename PFP::MAP& map, const VertexAttribute<typename PFP
{ {
face_area[f] = convexFaceArea<PFP>(map, f, position) ; face_area[f] = convexFaceArea<PFP>(map, f, position) ;
} }
,AUTO,thread); ,AUTO);
} }
template <typename PFP> template <typename PFP>
void computeOneRingAreaVertices(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& position, VertexAttribute<typename PFP::REAL, typename PFP::MAP>& vertex_area, unsigned int thread) void computeOneRingAreaVertices(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& position, VertexAttribute<typename PFP::REAL, typename PFP::MAP>& vertex_area)
{ {
if ((CGoGN::Parallel::NumberOfThreads > 1) && (thread==0)) if (CGoGN::Parallel::NumberOfThreads > 1)
{ {
Parallel::computeOneRingAreaVertices<PFP>(map,position,vertex_area); Parallel::computeOneRingAreaVertices<PFP>(map,position,vertex_area);
return; return;
...@@ -174,14 +174,14 @@ void computeOneRingAreaVertices(typename PFP::MAP& map, const VertexAttribute<ty ...@@ -174,14 +174,14 @@ void computeOneRingAreaVertices(typename PFP::MAP& map, const VertexAttribute<ty
vertex_area[v] += areas[f]; vertex_area[v] += areas[f];
}); });
} }
,FORCE_CELL_MARKING,thread); ,FORCE_CELL_MARKING);
} }
template <typename PFP> template <typename PFP>
void computeBarycentricAreaVertices(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& position, VertexAttribute<typename PFP::REAL, typename PFP::MAP>& vertex_area, unsigned int thread) void computeBarycentricAreaVertices(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& position, VertexAttribute<typename PFP::REAL, typename PFP::MAP>& vertex_area)
{ {
if ((CGoGN::Parallel::NumberOfThreads > 1) && (thread==0)) if (CGoGN::Parallel::NumberOfThreads > 1)
{ {
Parallel::computeBarycentricAreaVertices<PFP>(map,position,vertex_area); Parallel::computeBarycentricAreaVertices<PFP>(map,position,vertex_area);
return; return;
...@@ -191,13 +191,13 @@ void computeBarycentricAreaVertices(typename PFP::MAP& map, const VertexAttribut ...@@ -191,13 +191,13 @@ void computeBarycentricAreaVertices(typename PFP::MAP& map, const VertexAttribut
{ {
vertex_area[v] = vertexBarycentricArea<PFP>(map, v, position) ; vertex_area[v] = vertexBarycentricArea<PFP>(map, v, position) ;
} }
,FORCE_CELL_MARKING,thread); ,FORCE_CELL_MARKING);
} }
template <typename PFP> 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>& vertex_area, unsigned int thread) void computeVoronoiAreaVertices(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& position, VertexAttribute<typename PFP::REAL, typename PFP::MAP>& vertex_area)
{ {
if ((CGoGN::Parallel::NumberOfThreads > 1) && (thread==0)) if (CGoGN::Parallel::NumberOfThreads > 1)
{ {
Parallel::computeVoronoiAreaVertices<PFP>(map,position,vertex_area); Parallel::computeVoronoiAreaVertices<PFP>(map,position,vertex_area);
return; return;
...@@ -207,7 +207,7 @@ void computeVoronoiAreaVertices(typename PFP::MAP& map, const VertexAttribute<ty ...@@ -207,7 +207,7 @@ void computeVoronoiAreaVertices(typename PFP::MAP& map, const VertexAttribute<ty
{ {
vertex_area[v] = vertexVoronoiArea<PFP>(map, v, position) ; vertex_area[v] = vertexVoronoiArea<PFP>(map, v, position) ;
} }
,FORCE_CELL_MARKING,thread); ,FORCE_CELL_MARKING);
} }
......
...@@ -50,7 +50,7 @@ namespace Geometry ...@@ -50,7 +50,7 @@ namespace Geometry
* @param attributs the vector of attribute or cell * @param attributs the vector of attribute or cell
*/ */
template <typename PFP, typename V_ATT> template <typename PFP, typename V_ATT>
typename V_ATT::DATA_TYPE volumeCentroid(typename PFP::MAP& map, Vol d, const V_ATT& attributs, unsigned int thread = 0); typename V_ATT::DATA_TYPE volumeCentroid(typename PFP::MAP& map, Vol d, const V_ATT& attributs);
/** /**
* Compute volume centroid weighted by edge length (generic version) * Compute volume centroid weighted by edge length (generic version)
...@@ -63,7 +63,7 @@ typename V_ATT::DATA_TYPE volumeCentroid(typename PFP::MAP& map, Vol d, const V_ ...@@ -63,7 +63,7 @@ typename V_ATT::DATA_TYPE volumeCentroid(typename PFP::MAP& map, Vol d, const V_
* @param attributs the vector of attribute or cell * @param attributs the vector of attribute or cell
*/ */
template <typename PFP, typename V_ATT> template <typename PFP, typename V_ATT>
typename V_ATT::DATA_TYPE volumeCentroidELW(typename PFP::MAP& map, Vol d, const V_ATT& attributs, unsigned int thread = 0); typename V_ATT::DATA_TYPE volumeCentroidELW(typename PFP::MAP& map, Vol d, const V_ATT& attributs);
/** /**
* Compute face centroid (generic version) * Compute face centroid (generic version)
...@@ -106,30 +106,27 @@ typename V_ATT::DATA_TYPE vertexNeighborhoodCentroid(typename PFP::MAP& map, Ver ...@@ -106,30 +106,27 @@ typename V_ATT::DATA_TYPE vertexNeighborhoodCentroid(typename PFP::MAP& map, Ver
* @param map the map * @param map the map
* @param position position vertex attribute * @param position position vertex attribute
* @param face_centroid centroid face attribute * @param face_centroid centroid face attribute
* @param thread the thread id (default 0)
*/ */
template <typename PFP, typename V_ATT, typename F_ATT> 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 thread = 0); void computeCentroidFaces(typename PFP::MAP& map, const V_ATT& position, F_ATT& face_centroid);
/** /**
* Compute centroid of all faces (Edge Length Weighted) * Compute centroid of all faces (Edge Length Weighted)
* @param map the map * @param map the map
* @param position position vertex attribute * @param position position vertex attribute
* @param face_centroid centroid face attribute * @param face_centroid centroid face attribute
* @param thread the thread id (default 0)
*/ */
template <typename PFP, typename V_ATT, typename F_ATT> 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 thread = 0) ; void computeCentroidELWFaces(typename PFP::MAP& map, const V_ATT& position, F_ATT& face_centroid) ;
/** /**
* Compute neighborhood centroid of all vertices * Compute neighborhood centroid of all vertices
* @param map the map * @param map the map
* @param position position vertex attribute * @param position position vertex attribute
* @param vertex_centroid centroid vertex attribute * @param vertex_centroid centroid vertex attribute
* @param thread the thread id (default 0)
*/ */
template <typename PFP, typename V_ATT> template <typename PFP, typename V_ATT>
void computeNeighborhoodCentroidVertices(typename PFP::MAP& map, const V_ATT& position, V_ATT& vertex_centroid, unsigned int thread = 0) ; void computeNeighborhoodCentroidVertices(typename PFP::MAP& map, const V_ATT& position, V_ATT& vertex_centroid) ;
namespace Parallel namespace Parallel
...@@ -189,7 +186,7 @@ namespace Geometry ...@@ -189,7 +186,7 @@ namespace Geometry
* @param position the vector of attribute or cell * @param position the vector of attribute or cell
*/ */
template <typename PFP, typename V_ATT> template <typename PFP, typename V_ATT>
typename V_ATT::DATA_TYPE vertexNeighborhoodCentroid(typename PFP::MAP& map, Vertex d, const V_ATT& attributs, unsigned int thread = 0); typename V_ATT::DATA_TYPE vertexNeighborhoodCentroid(typename PFP::MAP& map, Vertex d, const V_ATT& attributs);
/** /**
* compute centroid of all volumes * compute centroid of all volumes
...@@ -198,10 +195,10 @@ typename V_ATT::DATA_TYPE vertexNeighborhoodCentroid(typename PFP::MAP& map, Ver ...@@ -198,10 +195,10 @@ typename V_ATT::DATA_TYPE vertexNeighborhoodCentroid(typename PFP::MAP& map, Ver
* @param vol_centroid volume attribute where to store the centroids * @param vol_centroid volume attribute where to store the centroids
*/ */
template <typename PFP, typename V_ATT, typename W_ATT> 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 thread = 0); void computeCentroidVolumes(typename PFP::MAP& map, const V_ATT& position, W_ATT& vol_centroid);
template <typename PFP, typename V_ATT, typename W_ATT> 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 thread = 0); void computeCentroidELWVolumes(typename PFP::MAP& map, const V_ATT& position, W_ATT& vol_centroid);
/** /**
* compute centroid of all vertices * compute centroid of all vertices
...@@ -210,7 +207,7 @@ void computeCentroidELWVolumes(typename PFP::MAP& map, const V_ATT& position, W_ ...@@ -210,7 +207,7 @@ void computeCentroidELWVolumes(typename PFP::MAP& map, const V_ATT& position, W_
* @param vertex_centroid vertex attribute to store the centroids * @param vertex_centroid vertex attribute to store the centroids
*/ */
template <typename PFP, typename V_ATT> template <typename PFP, typename V_ATT>
void computeNeighborhoodCentroidVertices(typename PFP::MAP& map, const V_ATT& position, V_ATT& vertex_centroid, unsigned int thread = 0) ; void computeNeighborhoodCentroidVertices(typename PFP::MAP& map, const V_ATT& position, V_ATT& vertex_centroid) ;
namespace Parallel namespace Parallel
......
...@@ -41,7 +41,7 @@ namespace Geometry ...@@ -41,7 +41,7 @@ namespace Geometry
{ {
template <typename PFP, typename V_ATT> template <typename PFP, typename V_ATT>
typename V_ATT::DATA_TYPE volumeCentroid(typename PFP::MAP& map, Vol d, const V_ATT& attributs, unsigned int thread) typename V_ATT::DATA_TYPE volumeCentroid(typename PFP::MAP& map, Vol d, const V_ATT& attributs)
{ {
typename V_ATT::DATA_TYPE center(0.0); typename V_ATT::DATA_TYPE center(0.0);
unsigned int count = 0 ; unsigned int count = 0 ;
...@@ -51,14 +51,14 @@ typename V_ATT::DATA_TYPE volumeCentroid(typename PFP::MAP& map, Vol d, const V_ ...@@ -51,14 +51,14 @@ typename V_ATT::DATA_TYPE volumeCentroid(typename PFP::MAP& map, Vol d, const V_
center += attributs[v]; center += attributs[v];
++count; ++count;
} }
,false,thread); ,false);
center /= double(count) ; center /= double(count) ;
return center ; return center ;
} }
template <typename PFP, typename V_ATT> template <typename PFP, typename V_ATT>
typename V_ATT::DATA_TYPE volumeCentroidELW(typename PFP::MAP& map, Vol d, const V_ATT& attributs, unsigned int thread) typename V_ATT::DATA_TYPE volumeCentroidELW(typename PFP::MAP& map, Vol d, const V_ATT& attributs)
{ {
typedef typename V_ATT::DATA_TYPE EMB; typedef typename V_ATT::DATA_TYPE EMB;
EMB center(0.0); EMB center(0.0);
...@@ -72,7 +72,7 @@ typename V_ATT::DATA_TYPE volumeCentroidELW(typename PFP::MAP& map, Vol d, const ...@@ -72,7 +72,7 @@ typename V_ATT::DATA_TYPE volumeCentroidELW(typename PFP::MAP& map, Vol d, const
double l = (e2-e1).norm(); double l = (e2-e1).norm();
center += (e1+e2)*l; center += (e1+e2)*l;
count += 2.0*l ; count += 2.0*l ;
},false,thread); },false);
center /= double(count); center /= double(count);
return center ; return center ;
} }
...@@ -129,9 +129,9 @@ typename V_ATT::DATA_TYPE vertexNeighborhoodCentroid(typename PFP::MAP& map, Ver ...@@ -129,9 +129,9 @@ typename V_ATT::DATA_TYPE vertexNeighborhoodCentroid(typename PFP::MAP& map, Ver
} }
template <typename PFP, typename V_ATT, typename F_ATT> 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 thread) void computeCentroidFaces(typename PFP::MAP& map, const V_ATT& position, F_ATT& face_centroid)
{ {
if ((CGoGN::Parallel::NumberOfThreads > 1) && (thread==0)) if (CGoGN::Parallel::NumberOfThreads > 1)
{ {
Parallel::computeCentroidFaces<PFP,V_ATT,F_ATT>(map,position,face_centroid); Parallel::computeCentroidFaces<PFP,V_ATT,F_ATT>(map,position,face_centroid);
return; return;
...@@ -141,13 +141,13 @@ void computeCentroidFaces(typename PFP::MAP& map, const V_ATT& position, F_ATT& ...@@ -141,13 +141,13 @@ void computeCentroidFaces(typename PFP::MAP& map, const V_ATT& position, F_ATT&
{ {
face_centroid[f] = faceCentroid<PFP,V_ATT>(map, f, position) ; face_centroid[f] = faceCentroid<PFP,V_ATT>(map, f, position) ;
} }
,AUTO,thread); ,AUTO);
} }
template <typename PFP, typename V_ATT, typename F_ATT> 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 thread) void computeCentroidELWFaces(typename PFP::MAP& map, const V_ATT& position, F_ATT& face_centroid)
{ {
if ((CGoGN::Parallel::NumberOfThreads > 1) && (thread==0)) if (CGoGN::Parallel::NumberOfThreads > 1)
{ {
Parallel::computeCentroidELWFaces<PFP,V_ATT,F_ATT>(map,position,face_centroid); Parallel::computeCentroidELWFaces<PFP,V_ATT,F_ATT>(map,position,face_centroid);
return; return;
...@@ -157,13 +157,13 @@ void computeCentroidELWFaces(typename PFP::MAP& map, const V_ATT& position, F_AT ...@@ -157,13 +157,13 @@ void computeCentroidELWFaces(typename PFP::MAP& map, const V_ATT& position, F_AT
{ {
face_centroid[f] = faceCentroidELW<PFP,V_ATT>(map, f, position) ; face_centroid[f] = faceCentroidELW<PFP,V_ATT>(map, f, position) ;
} }
,AUTO,thread); ,AUTO);
} }
template <typename PFP, typename V_ATT> template <typename PFP, typename V_ATT>
void computeNeighborhoodCentroidVertices(typename PFP::MAP& map, const V_ATT& position, V_ATT& vertex_centroid, unsigned int thread) void computeNeighborhoodCentroidVertices(typename PFP::MAP& map, const V_ATT& position, V_ATT& vertex_centroid)
{ {
if ((CGoGN::Parallel::NumberOfThreads > 1) && (thread == 0)) if (CGoGN::Parallel::NumberOfThreads > 1)
{ {
Parallel::computeNeighborhoodCentroidVertices<PFP,V_ATT>(map,position,vertex_centroid); Parallel::computeNeighborhoodCentroidVertices<PFP,V_ATT>(map,position,vertex_centroid);
return; return;
...@@ -172,7 +172,7 @@ void computeNeighborhoodCentroidVertices(typename PFP::MAP& map, const V_ATT& po ...@@ -172,7 +172,7 @@ void computeNeighborhoodCentroidVertices(typename PFP::MAP& map, const V_ATT& po
foreach_cell<VERTEX>(map, [&] (Vertex v) foreach_cell<VERTEX>(map, [&] (Vertex v)
{ {
vertex_centroid[v] = vertexNeighborhoodCentroid<PFP,V_ATT>(map, v, position) ; vertex_centroid[v] = vertexNeighborhoodCentroid<PFP,V_ATT>(map, v, position) ;
}, AUTO, thread); }, AUTO);
} }
...@@ -223,7 +223,7 @@ namespace Geometry ...@@ -223,7 +223,7 @@ namespace Geometry
{ {
template <typename PFP, typename V_ATT> template <typename PFP, typename V_ATT>
typename V_ATT::DATA_TYPE vertexNeighborhoodCentroid(typename PFP::MAP& map, Vertex v, const V_ATT& attributs, unsigned int thread) typename V_ATT::DATA_TYPE vertexNeighborhoodCentroid(typename PFP::MAP& map, Vertex v, const V_ATT& attributs)
{ {
typename V_ATT::DATA_TYPE center(0.0); typename V_ATT::DATA_TYPE center(0.0);
unsigned int count = 0 ; unsigned int count = 0 ;
...@@ -231,15 +231,15 @@ typename V_ATT::DATA_TYPE vertexNeighborhoodCentroid(typename PFP::MAP& map, Ver ...@@ -231,15 +231,15 @@ typename V_ATT::DATA_TYPE vertexNeighborhoodCentroid(typename PFP::MAP& map, Ver
{ {
center += attributs[it]; center += attributs[it];
++count ; ++count ;
}, false, thread); }, false);
center /= count ; center /= count ;
return center ; return center ;
} }
template <typename PFP, typename V_ATT, typename W_ATT> 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 thread) void computeCentroidVolumes(typename PFP::MAP& map, const V_ATT& position, W_ATT& vol_centroid)
{ {
if ((CGoGN::Parallel::NumberOfThreads > 1) && (thread == 0)) if (CGoGN::Parallel::NumberOfThreads > 1)
{ {
Parallel::computeCentroidVolumes<PFP,V_ATT,W_ATT>(map,position,vol_centroid); Parallel::computeCentroidVolumes<PFP,V_ATT,W_ATT>(map,position,vol_centroid);
return; return;
...@@ -247,14 +247,14 @@ void computeCentroidVolumes(typename PFP::MAP& map, const V_ATT& position, W_ATT ...@@ -247,14 +247,14 @@ void computeCentroidVolumes(typename PFP::MAP& map, const V_ATT& position, W_ATT
foreach_cell<VOLUME>(map, [&] (Vol v) foreach_cell<VOLUME>(map, [&] (Vol v)
{ {
vol_centroid[v] = Surface::Geometry::volumeCentroid<PFP,V_ATT>(map, v, position,thread) ; vol_centroid[v] = Surface::Geometry::volumeCentroid<PFP,V_ATT>(map, v, position) ;
}, AUTO, thread); }, AUTO);
} }
template <typename PFP, typename V_ATT, typename W_ATT> 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 thread) void computeCentroidELWVolumes(typename PFP::MAP& map, const V_ATT& position, W_ATT& vol_centroid)
{ {
if ((CGoGN::Parallel::NumberOfThreads > 1) && (thread == 0)) if (CGoGN::Parallel::NumberOfThreads > 1)
{ {
Parallel::computeCentroidELWVolumes<PFP,V_ATT,W_ATT>(map,position,vol_centroid); Parallel::computeCentroidELWVolumes<PFP,V_ATT,W_ATT>(map,position,vol_centroid);
return; return;
...@@ -262,14 +262,14 @@ void computeCentroidELWVolumes(typename PFP::MAP& map, const V_ATT& position, W_ ...@@ -262,14 +262,14 @@ void computeCentroidELWVolumes(typename PFP::MAP& map, const V_ATT& position, W_
foreach_cell<VOLUME>(map, [&] (Vol v) foreach_cell<VOLUME>(map, [&] (Vol v)
{ {
vol_centroid[v] = Surface::Geometry::volumeCentroidELW<PFP,V_ATT>(map, v, position,thread) ; vol_centroid[v] = Surface::Geometry::volumeCentroidELW<PFP,V_ATT>(map, v, position) ;
}, AUTO, thread); }, AUTO);
} }
template <typename PFP, typename V_ATT> template <typename PFP, typename V_ATT>
void computeNeighborhoodCentroidVertices(typename PFP::MAP& map, const V_ATT& position, V_ATT& vertex_centroid, unsigned int thread) void computeNeighborhoodCentroidVertices(typename PFP::MAP& map, const V_ATT& position, V_ATT& vertex_centroid)
{ {
if ((CGoGN::Parallel::NumberOfThreads > 1) && (thread == 0)) if (CGoGN::Parallel::NumberOfThreads > 1)
{ {
Parallel::computeNeighborhoodCentroidVertices<PFP,V_ATT>(map,position,vertex_centroid); Parallel::computeNeighborhoodCentroidVertices<PFP,V_ATT>(map,position,vertex_centroid);
return; return;
...@@ -278,7 +278,7 @@ void computeNeighborhoodCentroidVertices(typename PFP::MAP& map, const V_ATT& po ...@@ -278,7 +278,7 @@ void computeNeighborhoodCentroidVertices(typename PFP::MAP& map, const V_ATT& po
foreach_cell<VERTEX>(map, [&] (Vertex v) foreach_cell<VERTEX>(map, [&] (Vertex v)
{ {
vertex_centroid[v] = Volume::Geometry::vertexNeighborhoodCentroid<PFP,V_ATT>(map, v, position) ; vertex_centroid[v] = Volume::Geometry::vertexNeighborhoodCentroid<PFP,V_ATT>(map, v, position) ;
}, AUTO, thread); }, AUTO);
} }
...@@ -288,27 +288,27 @@ namespace Parallel ...@@ -288,27 +288,27 @@ namespace Parallel
template <typename PFP, typename V_ATT, typename W_ATT> template <typename PFP, typename V_ATT, typename W_ATT>
void computeCentroidVolumes(typename PFP::MAP& map, const V_ATT& position, W_ATT& vol_centroid) void computeCentroidVolumes(typename PFP::MAP& map, const V_ATT& position, W_ATT& vol_centroid)
{ {
CGoGN::Parallel::foreach_cell<VOLUME>(map, [&] (Vol v, unsigned int thr) CGoGN::Parallel::foreach_cell<VOLUME>(map, [&] (Vol v, unsigned int /*thr*/)
{ {
vol_centroid[v] = Surface::Geometry::volumeCentroid<PFP,V_ATT>(map, v, position, thr) ; vol_centroid[v] = Surface::Geometry::volumeCentroid<PFP,V_ATT>(map, v, position) ;
}); });
} }
template <typename PFP, typename V_ATT, typename W_ATT> template <typename PFP, typename V_ATT, typename W_ATT>
void computeCentroidELWVolumes(typename PFP::MAP& map, const V_ATT& position, W_ATT& vol_centroid) void computeCentroidELWVolumes(typename PFP::MAP& map, const V_ATT& position, W_ATT& vol_centroid)
{ {
CGoGN::Parallel::foreach_cell<VOLUME>(map, [&] (Vol v, unsigned int thr) CGoGN::Parallel::foreach_cell<VOLUME>(map, [&] (Vol v, unsigned int /*thr*/)
{ {
vol_centroid[v] = Surface::Geometry::volumeCentroidELW<PFP,V_ATT>(map, v, position, thr) ; vol_centroid[v] = Surface::Geometry::volumeCentroidELW<PFP,V_ATT>(map, v, position) ;
}); });
} }
template <typename PFP, typename V_ATT> template <typename PFP, typename V_ATT>
void computeNeighborhoodCentroidVertices(typename PFP::MAP& map, const V_ATT& position, V_ATT& vertex_centroid) void computeNeighborhoodCentroidVertices(typename PFP::MAP& map, const V_ATT& position, V_ATT& vertex_centroid)
{ {
CGoGN::Parallel::foreach_cell<VERTEX>(map, [&] (Vertex v, unsigned int thr) CGoGN::Parallel::foreach_cell<VERTEX>(map, [&] (Vertex v, unsigned int /*thr*/)
{ {
vertex_centroid[v] = Volume::Geometry::vertexNeighborhoodCentroid<PFP,V_ATT>(map, v, position,thr) ; vertex_centroid[v] = Volume::Geometry::vertexNeighborhoodCentroid<PFP,V_ATT>(map, v, position) ;
}, FORCE_CELL_MARKING); }, FORCE_CELL_MARKING);