diff --git a/include/Algo/Filtering/average.h b/include/Algo/Filtering/average.h index 0d129d41a67aab4685cbec68d176ba5a84ffcbd3..50927b2e2a8f02cdb54947a82690e81e33d9bc23 100644 --- a/include/Algo/Filtering/average.h +++ b/include/Algo/Filtering/average.h @@ -49,7 +49,7 @@ void filterAverageAttribute_OneRing( const FunctorSelect& select = allDarts) { FunctorAverage fa(attIn) ; - Algo::Selection::Collector_OneRing col(map) ; + Algo::Surface::Selection::Collector_OneRing col(map) ; TraversorV t(map, select) ; for(Dart d = t.begin(); d != t.end(); d = t.next()) @@ -98,7 +98,7 @@ void filterAverageVertexAttribute_WithinSphere( { FunctorAverage faInside(attIn) ; FunctorAverageOnSphereBorder faBorder(map, attIn, position) ; - Algo::Selection::Collector_WithinSphere col(map, position, radius) ; + Algo::Surface::Selection::Collector_WithinSphere col(map, position, radius) ; TraversorV t(map, select) ; for(Dart d = t.begin(); d != t.end(); d = t.next()) @@ -139,7 +139,7 @@ void filterAverageEdgeAttribute_WithinSphere( const FunctorSelect& select = allDarts) { FunctorAverage fa(attIn) ; - Algo::Selection::Collector_WithinSphere col(map, position, radius) ; + Algo::Surface::Selection::Collector_WithinSphere col(map, position, radius) ; TraversorE t(map, select) ; for(Dart d = t.begin(); d != t.end(); d = t.next()) @@ -167,7 +167,7 @@ void filterAverageFaceAttribute_WithinSphere( const FunctorSelect& select = allDarts) { FunctorAverage fa(attIn) ; - Algo::Selection::Collector_WithinSphere col(map, position, radius) ; + Algo::Surface::Selection::Collector_WithinSphere col(map, position, radius) ; TraversorF t(map, select) ; for(Dart d = t.begin(); d != t.end(); d = t.next()) diff --git a/include/Algo/Filtering/average_normals.h b/include/Algo/Filtering/average_normals.h index 96cddcc439f43f1290fbc9a2f6d27af8a704c583..b35977bcd25a138f6e1bc4e66483f41bdc10e9e8 100644 --- a/include/Algo/Filtering/average_normals.h +++ b/include/Algo/Filtering/average_normals.h @@ -87,9 +87,9 @@ void filterAverageNormals(typename PFP::MAP& map, const VertexAttribute faceNormal(map, "faceNormal") ; FaceAutoAttribute faceCentroid(map, "faceCentroid") ; - Algo::Geometry::computeAreaFaces(map, position, faceArea, select) ; - Algo::Geometry::computeNormalFaces(map, position, faceNormal, select) ; - Algo::Geometry::computeCentroidFaces(map, position, faceCentroid, select) ; + Algo::Surface::Geometry::computeAreaFaces(map, position, faceArea, select) ; + Algo::Surface::Geometry::computeNormalFaces(map, position, faceNormal, select) ; + Algo::Surface::Geometry::computeCentroidFaces(map, position, faceCentroid, select) ; FaceAutoAttribute faceNewNormal(map, "faceNewNormal") ; @@ -131,9 +131,9 @@ void filterMMSE(typename PFP::MAP& map, float sigmaN2, const VertexAttribute faceNormal(map, "faceNormal") ; FaceAutoAttribute faceCentroid(map, "faceCentroid") ; - Algo::Geometry::computeAreaFaces(map, position, faceArea, select) ; - Algo::Geometry::computeNormalFaces(map, position, faceNormal, select) ; - Algo::Geometry::computeCentroidFaces(map, position, faceCentroid, select) ; + Algo::Surface::Geometry::computeAreaFaces(map, position, faceArea, select) ; + Algo::Surface::Geometry::computeNormalFaces(map, position, faceNormal, select) ; + Algo::Surface::Geometry::computeCentroidFaces(map, position, faceCentroid, select) ; FaceAutoAttribute faceNewNormal(map, "faceNewNormal") ; @@ -216,9 +216,9 @@ void filterTNBA(typename PFP::MAP& map, float sigmaN2, float SUSANthreshold, con FaceAutoAttribute faceNormal(map, "faceNormal") ; FaceAutoAttribute faceCentroid(map, "faceCentroid") ; - Algo::Geometry::computeAreaFaces(map, position, faceArea, select) ; - Algo::Geometry::computeNormalFaces(map, position, faceNormal, select) ; - Algo::Geometry::computeCentroidFaces(map, position, faceCentroid, select) ; + Algo::Surface::Geometry::computeAreaFaces(map, position, faceArea, select) ; + Algo::Surface::Geometry::computeNormalFaces(map, position, faceNormal, select) ; + Algo::Surface::Geometry::computeCentroidFaces(map, position, faceCentroid, select) ; FaceAutoAttribute faceNewNormal(map, "faceNewNormal") ; @@ -335,9 +335,9 @@ void filterVNBA(typename PFP::MAP& map, float sigmaN2, float SUSANthreshold, con FaceAutoAttribute faceNormal(map, "faceNormal") ; FaceAutoAttribute faceCentroid(map, "faceCentroid") ; - Algo::Geometry::computeAreaFaces(map, position, faceArea, select) ; - Algo::Geometry::computeNormalFaces(map, position, faceNormal, select) ; - Algo::Geometry::computeCentroidFaces(map, position, faceCentroid, select) ; + Algo::Surface::Geometry::computeAreaFaces(map, position, faceArea, select) ; + Algo::Surface::Geometry::computeNormalFaces(map, position, faceNormal, select) ; + Algo::Surface::Geometry::computeCentroidFaces(map, position, faceCentroid, select) ; VertexAutoAttribute vertexArea(map, "vertexArea") ; FaceAutoAttribute faceNewNormal(map, "faceNewNormal") ; @@ -369,7 +369,7 @@ void filterVNBA(typename PFP::MAP& map, float sigmaN2, float SUSANthreshold, con float angle = Geom::angle(normV, neighborNormal) ; if( angle <= SUSANthreshold ) { - REAL umbArea = Algo::Geometry::vertexOneRingArea(map, it, position) ; + REAL umbArea = Algo::Surface::Geometry::vertexOneRingArea(map, it, position) ; vertexArea[it] = umbArea ; sumArea += umbArea ; diff --git a/include/Algo/Filtering/bilateral.h b/include/Algo/Filtering/bilateral.h index f34865d531abf9b0af4a2a730775d2384cef0e99..eeef7c5f8ab4dd0d80aa9c3fba1c4697fbdaf89c 100644 --- a/include/Algo/Filtering/bilateral.h +++ b/include/Algo/Filtering/bilateral.h @@ -49,7 +49,7 @@ void sigmaBilateral(typename PFP::MAP& map, const VertexAttribute t(map, select) ; for(Dart d = t.begin(); d != t.end(); d = t.next()) { - sumLengths += Algo::Geometry::edgeLength(map, d, position) ; + sumLengths += Algo::Surface::Geometry::edgeLength(map, d, position) ; sumAngles += Geom::angle(normal[d], normal[map.phi1(d)]) ; ++nbEdges ; } @@ -80,7 +80,7 @@ void filterBilateral(typename PFP::MAP& map, const VertexAttribute te(map, d) ; for(Dart it = te.begin(); it != te.end(); it = te.next()) { - VEC3 vec = Algo::Geometry::vectorOutOfDart(map, it, position) ; + VEC3 vec = Algo::Surface::Geometry::vectorOutOfDart(map, it, position) ; float h = normal_d * vec ; float t = vec.norm() ; float wcs = exp( ( -1.0f * (t * t) / (2.0f * sigmaC * sigmaC) ) + ( -1.0f * (h * h) / (2.0f * sigmaS * sigmaS) ) ) ; @@ -125,7 +125,7 @@ void filterSUSAN(typename PFP::MAP& map, float SUSANthreshold, const VertexAttri float angle = Geom::angle(normal_d, neighborNormal) ; if( angle <= SUSANthreshold ) { - VEC3 vec = Algo::Geometry::vectorOutOfDart(map, it, position) ; + VEC3 vec = Algo::Surface::Geometry::vectorOutOfDart(map, it, position) ; float h = normal_d * vec ; float t = vec.norm() ; float wcs = exp( ( -1.0f * (t * t) / (2.0f * sigmaC * sigmaC) ) + ( -1.0f * (h * h) / (2.0f * sigmaS * sigmaS) ) ); diff --git a/include/Algo/Filtering/taubin.h b/include/Algo/Filtering/taubin.h index 1404f1b489c998f6730edf7cb7a30ea72bb4ff9b..7a3a16230b2474823cb29b9c9491c7f5b8620d4c 100644 --- a/include/Algo/Filtering/taubin.h +++ b/include/Algo/Filtering/taubin.h @@ -42,7 +42,7 @@ void filterTaubin(typename PFP::MAP& map, VertexAttribute& p { typedef typename PFP::VEC3 VEC3 ; - Algo::Selection::Collector_OneRing c(map) ; + Algo::Surface::Selection::Collector_OneRing c(map) ; const float lambda = 0.6307 ; const float mu = -0.6732 ; @@ -109,7 +109,7 @@ void filterTaubin_modified(typename PFP::MAP& map, VertexAttribute mv(map) ; FunctorAverageOnSphereBorder fa1(map, position, position) ; - Algo::Selection::Collector_WithinSphere c1(map, position, radius) ; + Algo::Surface::Selection::Collector_WithinSphere c1(map, position, radius) ; for(Dart d = map.begin(); d != map.end(); map.next(d)) { if(select(d) && !mv.isMarked(d)) @@ -133,7 +133,7 @@ void filterTaubin_modified(typename PFP::MAP& map, VertexAttribute fa2(map, position2, position2) ; - Algo::Selection::Collector_WithinSphere c2(map, position2, radius) ; + Algo::Surface::Selection::Collector_WithinSphere c2(map, position2, radius) ; for(Dart d = map.begin(); d != map.end(); map.next(d)) { if(select(d) && mv.isMarked(d)) diff --git a/include/Algo/Geometry/curvature.hpp b/include/Algo/Geometry/curvature.hpp index 2004e4ada93eab626601bdf4e0b6ebab73ffa677..608dbd974e9aed0af7408566d7bc890b9bd5dcfe 100644 --- a/include/Algo/Geometry/curvature.hpp +++ b/include/Algo/Geometry/curvature.hpp @@ -27,6 +27,15 @@ #include "Topology/generic/traversorCell.h" #include "Topology/generic/traversor2.h" +extern "C" +{ +#include "C_BLAS_LAPACK/INCLUDE/f2c.h" +#include "C_BLAS_LAPACK/INCLUDE/clapack.h" +} +#undef max +#undef min + + namespace CGoGN { diff --git a/include/Algo/Geometry/voronoiDiagrams.h b/include/Algo/Geometry/voronoiDiagrams.h index 20acbf706d315005fe2d6d7d97dbc15e6cd153ee..2deb033167b9b2383cd10f6fa62568113c05036a 100644 --- a/include/Algo/Geometry/voronoiDiagrams.h +++ b/include/Algo/Geometry/voronoiDiagrams.h @@ -14,6 +14,10 @@ namespace CGoGN namespace Algo { +namespace Surface +{ + + namespace Geometry { @@ -111,6 +115,7 @@ protected : }// end namespace Geometry +}// end namespace Surface }// end namespace Algo }// end namespace CGoGN diff --git a/include/Algo/Geometry/voronoiDiagrams.hpp b/include/Algo/Geometry/voronoiDiagrams.hpp index 189bbbd1ba8adf1ec1b1cb22f0e65106eef439d5..77904eb42d6aa804eca1bc2b67a923252be50c2e 100644 --- a/include/Algo/Geometry/voronoiDiagrams.hpp +++ b/include/Algo/Geometry/voronoiDiagrams.hpp @@ -4,6 +4,9 @@ namespace CGoGN namespace Algo { +namespace Surface +{ + namespace Geometry { @@ -543,5 +546,6 @@ unsigned int CentroidalVoronoiDiagram::moveSeed(unsigned int numSeed){ } */ }// end namespace Geometry +} // Surface }// end namespace Algo }// end namespace CGoGN diff --git a/include/Algo/Modelisation/subdivision.h b/include/Algo/Modelisation/subdivision.h index 6ce6fedda38466b67c64fcdef3bce10ab5b7dbfa..78300b2808d4dc0c071a61b4d67115e0824472df 100644 --- a/include/Algo/Modelisation/subdivision.h +++ b/include/Algo/Modelisation/subdivision.h @@ -117,20 +117,12 @@ void DooSabin(typename PFP::MAP& map, VertexAttribute& posit ///** // * Reverse the orientation of the map +// * NOW IN THE MAP // */ //template //void reverseOrientation(typename PFP::MAP& map) ; // ///** -// * Dual mesh computation -// */ -//template -//void computeDual(typename PFP::MAP& map, const FunctorSelect& selected = allDarts) ; -// -//template -//void computeDualV2(typename PFP::MAP& map, const FunctorSelect& selected = allDarts) ; -// -///** // * Sqrt(3) subdivision scheme // */ //template diff --git a/include/Algo/Modelisation/subdivision.hpp b/include/Algo/Modelisation/subdivision.hpp index 4d195d735f87b870a3fc3c7c0338b0d73646890d..b5577d79dada7c328698263a479cfc67aee6540a 100644 --- a/include/Algo/Modelisation/subdivision.hpp +++ b/include/Algo/Modelisation/subdivision.hpp @@ -628,114 +628,6 @@ void DooSabin(typename PFP::MAP& map, VertexAttribute& posit } } -//template -//void reverseOrientation(typename PFP::MAP& map) -//{ -// DartAttribute emb0(&map, map.template getEmbeddingAttributeVector()) ; -// if(emb0.isValid()) -// { -// DartAttribute new_emb0 = map.template addAttribute("new_EMB_0") ; -// for(Dart d = map.begin(); d != map.end(); map.next(d)) -// new_emb0[d] = emb0[map.phi1(d)] ; -// map.template swapAttributes(emb0, new_emb0) ; -// map.removeAttribute(new_emb0) ; -// } -// -// DartAttribute phi1 = map.template getAttribute("phi1") ; -// DartAttribute phi_1 = map.template getAttribute("phi_1") ; -// map.template swapAttributes(phi1, phi_1) ; -//} -// -//template -//void computeDual(typename PFP::MAP& map, const FunctorSelect& selected) -//{ -// DartAttribute phi1 = map.template getAttribute("phi1") ; -// DartAttribute phi_1 = map.template getAttribute("phi_1") ; -// DartAttribute new_phi1 = map.template addAttribute("new_phi1") ; -// DartAttribute new_phi_1 = map.template addAttribute("new_phi_1") ; -// -// for(Dart d = map.begin(); d != map.end(); map.next(d)) -// { -// Dart dd = map.phi1(map.phi2(d)); -// -// new_phi1[d] = dd ; -// new_phi_1[dd] = d ; -// } -// -// map.template swapAttributes(phi1, new_phi1) ; -// map.template swapAttributes(phi_1, new_phi_1) ; -// -// map.removeAttribute(new_phi1) ; -// map.removeAttribute(new_phi_1) ; -// -// map.swapEmbeddingContainers(VERTEX, FACE) ; -// -// reverseOrientation(map) ; -// -//// //boundary management -//// for(Dart d = map.begin(); d != map.end(); map.next(d)) -//// { -//// if(map.isBoundaryMarked(d)) -//// { -//// map.template boundaryMarkOrbit(map.deleteVertex(map.phi2(d))); //map.deleteCycle(); -//// } -//// } -//} -// -//template -//void computeDualV2(typename PFP::MAP& map, const FunctorSelect& selected) -//{ -// DartAttribute phi1 = map.template getAttribute("phi1") ; -// DartAttribute phi_1 = map.template getAttribute("phi_1") ; -// DartAttribute new_phi1 = map.template addAttribute("new_phi1") ; -// DartAttribute new_phi_1 = map.template addAttribute("new_phi_1") ; -// -// for(Dart d = map.begin(); d != map.end(); map.next(d)) -// { -// Dart dd = map.phi1(map.phi2(d)); -// -// new_phi1[d] = dd ; -// new_phi_1[dd] = d ; -// } -// -// map.template swapAttributes(phi1, new_phi1) ; -// map.template swapAttributes(phi_1, new_phi_1) ; -// -// map.removeAttribute(new_phi1) ; -// map.removeAttribute(new_phi_1) ; -// -// //boundary management -// for(Dart d = map.begin(); d != map.end(); map.next(d)) -// { -// if(map.isBoundaryMarked(d)) -// { -// Dart d1 = map.phi1(d); -// Dart dd = map.phi_1(map.phi2(d)); -// -// //marquer le brin d1 et le bin dd -// -// phi1[dd] = d1 ; -// phi_1[d1] = dd ; -// -// phi1[d] = map.phi2(d); -// phi_1[map.phi2(d)] = d; -// } -// } -// -// map.swapEmbeddingContainers(VERTEX, FACE) ; -// -// reverseOrientation(map) ; -// -// for(Dart d = map.begin(); d != map.end(); map.next(d)) -// { -// if(map.isBoundaryMarked(d)) -// { -// map.deleteCycle(map.phi2(d)); -// } -// } -// -// //transformer le marker des brins d1 et dd en boundaryMarker -//} inline double sqrt3_K(unsigned int n)