diff --git a/include/Algo/Filtering/average.h b/include/Algo/Filtering/average.h index b047e2972e0cba7e2cfb353bb20a5de768125e36..18baf3036e494ef4dfd5e6e6803174b302ae1852 100644 --- a/include/Algo/Filtering/average.h +++ b/include/Algo/Filtering/average.h @@ -40,12 +40,12 @@ enum neighborhood { INSIDE = 1, BORDER = 2 }; template void filterAverageAttribute_OneRing( typename PFP::MAP& map, - const AttributeHandler& attIn, - AttributeHandler& attOut, + const AttributeHandler& attIn, + AttributeHandler& attOut, int neigh, const FunctorSelect& select = allDarts) { - FunctorAverage fa(attIn) ; + FunctorAverage fa(attIn) ; Algo::Selection::Collector_OneRing col(map) ; TraversorV t(map, select) ; @@ -86,14 +86,14 @@ void filterAverageAttribute_OneRing( template void filterAverageVertexAttribute_WithinSphere( typename PFP::MAP& map, - const AttributeHandler& attIn, - AttributeHandler& attOut, + const AttributeHandler& attIn, + AttributeHandler& attOut, int neigh, - typename PFP::TVEC3 & position, + AttributeHandler& position, typename PFP::REAL radius, const FunctorSelect& select = allDarts) { - FunctorAverage faInside(attIn) ; + FunctorAverage faInside(attIn) ; FunctorAverageOnSphereBorder faBorder(map, attIn, position) ; Algo::Selection::Collector_WithinSphere col(map, position, radius) ; @@ -128,14 +128,14 @@ void filterAverageVertexAttribute_WithinSphere( template void filterAverageEdgeAttribute_WithinSphere( typename PFP::MAP& map, - const AttributeHandler& attIn, - AttributeHandler& attOut, + const AttributeHandler& attIn, + AttributeHandler& attOut, int neigh, - typename PFP::TVEC3 & position, + AttributeHandler& position, typename PFP::REAL radius, const FunctorSelect& select = allDarts) { - FunctorAverage fa(attIn) ; + FunctorAverage fa(attIn) ; Algo::Selection::Collector_WithinSphere col(map, position, radius) ; TraversorE t(map, select) ; @@ -156,14 +156,14 @@ void filterAverageEdgeAttribute_WithinSphere( template void filterAverageFaceAttribute_WithinSphere( typename PFP::MAP& map, - const AttributeHandler& attIn, - AttributeHandler& attOut, + const AttributeHandler& attIn, + AttributeHandler& attOut, int neigh, - typename PFP::TVEC3 & position, + AttributeHandler& position, typename PFP::REAL radius, const FunctorSelect& select = allDarts) { - FunctorAverage fa(attIn) ; + FunctorAverage fa(attIn) ; Algo::Selection::Collector_WithinSphere col(map, position, radius) ; TraversorF t(map, select) ; diff --git a/include/Algo/Filtering/average_normals.h b/include/Algo/Filtering/average_normals.h index e84f4888e79f152946919b64b5dd3348c829475f..0fac9feca11678ccb68cc5a3dde7026411420019 100644 --- a/include/Algo/Filtering/average_normals.h +++ b/include/Algo/Filtering/average_normals.h @@ -41,12 +41,12 @@ namespace Filtering template void computeNewPositionsFromFaceNormals( typename PFP::MAP& map, - const typename PFP::TVEC3& position, - typename PFP::TVEC3& position2, - const typename PFP::TREAL& faceArea, - const typename PFP::TVEC3& faceCentroid, - const typename PFP::TVEC3& faceNormal, - const typename PFP::TVEC3& faceNewNormal, + const AttributeHandler& position, + AttributeHandler& position2, + const AttributeHandler& faceArea, + const AttributeHandler& faceCentroid, + const AttributeHandler& faceNormal, + const AttributeHandler& faceNewNormal, const FunctorSelect& select) { typedef typename PFP::VEC3 VEC3 ; @@ -75,20 +75,20 @@ void computeNewPositionsFromFaceNormals( } template -void filterAverageNormals(typename PFP::MAP& map, const typename PFP::TVEC3& position, typename PFP::TVEC3& position2, const FunctorSelect& select = allDarts) +void filterAverageNormals(typename PFP::MAP& map, const AttributeHandler& position, AttributeHandler& position2, const FunctorSelect& select = allDarts) { typedef typename PFP::VEC3 VEC3 ; typedef typename PFP::REAL REAL ; - AutoAttributeHandler faceArea(map, FACE, "faceArea") ; - AutoAttributeHandler faceNormal(map, FACE, "faceNormal") ; - AutoAttributeHandler faceCentroid(map, FACE, "faceCentroid") ; + AutoAttributeHandler faceArea(map, "faceArea") ; + AutoAttributeHandler faceNormal(map, "faceNormal") ; + AutoAttributeHandler faceCentroid(map, "faceCentroid") ; Algo::Geometry::computeAreaFaces(map, position, faceArea, select) ; Algo::Geometry::computeNormalFaces(map, position, faceNormal, select) ; Algo::Geometry::computeCentroidFaces(map, position, faceCentroid, select) ; - AutoAttributeHandler faceNewNormal(map, FACE, "faceNewNormal") ; + AutoAttributeHandler faceNewNormal(map, "faceNewNormal") ; // Compute new normals TraversorF tf(map, select) ; @@ -119,20 +119,20 @@ void filterAverageNormals(typename PFP::MAP& map, const typename PFP::TVEC3& pos } template -void filterMMSE(typename PFP::MAP& map, float sigmaN2, const typename PFP::TVEC3& position, typename PFP::TVEC3& position2, const FunctorSelect& select = allDarts) +void filterMMSE(typename PFP::MAP& map, float sigmaN2, const AttributeHandler& position, AttributeHandler& position2, const FunctorSelect& select = allDarts) { typedef typename PFP::VEC3 VEC3 ; typedef typename PFP::REAL REAL ; - AutoAttributeHandler faceArea(map, FACE, "faceArea") ; - AutoAttributeHandler faceNormal(map, FACE, "faceNormal") ; - AutoAttributeHandler faceCentroid(map, FACE, "faceCentroid") ; + AutoAttributeHandler faceArea(map, "faceArea") ; + AutoAttributeHandler faceNormal(map, "faceNormal") ; + AutoAttributeHandler faceCentroid(map, "faceCentroid") ; Algo::Geometry::computeAreaFaces(map, position, faceArea, select) ; Algo::Geometry::computeNormalFaces(map, position, faceNormal, select) ; Algo::Geometry::computeCentroidFaces(map, position, faceCentroid, select) ; - AutoAttributeHandler faceNewNormal(map, FACE, "faceNewNormal") ; + AutoAttributeHandler faceNewNormal(map, "faceNewNormal") ; // Compute new normals TraversorF tf(map, select) ; @@ -204,20 +204,20 @@ void filterMMSE(typename PFP::MAP& map, float sigmaN2, const typename PFP::TVEC3 } template -void filterTNBA(typename PFP::MAP& map, float sigmaN2, float SUSANthreshold, const typename PFP::TVEC3& position, typename PFP::TVEC3& position2, const FunctorSelect& select = allDarts) +void filterTNBA(typename PFP::MAP& map, float sigmaN2, float SUSANthreshold, const AttributeHandler& position, AttributeHandler& position2, const FunctorSelect& select = allDarts) { typedef typename PFP::VEC3 VEC3 ; typedef typename PFP::REAL REAL ; - AutoAttributeHandler faceArea(map, FACE, "faceArea") ; - AutoAttributeHandler faceNormal(map, FACE, "faceNormal") ; - AutoAttributeHandler faceCentroid(map, FACE, "faceCentroid") ; + AutoAttributeHandler faceArea(map, "faceArea") ; + AutoAttributeHandler faceNormal(map, "faceNormal") ; + AutoAttributeHandler faceCentroid(map, "faceCentroid") ; Algo::Geometry::computeAreaFaces(map, position, faceArea, select) ; Algo::Geometry::computeNormalFaces(map, position, faceNormal, select) ; Algo::Geometry::computeCentroidFaces(map, position, faceCentroid, select) ; - AutoAttributeHandler faceNewNormal(map, FACE, "faceNewNormal") ; + AutoAttributeHandler faceNewNormal(map, "faceNewNormal") ; // Compute new normals long nbTot = 0 ; @@ -323,22 +323,22 @@ void filterTNBA(typename PFP::MAP& map, float sigmaN2, float SUSANthreshold, con } template -void filterVNBA(typename PFP::MAP& map, float sigmaN2, float SUSANthreshold, const typename PFP::TVEC3& position, typename PFP::TVEC3& position2, const typename PFP::TVEC3& normal, const FunctorSelect& select = allDarts) +void filterVNBA(typename PFP::MAP& map, float sigmaN2, float SUSANthreshold, const AttributeHandler& position, AttributeHandler& position2, const AttributeHandler& normal, const FunctorSelect& select = allDarts) { typedef typename PFP::VEC3 VEC3 ; typedef typename PFP::REAL REAL ; - AutoAttributeHandler faceArea(map, FACE, "faceArea") ; - AutoAttributeHandler faceNormal(map, FACE, "faceNormal") ; - AutoAttributeHandler faceCentroid(map, FACE, "faceCentroid") ; + AutoAttributeHandler faceArea(map, "faceArea") ; + AutoAttributeHandler faceNormal(map, "faceNormal") ; + AutoAttributeHandler faceCentroid(map, "faceCentroid") ; Algo::Geometry::computeAreaFaces(map, position, faceArea, select) ; Algo::Geometry::computeNormalFaces(map, position, faceNormal, select) ; Algo::Geometry::computeCentroidFaces(map, position, faceCentroid, select) ; - AutoAttributeHandler vertexArea(map, VERTEX, "vertexArea") ; - AutoAttributeHandler faceNewNormal(map, FACE, "faceNewNormal") ; - AutoAttributeHandler vertexNewNormal(map, VERTEX, "vertexNewNormal") ; + AutoAttributeHandler vertexArea(map, "vertexArea") ; + AutoAttributeHandler faceNewNormal(map, "faceNewNormal") ; + AutoAttributeHandler vertexNewNormal(map, "vertexNewNormal") ; long nbTot = 0 ; long nbAdapt = 0 ; diff --git a/include/Algo/Filtering/bilateral.h b/include/Algo/Filtering/bilateral.h index 30b9fb4ca6768326014eafa88961c602f4ea3476..441e354e171cb969d5c7a47227ea910e5a55435f 100644 --- a/include/Algo/Filtering/bilateral.h +++ b/include/Algo/Filtering/bilateral.h @@ -35,7 +35,7 @@ namespace Filtering { template -void sigmaBilateral(typename PFP::MAP& map, const typename PFP::TVEC3& position, const typename PFP::TVEC3& normal, float& sigmaC, float& sigmaS, const FunctorSelect& select) +void sigmaBilateral(typename PFP::MAP& map, const AttributeHandler& position, const AttributeHandler& normal, float& sigmaC, float& sigmaS, const FunctorSelect& select) { typedef typename PFP::VEC3 VEC3 ; @@ -57,7 +57,7 @@ void sigmaBilateral(typename PFP::MAP& map, const typename PFP::TVEC3& position, } template -void filterBilateral(typename PFP::MAP& map, const typename PFP::TVEC3& position, typename PFP::TVEC3& position2, const typename PFP::TVEC3& normal, const FunctorSelect& select = allDarts) +void filterBilateral(typename PFP::MAP& map, const AttributeHandler& position, AttributeHandler& position2, const AttributeHandler& normal, const FunctorSelect& select = allDarts) { typedef typename PFP::VEC3 VEC3 ; @@ -93,7 +93,7 @@ void filterBilateral(typename PFP::MAP& map, const typename PFP::TVEC3& position } template -void filterSUSAN(typename PFP::MAP& map, float SUSANthreshold, const typename PFP::TVEC3& position, typename PFP::TVEC3& position2, const typename PFP::TVEC3& normal, const FunctorSelect& select = allDarts) +void filterSUSAN(typename PFP::MAP& map, float SUSANthreshold, const AttributeHandler& position, AttributeHandler& position2, const AttributeHandler& normal, const FunctorSelect& select = allDarts) { typedef typename PFP::VEC3 VEC3 ; diff --git a/include/Algo/Filtering/functors.h b/include/Algo/Filtering/functors.h index 8f476c66804fe4be80dde9a034eb1484627dfdf4..da326eec244093d248b4eb944b548684043359cd 100644 --- a/include/Algo/Filtering/functors.h +++ b/include/Algo/Filtering/functors.h @@ -37,15 +37,16 @@ namespace Algo namespace Filtering { -template +template class FunctorAverage : public virtual FunctorType { protected: - const AttributeHandler& attr ; + const AttributeHandler& attr ; T sum ; unsigned int count ; + public: - FunctorAverage(const AttributeHandler& a) : FunctorType(), attr(a), sum(0), count(0) + FunctorAverage(const AttributeHandler& a) : FunctorType(), attr(a), sum(0), count(0) {} bool operator()(Dart d) { @@ -63,15 +64,17 @@ template class FunctorAverageOnSphereBorder : public FunctorMap { typedef typename PFP::VEC3 VEC3; + protected: - const AttributeHandler& attr ; - const AttributeHandler& position ; + const AttributeHandler& attr ; + const AttributeHandler& position ; VEC3 center; typename PFP::REAL radius; T sum ; unsigned int count ; + public: - FunctorAverageOnSphereBorder(typename PFP::MAP& map, const AttributeHandler& a, const AttributeHandler& p) : + FunctorAverageOnSphereBorder(typename PFP::MAP& map, const AttributeHandler& a, const AttributeHandler& p) : FunctorMap(map), attr(a), position(p), sum(0), count(0) { center = VEC3(0); diff --git a/include/Algo/Filtering/taubin.h b/include/Algo/Filtering/taubin.h index bdff775bc71d6153aa81805267e6ee33554b4730..d8d0afa01cac4c2612590007a57451beec1ea416 100644 --- a/include/Algo/Filtering/taubin.h +++ b/include/Algo/Filtering/taubin.h @@ -35,7 +35,7 @@ namespace Filtering { template -void filterTaubin(typename PFP::MAP& map, typename PFP::TVEC3& position, typename PFP::TVEC3& position2, const FunctorSelect& select = allDarts) +void filterTaubin(typename PFP::MAP& map, AttributeHandler& position, AttributeHandler& position2, const FunctorSelect& select = allDarts) { typedef typename PFP::VEC3 VEC3 ; @@ -44,9 +44,9 @@ void filterTaubin(typename PFP::MAP& map, typename PFP::TVEC3& position, typenam const float lambda = 0.6307 ; const float mu = -0.6732 ; - CellMarkerNoUnmark mv(map, VERTEX) ; + CellMarkerNoUnmark mv(map) ; - FunctorAverage fa1(position) ; + FunctorAverage fa1(position) ; for(Dart d = map.begin(); d != map.end(); map.next(d)) { if(select(d) && !mv.isMarked(d)) @@ -69,7 +69,7 @@ void filterTaubin(typename PFP::MAP& map, typename PFP::TVEC3& position, typenam } // unshrinking step - FunctorAverage fa2(position2) ; + FunctorAverage fa2(position2) ; for(Dart d = map.begin(); d != map.end(); map.next(d)) { if(select(d) && mv.isMarked(d)) @@ -96,16 +96,16 @@ void filterTaubin(typename PFP::MAP& map, typename PFP::TVEC3& position, typenam * Taubin filter modified as proposed by [Lav09] */ template -void filterTaubin_modified(typename PFP::MAP& map, typename PFP::TVEC3& position, typename PFP::TVEC3& position2, typename PFP::REAL radius, const FunctorSelect& select = allDarts) +void filterTaubin_modified(typename PFP::MAP& map, AttributeHandler& position, AttributeHandler& position2, typename PFP::REAL radius, const FunctorSelect& select = allDarts) { typedef typename PFP::VEC3 VEC3 ; const float lambda = 0.6307 ; const float mu = -0.6732 ; - CellMarkerNoUnmark mv(map, VERTEX) ; + CellMarkerNoUnmark mv(map) ; - FunctorAverageOnSphereBorder fa1(map, position, position) ; + FunctorAverageOnSphereBorder fa1(map, position, position) ; Algo::Selection::Collector_WithinSphere c1(map, position, radius) ; for(Dart d = map.begin(); d != map.end(); map.next(d)) { @@ -129,7 +129,7 @@ void filterTaubin_modified(typename PFP::MAP& map, typename PFP::TVEC3& position } // unshrinking step - FunctorAverageOnSphereBorder fa2(map, position2, position2) ; + FunctorAverageOnSphereBorder fa2(map, position2, position2) ; Algo::Selection::Collector_WithinSphere c2(map, position2, radius) ; for(Dart d = map.begin(); d != map.end(); map.next(d)) { diff --git a/include/Algo/Filtering/tools.h b/include/Algo/Filtering/tools.h index 3962e06531d494f94f8da202240c11c8e7c3fa58..60f4fdbd7e5b5495e5c59fd532a92c6ccdd3db62 100644 --- a/include/Algo/Filtering/tools.h +++ b/include/Algo/Filtering/tools.h @@ -38,7 +38,7 @@ namespace Filtering { template -float computeHaussdorf(typename PFP::MAP& map, const typename PFP::TVEC3& originalPosition, const typename PFP::TVEC3& position2, const FunctorSelect& select = allDarts) +float computeHaussdorf(typename PFP::MAP& map, const AttributeHandler& originalPosition, const AttributeHandler& position2, const FunctorSelect& select = allDarts) { typedef typename PFP::VEC3 VEC3 ; @@ -85,7 +85,7 @@ float computeHaussdorf(typename PFP::MAP& map, const typename PFP::TVEC3& origin } template -void computeNoise(typename PFP::MAP& map, long amount, const typename PFP::TVEC3& position, typename PFP::TVEC3& position2, const typename PFP::TVEC3& normal, const FunctorSelect& select = allDarts) +void computeNoise(typename PFP::MAP& map, long amount, const AttributeHandler& position, AttributeHandler& position2, const AttributeHandler& normal, const FunctorSelect& select = allDarts) { typedef typename PFP::VEC3 VEC3 ; diff --git a/include/Algo/Geometry/inclusion.h b/include/Algo/Geometry/inclusion.h index 5937d96b0bbe224dc620cce6bd130e27603ac6b3..5e794948d8c4c98884a64edaf1a8af9c3324b4f1 100644 --- a/include/Algo/Geometry/inclusion.h +++ b/include/Algo/Geometry/inclusion.h @@ -46,7 +46,7 @@ namespace Geometry * @param true if the faces of the volume must be in CCW order (default=true) */ template -bool isConvex(typename PFP::MAP& map, Dart d, const typename PFP::TVEC3& positions, bool CCW, unsigned int thread=0); +bool isConvex(typename PFP::MAP& map, Dart d, const AttributeHandler& positions, bool CCW, unsigned int thread=0); /** * test if a point is inside a volume @@ -55,7 +55,7 @@ bool isConvex(typename PFP::MAP& map, Dart d, const typename PFP::TVEC3& positio * @param the point */ template -bool isPointInVolume(typename PFP::MAP& map, Dart d, const typename PFP::TVEC3& positions, const typename PFP::VEC3& point); +bool isPointInVolume(typename PFP::MAP& map, Dart d, const AttributeHandler& positions, const typename PFP::VEC3& point); /** * test if a point is inside a volume @@ -64,7 +64,7 @@ bool isPointInVolume(typename PFP::MAP& map, Dart d, const typename PFP::TVEC3& * @param the point */ template -bool isPointInConvexVolume(typename PFP::MAP& map, Dart d, const typename PFP::TVEC3& positions, const typename PFP::VEC3& point, bool CCW=true); +bool isPointInConvexVolume(typename PFP::MAP& map, Dart d, const AttributeHandler& positions, const typename PFP::VEC3& point, bool CCW=true); /** * test if a point is inside a face in a plane @@ -73,7 +73,7 @@ bool isPointInConvexVolume(typename PFP::MAP& map, Dart d, const typename PFP::T * @param the point */ template -bool isPointInConvexFace2D(typename PFP::MAP& map, Dart d, const typename PFP::TVEC3& positions, const typename PFP::VEC3& point, bool CCW=true); +bool isPointInConvexFace2D(typename PFP::MAP& map, Dart d, const AttributeHandler& positions, const typename PFP::VEC3& point, bool CCW=true); /** * test if a point is inside a face @@ -82,7 +82,7 @@ bool isPointInConvexFace2D(typename PFP::MAP& map, Dart d, const typename PFP::T * @param the point */ template -bool isPointInConvexFace(typename PFP::MAP& map, Dart d, const typename PFP::TVEC3& positions, const typename PFP::VEC3& point, bool CCW); +bool isPointInConvexFace(typename PFP::MAP& map, Dart d, const AttributeHandler& positions, const typename PFP::VEC3& point, bool CCW); /** * test if a point is on an edge @@ -91,7 +91,7 @@ bool isPointInConvexFace(typename PFP::MAP& map, Dart d, const typename PFP::TVE * @param the point */ template -bool isPointOnEdge(typename PFP::MAP& map, Dart d, const typename PFP::TVEC3& positions, const typename PFP::VEC3& point); +bool isPointOnEdge(typename PFP::MAP& map, Dart d, const AttributeHandler& positions, const typename PFP::VEC3& point); /** * test if a point is on an half-edge defined by a dart @@ -100,7 +100,7 @@ bool isPointOnEdge(typename PFP::MAP& map, Dart d, const typename PFP::TVEC3& po * @param the point */ template -bool isPointOnHalfEdge(typename PFP::MAP& map, Dart d, const typename PFP::TVEC3& positions, const typename PFP::VEC3& point); +bool isPointOnHalfEdge(typename PFP::MAP& map, Dart d, const AttributeHandler& positions, const typename PFP::VEC3& point); /** * test if a point is on a vertex @@ -109,7 +109,7 @@ bool isPointOnHalfEdge(typename PFP::MAP& map, Dart d, const typename PFP::TVEC3 * @param the point */ template -bool isPointOnVertex(typename PFP::MAP& map, Dart d, const typename PFP::TVEC3& positions, const typename PFP::VEC3& point); +bool isPointOnVertex(typename PFP::MAP& map, Dart d, const AttributeHandler& positions, const typename PFP::VEC3& point); /** @@ -121,7 +121,7 @@ bool isPointOnVertex(typename PFP::MAP& map, Dart d, const typename PFP::TVEC3& * @param true if the faces of the tetra are in CCW order (default=true) */ template -bool isConvexFaceInOrIntersectingTetrahedron(typename PFP::MAP& map, Dart d, const typename PFP::TVEC3& positions, const typename PFP::VEC3 points[4], bool CCW); +bool isConvexFaceInOrIntersectingTetrahedron(typename PFP::MAP& map, Dart d, const AttributeHandler& positions, const typename PFP::VEC3 points[4], bool CCW); } // namespace Geometry diff --git a/include/Algo/Geometry/inclusion.hpp b/include/Algo/Geometry/inclusion.hpp index e33dcd70a0d5eaa442bc32dd85b1039bd48f7b44..e3eaf5db59f35ff7682d4602a16622b44a901753 100644 --- a/include/Algo/Geometry/inclusion.hpp +++ b/include/Algo/Geometry/inclusion.hpp @@ -39,7 +39,7 @@ namespace Geometry { template -bool isConvex(typename PFP::MAP& map, Dart d, const typename PFP::TVEC3& position, bool CCW, unsigned int thread) +bool isConvex(typename PFP::MAP& map, Dart d, const AttributeHandler& position, bool CCW, unsigned int thread) { //get all the dart of the volume std::vector vStore; @@ -63,7 +63,7 @@ bool isConvex(typename PFP::MAP& map, Dart d, const typename PFP::TVEC3& positio } template -bool isPointInVolume(typename PFP::MAP& map, Dart d, const typename PFP::TVEC3& position, const typename PFP::VEC3& point) +bool isPointInVolume(typename PFP::MAP& map, Dart d, const AttributeHandler& position, const typename PFP::VEC3& point) { typedef typename PFP::VEC3 VEC3; @@ -125,7 +125,7 @@ bool isPointInVolume(typename PFP::MAP& map, Dart d, const typename PFP::TVEC3& } template -bool isPointInConvexVolume(typename PFP::MAP& map, Dart d, const typename PFP::TVEC3& position, const typename PFP::VEC3& point, bool CCW) +bool isPointInConvexVolume(typename PFP::MAP& map, Dart d, const AttributeHandler& position, const typename PFP::VEC3& point, bool CCW) { typedef typename PFP::VEC3 VEC3 ; typedef typename PFP::REAL REAL; @@ -168,7 +168,7 @@ bool isPointInConvexVolume(typename PFP::MAP& map, Dart d, const typename PFP::T } template -bool isPointInConvexFace(typename PFP::MAP& map, Dart d, const typename PFP::TVEC3& position, const typename PFP::VEC3& point, bool CCW) +bool isPointInConvexFace(typename PFP::MAP& map, Dart d, const AttributeHandler& position, const typename PFP::VEC3& point, bool CCW) { typedef typename PFP::VEC3 VEC3 ; typedef typename PFP::REAL REAL; @@ -202,7 +202,7 @@ bool isPointInConvexFace(typename PFP::MAP& map, Dart d, const typename PFP::TVE } template -bool isPointInConvexFace2D(typename PFP::MAP& map, Dart d, const typename PFP::TVEC3& position, const typename PFP::VEC3& point, bool CCW ) +bool isPointInConvexFace2D(typename PFP::MAP& map, Dart d, const AttributeHandler& position, const typename PFP::VEC3& point, bool CCW ) { typedef typename PFP::VEC3 VEC3 ; typedef typename PFP::REAL REAL; @@ -229,7 +229,7 @@ bool isPointInConvexFace2D(typename PFP::MAP& map, Dart d, const typename PFP::T } template -bool isPointOnEdge(typename PFP::MAP& map, Dart d, const typename PFP::TVEC3& position, const typename PFP::VEC3& point) +bool isPointOnEdge(typename PFP::MAP& map, Dart d, const AttributeHandler& position, const typename PFP::VEC3& point) { // typedef typename PFP::REAL REAL; // typedef typename PFP::VEC3 VEC3 ; @@ -257,7 +257,7 @@ bool isPointOnEdge(typename PFP::MAP& map, Dart d, const typename PFP::TVEC3& po } template -bool isPointOnHalfEdge(typename PFP::MAP& map, Dart d, const typename PFP::TVEC3& position, const typename PFP::VEC3& point) +bool isPointOnHalfEdge(typename PFP::MAP& map, Dart d, const AttributeHandler& position, const typename PFP::VEC3& point) { typedef typename PFP::REAL REAL; typedef typename PFP::VEC3 VEC3; @@ -272,13 +272,13 @@ bool isPointOnHalfEdge(typename PFP::MAP& map, Dart d, const typename PFP::TVEC3 } template -bool isPointOnVertex(typename PFP::MAP& map, Dart d, const typename PFP::TVEC3& position, const typename PFP::VEC3& point) +bool isPointOnVertex(typename PFP::MAP& map, Dart d, const AttributeHandler& position, const typename PFP::VEC3& point) { return Geom::arePointsEquals(point, position[d]); } template -bool isConvexFaceInOrIntersectingTetrahedron(typename PFP::MAP& map, Dart d, const typename PFP::TVEC3& position, const typename PFP::VEC3 points[4], bool CCW) +bool isConvexFaceInOrIntersectingTetrahedron(typename PFP::MAP& map, Dart d, const AttributeHandler& position, const typename PFP::VEC3 points[4], bool CCW) { typedef typename PFP::VEC3 VEC3 ; diff --git a/include/Algo/Geometry/intersection.h b/include/Algo/Geometry/intersection.h index 56994197ee458c9b3562a0995723c62b05f55e46..4e0392e543be0e2b9980ef00308ca955807d187d 100644 --- a/include/Algo/Geometry/intersection.h +++ b/include/Algo/Geometry/intersection.h @@ -46,7 +46,7 @@ namespace Geometry * @return true if segment intersects the face */ template -bool intersectionLineConvexFace(typename PFP::MAP& map, Dart d, const typename PFP::TVEC3& position, const typename PFP::VEC3& P, const typename PFP::VEC3& Dir, typename PFP::VEC3& Inter) ; +bool intersectionLineConvexFace(typename PFP::MAP& map, Dart d, const AttributeHandler& position, const typename PFP::VEC3& P, const typename PFP::VEC3& Dir, typename PFP::VEC3& Inter) ; /** * test the intersection between a segment and a n-sided face (n>=3) @@ -60,7 +60,7 @@ bool intersectionLineConvexFace(typename PFP::MAP& map, Dart d, const typename P * @return true if segment intersects the face */ template -bool intersectionSegmentConvexFace(typename PFP::MAP& map, Dart d, const typename PFP::TVEC3& position, const typename PFP::VEC3& PA, const typename PFP::VEC3& PB, typename PFP::VEC3& Inter) ; +bool intersectionSegmentConvexFace(typename PFP::MAP& map, Dart d, const AttributeHandler& position, const typename PFP::VEC3& PA, const typename PFP::VEC3& PB, typename PFP::VEC3& Inter) ; /** * test if two triangles intersect @@ -70,7 +70,7 @@ bool intersectionSegmentConvexFace(typename PFP::MAP& map, Dart d, const typenam * @param a dart of the second triangle */ template -bool areTrianglesInIntersection(typename PFP::MAP& map, Dart tri1, Dart tri2, const typename PFP::TVEC3& position) ; +bool areTrianglesInIntersection(typename PFP::MAP& map, Dart tri1, Dart tri2, const AttributeHandler& position) ; /** * alpha = coef d'interpolation dans [0 ,1] tel que v = (1-alpha)*pin + alpha*pout @@ -79,7 +79,7 @@ bool areTrianglesInIntersection(typename PFP::MAP& map, Dart tri1, Dart tri2, co * avec pout = position[phi1(d)] à l'extérieur de la sphère */ template -bool intersectionSphereEdge(typename PFP::MAP& map, typename PFP::VEC3& center, typename PFP::REAL radius, Dart d, const typename PFP::TVEC3& position, typename PFP::REAL& alpha) ; +bool intersectionSphereEdge(typename PFP::MAP& map, typename PFP::VEC3& center, typename PFP::REAL radius, Dart d, const AttributeHandler& position, typename PFP::REAL& alpha) ; } // namespace Geometry diff --git a/include/Algo/Geometry/intersection.hpp b/include/Algo/Geometry/intersection.hpp index 68d2c323d4c95e1d45984a7accacdd8933b33b42..4352db3d320b86a9f54bfceb2a44cce65c801347 100644 --- a/include/Algo/Geometry/intersection.hpp +++ b/include/Algo/Geometry/intersection.hpp @@ -41,7 +41,7 @@ namespace Geometry { template -bool intersectionLineConvexFace(typename PFP::MAP& map, Dart d, const typename PFP::TVEC3& position, const typename PFP::VEC3& P, const typename PFP::VEC3& Dir, typename PFP::VEC3& Inter) +bool intersectionLineConvexFace(typename PFP::MAP& map, Dart d, const AttributeHandler& position, const typename PFP::VEC3& P, const typename PFP::VEC3& Dir, typename PFP::VEC3& Inter) { typedef typename PFP::VEC3 VEC3 ; @@ -87,7 +87,7 @@ bool intersectionLineConvexFace(typename PFP::MAP& map, Dart d, const typename P } template -bool intersectionSegmentConvexFace(typename PFP::MAP& map, Dart d, const typename PFP::TVEC3& position, const typename PFP::VEC3& PA, const typename PFP::VEC3& PB, typename PFP::VEC3& Inter) +bool intersectionSegmentConvexFace(typename PFP::MAP& map, Dart d, const AttributeHandler& position, const typename PFP::VEC3& PA, const typename PFP::VEC3& PB, typename PFP::VEC3& Inter) { typename PFP::VEC3 dir = PB - PA; if (intersectionLineConvexFace(map, d, position, PA, dir, Inter)) @@ -102,7 +102,7 @@ bool intersectionSegmentConvexFace(typename PFP::MAP& map, Dart d, const typenam } template -bool areTrianglesInIntersection(typename PFP::MAP& map, Dart tri1, Dart tri2, const typename PFP::TVEC3& position) +bool areTrianglesInIntersection(typename PFP::MAP& map, Dart tri1, Dart tri2, const AttributeHandler& position) { typedef typename PFP::VEC3 VEC3 ; @@ -228,7 +228,7 @@ bool areTrianglesInIntersection(typename PFP::MAP& map, Dart tri1, Dart tri2, co } template -bool intersectionSphereEdge(typename PFP::MAP& map, typename PFP::VEC3& center, typename PFP::REAL radius, Dart d, const typename PFP::TVEC3& position, typename PFP::REAL& alpha) +bool intersectionSphereEdge(typename PFP::MAP& map, typename PFP::VEC3& center, typename PFP::REAL radius, Dart d, const AttributeHandler& position, typename PFP::REAL& alpha) { typedef typename PFP::VEC3 VEC3 ; typedef typename PFP::REAL REAL ; diff --git a/include/Algo/Geometry/orientation.h b/include/Algo/Geometry/orientation.h index d52c6928c9636d8cc976d7b392e6e35cfb94eb64..1a448106f05314894442a16cc23dda9624d1ec04 100644 --- a/include/Algo/Geometry/orientation.h +++ b/include/Algo/Geometry/orientation.h @@ -38,7 +38,7 @@ namespace Geometry { template -bool isTetrahedronWellOriented(typename PFP::MAP& map, Dart d, const typename PFP::TVEC3& positions, bool CCW) +bool isTetrahedronWellOriented(typename PFP::MAP& map, Dart d, const AttributeHandler& positions, bool CCW) { typedef typename PFP::VEC3 VEC3 ; diff --git a/include/Algo/Selection/collector.h b/include/Algo/Selection/collector.h index a382eaa5302df8c7fc47dc652969658d58f3aa1e..c66e174accdee70aee3fd8076e5551462f2e1e72 100644 --- a/include/Algo/Selection/collector.h +++ b/include/Algo/Selection/collector.h @@ -142,12 +142,12 @@ template class Collector_WithinSphere : public Collector { protected: - const typename PFP::TVEC3& position; + const AttributeHandler& position; typename PFP::REAL radius; typename PFP::REAL area; public: - Collector_WithinSphere(typename PFP::MAP& m, const typename PFP::TVEC3& p, typename PFP::REAL r = 0) : + Collector_WithinSphere(typename PFP::MAP& m, const AttributeHandler& p, typename PFP::REAL r = 0) : Collector(m), position(p), radius(r), @@ -155,7 +155,7 @@ public: {} inline void setRadius(typename PFP::REAL r) { radius = r; } inline typename PFP::REAL getRadius() const { return radius; } - inline const typename PFP::TVEC3& getPosition() const { return position; } + inline const AttributeHandler& getPosition() const { return position; } void collectAll(Dart d); void collectBorder(Dart d); diff --git a/include/Algo/Selection/collector.hpp b/include/Algo/Selection/collector.hpp index cec3a23bc027752e161dce3c5d37903b6ec612de..78f5cfd8f4a1bf1b4f092b99e761cd34a04ad73d 100644 --- a/include/Algo/Selection/collector.hpp +++ b/include/Algo/Selection/collector.hpp @@ -149,9 +149,9 @@ void Collector_WithinSphere::collectAll(Dart d) this->insideFaces.reserve(32); this->border.reserve(32); - CellMarkerStore vm(this->map, VERTEX); // mark the collected inside-vertices - CellMarkerStore em(this->map, EDGE); // mark the collected inside-edges + border-edges - CellMarkerStore fm(this->map, FACE); // mark the collected inside-faces + border-faces + CellMarkerStore vm(this->map); // mark the collected inside-vertices + CellMarkerStore em(this->map); // mark the collected inside-edges + border-edges + CellMarkerStore fm(this->map); // mark the collected inside-faces + border-faces this->insideVertices.push_back(this->centerDart); vm.mark(this->centerDart); @@ -211,8 +211,8 @@ void Collector_WithinSphere::collectBorder(Dart d) this->border.reserve(128); this->insideVertices.reserve(128); - CellMarkerStore vm(this->map, VERTEX); // mark the collected inside-vertices - CellMarkerStore em(this->map, EDGE); // mark the collected inside-edges + border-edges + CellMarkerStore vm(this->map); // mark the collected inside-vertices + CellMarkerStore em(this->map); // mark the collected inside-edges + border-edges this->insideVertices.push_back(this->centerDart); vm.mark(this->centerDart);