diff --git a/include/Algo/Filtering/average_normals.h b/include/Algo/Filtering/average_normals.h index 77fdae904ac6b91483f00dd66e937ea8e30d0ba0..57a15a02bee55bf6683d4b6d9fa6dc7de8e0ebc4 100644 --- a/include/Algo/Filtering/average_normals.h +++ b/include/Algo/Filtering/average_normals.h @@ -23,7 +23,7 @@ *******************************************************************************/ #include "Topology/generic/traversor/traversorCell.h" -#include "Topology/generic/traversor2.h" +#include "Topology/generic/traversor/traversor2.h" namespace CGoGN { @@ -79,6 +79,7 @@ void computeNewPositionsFromFaceNormals( template void filterAverageNormals(typename PFP::MAP& map, const VertexAttribute& position, VertexAttribute& position2) { + typedef typename PFP::MAP MAP ; typedef typename PFP::VEC3 VEC3 ; typedef typename PFP::REAL REAL ; @@ -93,14 +94,14 @@ void filterAverageNormals(typename PFP::MAP& map, const VertexAttribute faceNewNormal(map, "faceNewNormal") ; // Compute new normals - TraversorF tf(map) ; + TraversorF tf(map) ; for(Dart d = tf.begin(); d != tf.end(); d = tf.next()) { REAL sumArea = 0 ; VEC3 meanFilter(0) ; // traversal of adjacent faces (by edges and vertices) - Traversor2FFaV taf(map, d) ; + Traversor2FFaV taf(map, d) ; for(Dart it = taf.begin(); it != taf.end(); it = taf.next()) { sumArea += faceArea[it] ; diff --git a/include/Algo/Selection/collector.h b/include/Algo/Selection/collector.h index 26fc6bb4492b6436ba054f92624fbaf289037182..547fab000a5f52c25687a3038ea4df4e540f91e2 100644 --- a/include/Algo/Selection/collector.h +++ b/include/Algo/Selection/collector.h @@ -89,10 +89,14 @@ public: virtual void collectAll(Dart d) = 0; virtual void collectBorder(Dart d) = 0; - bool applyOnInsideVertices(FunctorType& f); - bool applyOnInsideEdges(FunctorType& f); - bool applyOnInsideFaces(FunctorType& f); - bool applyOnBorder(FunctorType& f); + template + void applyOnInsideVertices(FUNC& f); + template + void applyOnInsideEdges(FUNC& f); + template + void applyOnInsideFaces(FUNC& f); + template + void applyOnBorder(FUNC& f); inline void sort() { diff --git a/include/Algo/Selection/collector.hpp b/include/Algo/Selection/collector.hpp index e19d1ccef09326e48618ceba078c266c59310874..364238a87b52addb3dec09f53c7f8beb61e6bb2c 100644 --- a/include/Algo/Selection/collector.hpp +++ b/include/Algo/Selection/collector.hpp @@ -47,42 +47,38 @@ Collector::Collector(MAP& m, unsigned int thread) : map(m), m_thread(thread {} template -inline bool Collector::applyOnInsideVertices(FunctorType& f) +template +inline void Collector::applyOnInsideVertices(FUNC& f) { assert(isInsideCollected || !"applyOnInsideVertices: inside cells have not been collected.") ; for(std::vector::iterator iv = insideVertices.begin(); iv != insideVertices.end(); ++iv) - if(f((*iv).dart)) - return true ; - return false ; + f((*iv).dart); } template -inline bool Collector::applyOnInsideEdges(FunctorType& f) +template +inline void Collector::applyOnInsideEdges(FUNC& f) { assert(isInsideCollected || !"applyOnInsideEdges: inside cells have not been collected.") ; for(std::vector::iterator iv = insideEdges.begin(); iv != insideEdges.end(); ++iv) - if(f((*iv).dart)) - return true ; - return false ; + f((*iv).dart); } template -inline bool Collector::applyOnInsideFaces(FunctorType& f) +template +inline void Collector::applyOnInsideFaces(FUNC& f) { assert(isInsideCollected || !"applyOnInsideFaces: inside cells have not been collected.") ; for(std::vector::iterator iv = insideFaces.begin(); iv != insideFaces.end(); ++iv) - if(f((*iv).dart)) - return true ; - return false ; + f((*iv).dart); } template -inline bool Collector::applyOnBorder(FunctorType& f) +template +inline void Collector::applyOnBorder(FUNC& f) { for(std::vector::iterator iv = border.begin(); iv != border.end(); ++iv) - if(f(*iv)) - return true ; - return false ; + f(*iv); } template