From 05a091e40796cf57b38a079f5dada6d95cf425db Mon Sep 17 00:00:00 2001 From: Pierre Kraemer Date: Thu, 12 Jun 2014 11:26:18 +0200 Subject: [PATCH] remove some warnings --- include/Algo/Geometry/area.hpp | 13 +++--- include/Algo/Geometry/centroid.hpp | 42 ++++++++----------- include/Algo/Geometry/curvature.hpp | 14 +++---- include/Algo/Geometry/normal.hpp | 32 ++++++-------- include/Algo/Geometry/volume.hpp | 11 +++-- .../Algo/ImplicitHierarchicalMesh/ihm3.hpp | 4 +- .../Topology/generic/traversor/traversor3.h | 2 +- 7 files changed, 51 insertions(+), 67 deletions(-) diff --git a/include/Algo/Geometry/area.hpp b/include/Algo/Geometry/area.hpp index eae934b8..f68fcf07 100644 --- a/include/Algo/Geometry/area.hpp +++ b/include/Algo/Geometry/area.hpp @@ -233,7 +233,7 @@ void computeAreaFaces(typename PFP::MAP& map, const VertexAttribute(map,[&](Face f, unsigned int thr) + CGoGN::Parallel::foreach_cell(map, [&] (Face f, unsigned int /*thr*/) { area[f] = convexFaceArea(map, f, position) ; }); @@ -243,10 +243,10 @@ void computeAreaFaces(typename PFP::MAP& map, const VertexAttribute void computeOneRingAreaVertices(typename PFP::MAP& map, const VertexAttribute& position, VertexAttribute& area) { - CGoGN::Parallel::foreach_cell(map,[&](Vertex v, unsigned int thr) + CGoGN::Parallel::foreach_cell(map, [&] (Vertex v, unsigned int /*thr*/) { area[v] = vertexOneRingArea(map, v, position) ; - },FORCE_CELL_MARKING); + }, FORCE_CELL_MARKING); } template @@ -255,17 +255,16 @@ void computeBarycentricAreaVertices(typename PFP::MAP& map, const VertexAttribut CGoGN::Parallel::foreach_cell(map, [&] (Vertex v, unsigned int thr) { vertex_area[v] = vertexBarycentricArea(map, v, position) ; - } - ,FORCE_CELL_MARKING); + }, FORCE_CELL_MARKING); } template void computeVoronoiAreaVertices(typename PFP::MAP& map, const VertexAttribute& position, VertexAttribute& area) { - CGoGN::Parallel::foreach_cell(map,[&](Vertex v, unsigned int thr) + CGoGN::Parallel::foreach_cell(map, [&] (Vertex v, unsigned int /*thr*/) { area[v] = vertexVoronoiArea(map, v, position) ; - },FORCE_CELL_MARKING); + }, FORCE_CELL_MARKING); } } // namespace Parallel diff --git a/include/Algo/Geometry/centroid.hpp b/include/Algo/Geometry/centroid.hpp index e0793195..8d133ccb 100644 --- a/include/Algo/Geometry/centroid.hpp +++ b/include/Algo/Geometry/centroid.hpp @@ -164,7 +164,7 @@ void computeCentroidELWFaces(typename PFP::MAP& map, const V_ATT& position, F_AT template void computeNeighborhoodCentroidVertices(typename PFP::MAP& map, const V_ATT& position, V_ATT& vertex_centroid, unsigned int thread) { - if ((CGoGN::Parallel::NumberOfThreads > 1) && (thread==0)) + if ((CGoGN::Parallel::NumberOfThreads > 1) && (thread == 0)) { Parallel::computeNeighborhoodCentroidVertices(map,position,vertex_centroid); return; @@ -173,8 +173,7 @@ void computeNeighborhoodCentroidVertices(typename PFP::MAP& map, const V_ATT& po foreach_cell(map, [&] (Vertex v) { vertex_centroid[v] = vertexNeighborhoodCentroid(map, v, position) ; - } - ,AUTO,thread); + }, AUTO, thread); } @@ -184,7 +183,7 @@ namespace Parallel template void computeCentroidFaces(typename PFP::MAP& map, const V_ATT& position, F_ATT& face_centroid) { - CGoGN::Parallel::foreach_cell(map,[&](Face f, unsigned int thr) + CGoGN::Parallel::foreach_cell(map,[&](Face f, unsigned int /*thr*/) { face_centroid[f] = faceCentroid(map, f, position) ; }); @@ -193,7 +192,7 @@ void computeCentroidFaces(typename PFP::MAP& map, const V_ATT& position, F_ATT& template void computeCentroidELWFaces(typename PFP::MAP& map, const V_ATT& position, F_ATT& face_centroid) { - CGoGN::Parallel::foreach_cell(map,[&](Face f, unsigned int thr) + CGoGN::Parallel::foreach_cell(map,[&](Face f, unsigned int /*thr*/) { face_centroid[f] = faceCentroidELW(map, f, position) ; }); @@ -204,10 +203,10 @@ template void computeNeighborhoodCentroidVertices(typename PFP::MAP& map, const V_ATT& position, V_ATT& vertex_centroid) { - CGoGN::Parallel::foreach_cell(map,[&](Vertex v, unsigned int thr) + CGoGN::Parallel::foreach_cell(map,[&](Vertex v, unsigned int /*thr*/) { vertex_centroid[v] = vertexNeighborhoodCentroid(map, v, position) ; - },FORCE_CELL_MARKING); + }, FORCE_CELL_MARKING); } } // namespace Parallel @@ -229,12 +228,11 @@ typename V_ATT::DATA_TYPE vertexNeighborhoodCentroid(typename PFP::MAP& map, Ver { typename V_ATT::DATA_TYPE center(0.0); unsigned int count = 0 ; - foreach_adjacent3(map, v, [&](Vertex it) + foreach_adjacent3(map, v, [&] (Vertex it) { center += attributs[it]; ++count ; - } - ,false,thread); + }, false, thread); center /= count ; return center ; } @@ -242,7 +240,7 @@ typename V_ATT::DATA_TYPE vertexNeighborhoodCentroid(typename PFP::MAP& map, Ver template void computeCentroidVolumes(typename PFP::MAP& map, const V_ATT& position, W_ATT& vol_centroid, unsigned int thread) { - if ((CGoGN::Parallel::NumberOfThreads > 1) && (thread==0)) + if ((CGoGN::Parallel::NumberOfThreads > 1) && (thread == 0)) { Parallel::computeCentroidVolumes(map,position,vol_centroid); return; @@ -251,14 +249,13 @@ void computeCentroidVolumes(typename PFP::MAP& map, const V_ATT& position, W_ATT foreach_cell(map, [&] (Vol v) { vol_centroid[v] = Surface::Geometry::volumeCentroid(map, v, position,thread) ; - } - ,AUTO,thread); + }, AUTO, thread); } template void computeCentroidELWVolumes(typename PFP::MAP& map, const V_ATT& position, W_ATT& vol_centroid, unsigned int thread) { - if ((CGoGN::Parallel::NumberOfThreads > 1) && (thread==0)) + if ((CGoGN::Parallel::NumberOfThreads > 1) && (thread == 0)) { Parallel::computeCentroidELWVolumes(map,position,vol_centroid); return; @@ -267,14 +264,13 @@ void computeCentroidELWVolumes(typename PFP::MAP& map, const V_ATT& position, W_ foreach_cell(map, [&] (Vol v) { vol_centroid[v] = Surface::Geometry::volumeCentroidELW(map, v, position,thread) ; - } - ,AUTO,thread); + }, AUTO, thread); } template void computeNeighborhoodCentroidVertices(typename PFP::MAP& map, const V_ATT& position, V_ATT& vertex_centroid, unsigned int thread) { - if ((CGoGN::Parallel::NumberOfThreads > 1) && (thread==0)) + if ((CGoGN::Parallel::NumberOfThreads > 1) && (thread == 0)) { Parallel::computeNeighborhoodCentroidVertices(map,position,vertex_centroid); return; @@ -283,8 +279,7 @@ void computeNeighborhoodCentroidVertices(typename PFP::MAP& map, const V_ATT& po foreach_cell(map, [&] (Vertex v) { vertex_centroid[v] = Volume::Geometry::vertexNeighborhoodCentroid(map, v, position) ; - } - ,AUTO,thread); + }, AUTO, thread); } @@ -294,7 +289,7 @@ namespace Parallel template void computeCentroidVolumes(typename PFP::MAP& map, const V_ATT& position, W_ATT& vol_centroid) { - CGoGN::Parallel::foreach_cell(map,[&](Vol v, unsigned int thr) + CGoGN::Parallel::foreach_cell(map, [&] (Vol v, unsigned int thr) { vol_centroid[v] = Surface::Geometry::volumeCentroid(map, v, position, thr) ; }); @@ -303,20 +298,19 @@ void computeCentroidVolumes(typename PFP::MAP& map, const V_ATT& position, W_ATT template void computeCentroidELWVolumes(typename PFP::MAP& map, const V_ATT& position, W_ATT& vol_centroid) { - CGoGN::Parallel::foreach_cell(map,[&](Vol v, unsigned int thr) + CGoGN::Parallel::foreach_cell(map, [&] (Vol v, unsigned int thr) { vol_centroid[v] = Surface::Geometry::volumeCentroidELW(map, v, position, thr) ; }); } - template void computeNeighborhoodCentroidVertices(typename PFP::MAP& map, const V_ATT& position, V_ATT& vertex_centroid) { - CGoGN::Parallel::foreach_cell(map,[&](Vertex v, unsigned int thr) + CGoGN::Parallel::foreach_cell(map, [&] (Vertex v, unsigned int thr) { vertex_centroid[v] = Volume::Geometry::vertexNeighborhoodCentroid(map, v, position,thr) ; - },true,FORCE_CELL_MARKING); + }, FORCE_CELL_MARKING); } } // namespace Parallel diff --git a/include/Algo/Geometry/curvature.hpp b/include/Algo/Geometry/curvature.hpp index 0ba92677..e51b341c 100644 --- a/include/Algo/Geometry/curvature.hpp +++ b/include/Algo/Geometry/curvature.hpp @@ -664,10 +664,10 @@ void computeCurvatureVertices_NormalCycles( if (!map.template isOrbitEmbedded()) Algo::Topo::initAllOrbitsEmbedding(map); - CGoGN::Parallel::foreach_cell(map,[&](Vertex v, unsigned int threadID) + CGoGN::Parallel::foreach_cell(map, [&] (Vertex v, unsigned int threadID) { computeCurvatureVertex_NormalCycles(map, v, radius, position, normal, edgeangle, kmax, kmin, Kmax, Kmin, Knormal, threadID) ; - },FORCE_CELL_MARKING); + }, FORCE_CELL_MARKING); } template @@ -693,14 +693,12 @@ void computeCurvatureVertices_NormalCycles_Projected( if (!map.template isOrbitEmbedded()) Algo::Topo::initAllOrbitsEmbedding(map); - CGoGN::Parallel::foreach_cell(map,[&](Vertex v, unsigned int threadID) + CGoGN::Parallel::foreach_cell(map, [&] (Vertex v, unsigned int threadID) { computeCurvatureVertex_NormalCycles_Projected(map, v, radius, position, normal, edgeangle, kmax, kmin, Kmax, Kmin, Knormal, threadID) ; - },FORCE_CELL_MARKING); + }, FORCE_CELL_MARKING); } - - template void computeCurvatureVertices_QuadraticFitting( typename PFP::MAP& map, @@ -711,10 +709,10 @@ void computeCurvatureVertices_QuadraticFitting( VertexAttribute& Kmax, VertexAttribute& Kmin) { - CGoGN::Parallel::foreach_cell(map,[&](Vertex v, unsigned int threadID) + CGoGN::Parallel::foreach_cell(map, [&] (Vertex v, unsigned int threadID) { computeCurvatureVertex_QuadraticFitting(map, v, position, normal, kmax, kmin, Kmax, Kmin, threadID) ; - },FORCE_CELL_MARKING); + }, FORCE_CELL_MARKING); } diff --git a/include/Algo/Geometry/normal.hpp b/include/Algo/Geometry/normal.hpp index 86c42d88..0383ab47 100644 --- a/include/Algo/Geometry/normal.hpp +++ b/include/Algo/Geometry/normal.hpp @@ -145,36 +145,33 @@ typename V_ATT::DATA_TYPE vertexBorderNormal(typename PFP::MAP& map, Vertex v, c template void computeNormalFaces(typename PFP::MAP& map, const V_ATT& position, F_ATT& face_normal, unsigned int thread) { - if ((CGoGN::Parallel::NumberOfThreads > 1) && (thread==0)) + if ((CGoGN::Parallel::NumberOfThreads > 1) && (thread == 0)) { - Parallel::computeNormalFaces(map,position,face_normal); + Parallel::computeNormalFaces(map, position, face_normal); return; } foreach_cell(map, [&] (Face f) { face_normal[f] = faceNormal(map, f, position) ; - }, - AUTO, thread); + }, AUTO, thread); } template void computeNormalVertices(typename PFP::MAP& map, const V_ATT& position, V_ATT& normal, unsigned int thread) { - if ((CGoGN::Parallel::NumberOfThreads > 1) && (thread==0)) + if ((CGoGN::Parallel::NumberOfThreads > 1) && (thread == 0)) { - Parallel::computeNormalVertices(map,position,normal); + Parallel::computeNormalVertices(map, position, normal); return; } foreach_cell(map, [&] (Vertex v) { normal[v] = vertexNormal(map, v, position) ; - }, - FORCE_CELL_MARKING, thread); + }, FORCE_CELL_MARKING, thread); } - template typename PFP::REAL computeAngleBetweenNormalsOnEdge(typename PFP::MAP& map, Edge e, const V_ATT& position) { @@ -211,47 +208,44 @@ typename PFP::REAL computeAngleBetweenNormalsOnEdge(typename PFP::MAP& map, Edge template void computeAnglesBetweenNormalsOnEdges(typename PFP::MAP& map, const V_ATT& position, E_ATT& angles, unsigned int thread) { - if ((CGoGN::Parallel::NumberOfThreads > 1) && (thread==0)) + if ((CGoGN::Parallel::NumberOfThreads > 1) && (thread == 0)) { - Parallel::computeAnglesBetweenNormalsOnEdges(map,position,angles); + Parallel::computeAnglesBetweenNormalsOnEdges(map, position, angles); return; } foreach_cell(map, [&] (Edge e) { angles[e] = computeAngleBetweenNormalsOnEdge(map, e, position) ; - }, - AUTO, thread); + }, AUTO, thread); } - namespace Parallel { template void computeNormalVertices(typename PFP::MAP& map, const V_ATT& position, V_ATT& normal) { - CGoGN::Parallel::foreach_cell(map,[&](Vertex v, unsigned int /*thr*/) + CGoGN::Parallel::foreach_cell(map, [&] (Vertex v, unsigned int /*thr*/) { normal[v] = vertexNormal(map, v, position) ; - },FORCE_CELL_MARKING); + }, FORCE_CELL_MARKING); } template void computeNormalFaces(typename PFP::MAP& map, const V_ATT& position, F_ATT& normal) { - CGoGN::Parallel::foreach_cell(map,[&](Face f, unsigned int thr) + CGoGN::Parallel::foreach_cell(map, [&] (Face f, unsigned int /*thr*/) { normal[f] = faceNormal(map, f, position) ; }); } - template void computeAnglesBetweenNormalsOnEdges(typename PFP::MAP& map, const V_ATT& position, E_ATT& angles) { - CGoGN::Parallel::foreach_cell(map,[&](Edge e, unsigned int thr) + CGoGN::Parallel::foreach_cell(map,[&](Edge e, unsigned int /*thr*/) { angles[e] = computeAngleBetweenNormalsOnEdge(map, e, position) ; }); diff --git a/include/Algo/Geometry/volume.hpp b/include/Algo/Geometry/volume.hpp index 4a90bf26..35321953 100644 --- a/include/Algo/Geometry/volume.hpp +++ b/include/Algo/Geometry/volume.hpp @@ -126,17 +126,16 @@ typename PFP::REAL convexPolyhedronVolume(typename PFP::MAP& map, Vol v, const V template typename PFP::REAL totalVolume(typename PFP::MAP& map, const VertexAttribute& position, unsigned int thread) { - if ((CGoGN::Parallel::NumberOfThreads > 1) && (thread==0)) + if ((CGoGN::Parallel::NumberOfThreads > 1) && (thread == 0)) { - return Parallel::totalVolume(map,position); + return Parallel::totalVolume(map, position); } - double vol = 0.0 ; TraversorW t(map, thread) ; for(Dart d = t.begin(); d != t.end(); d = t.next()) - vol += convexPolyhedronVolume(map, d, position,thread) ; + vol += convexPolyhedronVolume(map, d, position, thread) ; return typename PFP::REAL(vol) ; } @@ -148,10 +147,10 @@ template typename PFP::REAL totalVolume(typename PFP::MAP& map, const VertexAttribute& position) { // allocate a vector of 1 accumulator for each thread - std::vector vols(CGoGN::Parallel::NumberOfThreads-1,0.0); + std::vector vols(CGoGN::Parallel::NumberOfThreads-1, 0.0); // foreach volume - CGoGN::Parallel::foreach_cell(map,[&](Vol v, unsigned int thr) + CGoGN::Parallel::foreach_cell(map, [&] (Vol v, unsigned int thr) { // add volume to the thread accumulator vols[thr-1] += convexPolyhedronVolume(map, v, position, thr) ; diff --git a/include/Algo/ImplicitHierarchicalMesh/ihm3.hpp b/include/Algo/ImplicitHierarchicalMesh/ihm3.hpp index 3f2c6ce1..8b42df1d 100644 --- a/include/Algo/ImplicitHierarchicalMesh/ihm3.hpp +++ b/include/Algo/ImplicitHierarchicalMesh/ihm3.hpp @@ -361,13 +361,13 @@ inline void ImplicitHierarchicalMap3::foreach_dart_of_volume(Dart d, FUNC& f, un } template -inline void ImplicitHierarchicalMap3::foreach_dart_of_vertex1(Dart d, FUNC& f, unsigned int thread) const +inline void ImplicitHierarchicalMap3::foreach_dart_of_vertex1(Dart d, FUNC& f, unsigned int /*thread*/) const { f(d); } template -inline void ImplicitHierarchicalMap3::foreach_dart_of_edge1(Dart d, FUNC& f, unsigned int thread) const +inline void ImplicitHierarchicalMap3::foreach_dart_of_edge1(Dart d, FUNC& f, unsigned int /*thread*/) const { f(d); } diff --git a/include/Topology/generic/traversor/traversor3.h b/include/Topology/generic/traversor/traversor3.h index 53049df0..a9afa3b9 100644 --- a/include/Topology/generic/traversor/traversor3.h +++ b/include/Topology/generic/traversor/traversor3.h @@ -361,7 +361,7 @@ inline void foreach_incident3(MAP& map, Cell c, FUNC f, bool forceDa template -inline void foreach_adjacent3( MAP& map, Cell c, FUNC f, bool forceDartMarker = false, unsigned int thread = 0) +inline void foreach_adjacent3(MAP& map, Cell c, FUNC f, bool forceDartMarker = false, unsigned int thread = 0) { Traversor3XXaY trav(const_cast(map),c,forceDartMarker,thread); for (Cell c = trav.begin(), e = trav.end(); c.dart != e.dart; c = trav.next()) -- GitLab