Commit 6ab7e17b authored by Pierre Kraemer's avatar Pierre Kraemer

orbit as template -> filtering OK

parent d9d6bb63
...@@ -40,12 +40,12 @@ enum neighborhood { INSIDE = 1, BORDER = 2 }; ...@@ -40,12 +40,12 @@ enum neighborhood { INSIDE = 1, BORDER = 2 };
template <typename PFP, typename T> template <typename PFP, typename T>
void filterAverageAttribute_OneRing( void filterAverageAttribute_OneRing(
typename PFP::MAP& map, typename PFP::MAP& map,
const AttributeHandler<T>& attIn, const AttributeHandler<T, VERTEX>& attIn,
AttributeHandler<T>& attOut, AttributeHandler<T, VERTEX>& attOut,
int neigh, int neigh,
const FunctorSelect& select = allDarts) const FunctorSelect& select = allDarts)
{ {
FunctorAverage<T> fa(attIn) ; FunctorAverage<T, VERTEX> fa(attIn) ;
Algo::Selection::Collector_OneRing<PFP> col(map) ; Algo::Selection::Collector_OneRing<PFP> col(map) ;
TraversorV<typename PFP::MAP> t(map, select) ; TraversorV<typename PFP::MAP> t(map, select) ;
...@@ -86,14 +86,14 @@ void filterAverageAttribute_OneRing( ...@@ -86,14 +86,14 @@ void filterAverageAttribute_OneRing(
template <typename PFP, typename T> template <typename PFP, typename T>
void filterAverageVertexAttribute_WithinSphere( void filterAverageVertexAttribute_WithinSphere(
typename PFP::MAP& map, typename PFP::MAP& map,
const AttributeHandler<T>& attIn, const AttributeHandler<T, VERTEX>& attIn,
AttributeHandler<T>& attOut, AttributeHandler<T, VERTEX>& attOut,
int neigh, int neigh,
typename PFP::TVEC3 & position, AttributeHandler<typename PFP::VEC3, VERTEX>& position,
typename PFP::REAL radius, typename PFP::REAL radius,
const FunctorSelect& select = allDarts) const FunctorSelect& select = allDarts)
{ {
FunctorAverage<T> faInside(attIn) ; FunctorAverage<T, VERTEX> faInside(attIn) ;
FunctorAverageOnSphereBorder<PFP, T> faBorder(map, attIn, position) ; FunctorAverageOnSphereBorder<PFP, T> faBorder(map, attIn, position) ;
Algo::Selection::Collector_WithinSphere<PFP> col(map, position, radius) ; Algo::Selection::Collector_WithinSphere<PFP> col(map, position, radius) ;
...@@ -128,14 +128,14 @@ void filterAverageVertexAttribute_WithinSphere( ...@@ -128,14 +128,14 @@ void filterAverageVertexAttribute_WithinSphere(
template <typename PFP, typename T> template <typename PFP, typename T>
void filterAverageEdgeAttribute_WithinSphere( void filterAverageEdgeAttribute_WithinSphere(
typename PFP::MAP& map, typename PFP::MAP& map,
const AttributeHandler<T>& attIn, const AttributeHandler<T, EDGE>& attIn,
AttributeHandler<T>& attOut, AttributeHandler<T, EDGE>& attOut,
int neigh, int neigh,
typename PFP::TVEC3 & position, AttributeHandler<typename PFP::VEC3, VERTEX>& position,
typename PFP::REAL radius, typename PFP::REAL radius,
const FunctorSelect& select = allDarts) const FunctorSelect& select = allDarts)
{ {
FunctorAverage<T> fa(attIn) ; FunctorAverage<T, EDGE> fa(attIn) ;
Algo::Selection::Collector_WithinSphere<PFP> col(map, position, radius) ; Algo::Selection::Collector_WithinSphere<PFP> col(map, position, radius) ;
TraversorE<typename PFP::MAP> t(map, select) ; TraversorE<typename PFP::MAP> t(map, select) ;
...@@ -156,14 +156,14 @@ void filterAverageEdgeAttribute_WithinSphere( ...@@ -156,14 +156,14 @@ void filterAverageEdgeAttribute_WithinSphere(
template <typename PFP, typename T> template <typename PFP, typename T>
void filterAverageFaceAttribute_WithinSphere( void filterAverageFaceAttribute_WithinSphere(
typename PFP::MAP& map, typename PFP::MAP& map,
const AttributeHandler<T>& attIn, const AttributeHandler<T, FACE>& attIn,
AttributeHandler<T>& attOut, AttributeHandler<T, FACE>& attOut,
int neigh, int neigh,
typename PFP::TVEC3 & position, AttributeHandler<typename PFP::VEC3, VERTEX>& position,
typename PFP::REAL radius, typename PFP::REAL radius,
const FunctorSelect& select = allDarts) const FunctorSelect& select = allDarts)
{ {
FunctorAverage<T> fa(attIn) ; FunctorAverage<T, FACE> fa(attIn) ;
Algo::Selection::Collector_WithinSphere<PFP> col(map, position, radius) ; Algo::Selection::Collector_WithinSphere<PFP> col(map, position, radius) ;
TraversorF<typename PFP::MAP> t(map, select) ; TraversorF<typename PFP::MAP> t(map, select) ;
......
...@@ -41,12 +41,12 @@ namespace Filtering ...@@ -41,12 +41,12 @@ namespace Filtering
template <typename PFP> template <typename PFP>
void computeNewPositionsFromFaceNormals( void computeNewPositionsFromFaceNormals(
typename PFP::MAP& map, typename PFP::MAP& map,
const typename PFP::TVEC3& position, const AttributeHandler<typename PFP::VEC3, VERTEX>& position,
typename PFP::TVEC3& position2, AttributeHandler<typename PFP::VEC3, VERTEX>& position2,
const typename PFP::TREAL& faceArea, const AttributeHandler<typename PFP::REAL, FACE>& faceArea,
const typename PFP::TVEC3& faceCentroid, const AttributeHandler<typename PFP::VEC3, FACE>& faceCentroid,
const typename PFP::TVEC3& faceNormal, const AttributeHandler<typename PFP::VEC3, FACE>& faceNormal,
const typename PFP::TVEC3& faceNewNormal, const AttributeHandler<typename PFP::VEC3, FACE>& faceNewNormal,
const FunctorSelect& select) const FunctorSelect& select)
{ {
typedef typename PFP::VEC3 VEC3 ; typedef typename PFP::VEC3 VEC3 ;
...@@ -75,20 +75,20 @@ void computeNewPositionsFromFaceNormals( ...@@ -75,20 +75,20 @@ void computeNewPositionsFromFaceNormals(
} }
template <typename PFP> template <typename PFP>
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<typename PFP::VEC3, VERTEX>& position, AttributeHandler<typename PFP::VEC3, VERTEX>& position2, const FunctorSelect& select = allDarts)
{ {
typedef typename PFP::VEC3 VEC3 ; typedef typename PFP::VEC3 VEC3 ;
typedef typename PFP::REAL REAL ; typedef typename PFP::REAL REAL ;
AutoAttributeHandler<REAL> faceArea(map, FACE, "faceArea") ; AutoAttributeHandler<REAL, FACE> faceArea(map, "faceArea") ;
AutoAttributeHandler<VEC3> faceNormal(map, FACE, "faceNormal") ; AutoAttributeHandler<VEC3, FACE> faceNormal(map, "faceNormal") ;
AutoAttributeHandler<VEC3> faceCentroid(map, FACE, "faceCentroid") ; AutoAttributeHandler<VEC3, FACE> faceCentroid(map, "faceCentroid") ;
Algo::Geometry::computeAreaFaces<PFP>(map, position, faceArea, select) ; Algo::Geometry::computeAreaFaces<PFP>(map, position, faceArea, select) ;
Algo::Geometry::computeNormalFaces<PFP>(map, position, faceNormal, select) ; Algo::Geometry::computeNormalFaces<PFP>(map, position, faceNormal, select) ;
Algo::Geometry::computeCentroidFaces<PFP>(map, position, faceCentroid, select) ; Algo::Geometry::computeCentroidFaces<PFP>(map, position, faceCentroid, select) ;
AutoAttributeHandler<VEC3> faceNewNormal(map, FACE, "faceNewNormal") ; AutoAttributeHandler<VEC3, FACE> faceNewNormal(map, "faceNewNormal") ;
// Compute new normals // Compute new normals
TraversorF<typename PFP::MAP> tf(map, select) ; TraversorF<typename PFP::MAP> tf(map, select) ;
...@@ -119,20 +119,20 @@ void filterAverageNormals(typename PFP::MAP& map, const typename PFP::TVEC3& pos ...@@ -119,20 +119,20 @@ void filterAverageNormals(typename PFP::MAP& map, const typename PFP::TVEC3& pos
} }
template <typename PFP> template <typename PFP>
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<typename PFP::VEC3, VERTEX>& position, AttributeHandler<typename PFP::VEC3, VERTEX>& position2, const FunctorSelect& select = allDarts)
{ {
typedef typename PFP::VEC3 VEC3 ; typedef typename PFP::VEC3 VEC3 ;
typedef typename PFP::REAL REAL ; typedef typename PFP::REAL REAL ;
AutoAttributeHandler<REAL> faceArea(map, FACE, "faceArea") ; AutoAttributeHandler<REAL, FACE> faceArea(map, "faceArea") ;
AutoAttributeHandler<VEC3> faceNormal(map, FACE, "faceNormal") ; AutoAttributeHandler<VEC3, FACE> faceNormal(map, "faceNormal") ;
AutoAttributeHandler<VEC3> faceCentroid(map, FACE, "faceCentroid") ; AutoAttributeHandler<VEC3, FACE> faceCentroid(map, "faceCentroid") ;
Algo::Geometry::computeAreaFaces<PFP>(map, position, faceArea, select) ; Algo::Geometry::computeAreaFaces<PFP>(map, position, faceArea, select) ;
Algo::Geometry::computeNormalFaces<PFP>(map, position, faceNormal, select) ; Algo::Geometry::computeNormalFaces<PFP>(map, position, faceNormal, select) ;
Algo::Geometry::computeCentroidFaces<PFP>(map, position, faceCentroid, select) ; Algo::Geometry::computeCentroidFaces<PFP>(map, position, faceCentroid, select) ;
AutoAttributeHandler<VEC3> faceNewNormal(map, FACE, "faceNewNormal") ; AutoAttributeHandler<VEC3, FACE> faceNewNormal(map, "faceNewNormal") ;
// Compute new normals // Compute new normals
TraversorF<typename PFP::MAP> tf(map, select) ; TraversorF<typename PFP::MAP> tf(map, select) ;
...@@ -204,20 +204,20 @@ void filterMMSE(typename PFP::MAP& map, float sigmaN2, const typename PFP::TVEC3 ...@@ -204,20 +204,20 @@ void filterMMSE(typename PFP::MAP& map, float sigmaN2, const typename PFP::TVEC3
} }
template <typename PFP> template <typename PFP>
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<typename PFP::VEC3, VERTEX>& position, AttributeHandler<typename PFP::VEC3, VERTEX>& position2, const FunctorSelect& select = allDarts)
{ {
typedef typename PFP::VEC3 VEC3 ; typedef typename PFP::VEC3 VEC3 ;
typedef typename PFP::REAL REAL ; typedef typename PFP::REAL REAL ;
AutoAttributeHandler<REAL> faceArea(map, FACE, "faceArea") ; AutoAttributeHandler<REAL, FACE> faceArea(map, "faceArea") ;
AutoAttributeHandler<VEC3> faceNormal(map, FACE, "faceNormal") ; AutoAttributeHandler<VEC3, FACE> faceNormal(map, "faceNormal") ;
AutoAttributeHandler<VEC3> faceCentroid(map, FACE, "faceCentroid") ; AutoAttributeHandler<VEC3, FACE> faceCentroid(map, "faceCentroid") ;
Algo::Geometry::computeAreaFaces<PFP>(map, position, faceArea, select) ; Algo::Geometry::computeAreaFaces<PFP>(map, position, faceArea, select) ;
Algo::Geometry::computeNormalFaces<PFP>(map, position, faceNormal, select) ; Algo::Geometry::computeNormalFaces<PFP>(map, position, faceNormal, select) ;
Algo::Geometry::computeCentroidFaces<PFP>(map, position, faceCentroid, select) ; Algo::Geometry::computeCentroidFaces<PFP>(map, position, faceCentroid, select) ;
AutoAttributeHandler<VEC3> faceNewNormal(map, FACE, "faceNewNormal") ; AutoAttributeHandler<VEC3, FACE> faceNewNormal(map, "faceNewNormal") ;
// Compute new normals // Compute new normals
long nbTot = 0 ; long nbTot = 0 ;
...@@ -323,22 +323,22 @@ void filterTNBA(typename PFP::MAP& map, float sigmaN2, float SUSANthreshold, con ...@@ -323,22 +323,22 @@ void filterTNBA(typename PFP::MAP& map, float sigmaN2, float SUSANthreshold, con
} }
template <typename PFP> template <typename PFP>
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<typename PFP::VEC3, VERTEX>& position, AttributeHandler<typename PFP::VEC3, VERTEX>& position2, const AttributeHandler<typename PFP::VEC3, VERTEX>& normal, const FunctorSelect& select = allDarts)
{ {
typedef typename PFP::VEC3 VEC3 ; typedef typename PFP::VEC3 VEC3 ;
typedef typename PFP::REAL REAL ; typedef typename PFP::REAL REAL ;
AutoAttributeHandler<REAL> faceArea(map, FACE, "faceArea") ; AutoAttributeHandler<REAL, FACE> faceArea(map, "faceArea") ;
AutoAttributeHandler<VEC3> faceNormal(map, FACE, "faceNormal") ; AutoAttributeHandler<VEC3, FACE> faceNormal(map, "faceNormal") ;
AutoAttributeHandler<VEC3> faceCentroid(map, FACE, "faceCentroid") ; AutoAttributeHandler<VEC3, FACE> faceCentroid(map, "faceCentroid") ;
Algo::Geometry::computeAreaFaces<PFP>(map, position, faceArea, select) ; Algo::Geometry::computeAreaFaces<PFP>(map, position, faceArea, select) ;
Algo::Geometry::computeNormalFaces<PFP>(map, position, faceNormal, select) ; Algo::Geometry::computeNormalFaces<PFP>(map, position, faceNormal, select) ;
Algo::Geometry::computeCentroidFaces<PFP>(map, position, faceCentroid, select) ; Algo::Geometry::computeCentroidFaces<PFP>(map, position, faceCentroid, select) ;
AutoAttributeHandler<REAL> vertexArea(map, VERTEX, "vertexArea") ; AutoAttributeHandler<REAL, VERTEX> vertexArea(map, "vertexArea") ;
AutoAttributeHandler<VEC3> faceNewNormal(map, FACE, "faceNewNormal") ; AutoAttributeHandler<VEC3, FACE> faceNewNormal(map, "faceNewNormal") ;
AutoAttributeHandler<VEC3> vertexNewNormal(map, VERTEX, "vertexNewNormal") ; AutoAttributeHandler<VEC3, VERTEX> vertexNewNormal(map, "vertexNewNormal") ;
long nbTot = 0 ; long nbTot = 0 ;
long nbAdapt = 0 ; long nbAdapt = 0 ;
......
...@@ -35,7 +35,7 @@ namespace Filtering ...@@ -35,7 +35,7 @@ namespace Filtering
{ {
template <typename PFP> template <typename PFP>
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<typename PFP::VEC3, VERTEX>& position, const AttributeHandler<typename PFP::VEC3, VERTEX>& normal, float& sigmaC, float& sigmaS, const FunctorSelect& select)
{ {
typedef typename PFP::VEC3 VEC3 ; typedef typename PFP::VEC3 VEC3 ;
...@@ -57,7 +57,7 @@ void sigmaBilateral(typename PFP::MAP& map, const typename PFP::TVEC3& position, ...@@ -57,7 +57,7 @@ void sigmaBilateral(typename PFP::MAP& map, const typename PFP::TVEC3& position,
} }
template <typename PFP> template <typename PFP>
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<typename PFP::VEC3, VERTEX>& position, AttributeHandler<typename PFP::VEC3, VERTEX>& position2, const AttributeHandler<typename PFP::VEC3, VERTEX>& normal, const FunctorSelect& select = allDarts)
{ {
typedef typename PFP::VEC3 VEC3 ; typedef typename PFP::VEC3 VEC3 ;
...@@ -93,7 +93,7 @@ void filterBilateral(typename PFP::MAP& map, const typename PFP::TVEC3& position ...@@ -93,7 +93,7 @@ void filterBilateral(typename PFP::MAP& map, const typename PFP::TVEC3& position
} }
template <typename PFP> template <typename PFP>
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<typename PFP::VEC3, VERTEX>& position, AttributeHandler<typename PFP::VEC3, VERTEX>& position2, const AttributeHandler<typename PFP::VEC3, VERTEX>& normal, const FunctorSelect& select = allDarts)
{ {
typedef typename PFP::VEC3 VEC3 ; typedef typename PFP::VEC3 VEC3 ;
......
...@@ -37,15 +37,16 @@ namespace Algo ...@@ -37,15 +37,16 @@ namespace Algo
namespace Filtering namespace Filtering
{ {
template <typename T> template <typename T, unsigned int ORBIT>
class FunctorAverage : public virtual FunctorType class FunctorAverage : public virtual FunctorType
{ {
protected: protected:
const AttributeHandler<T>& attr ; const AttributeHandler<T, ORBIT>& attr ;
T sum ; T sum ;
unsigned int count ; unsigned int count ;
public: public:
FunctorAverage(const AttributeHandler<T>& a) : FunctorType(), attr(a), sum(0), count(0) FunctorAverage(const AttributeHandler<T, ORBIT>& a) : FunctorType(), attr(a), sum(0), count(0)
{} {}
bool operator()(Dart d) bool operator()(Dart d)
{ {
...@@ -63,15 +64,17 @@ template <typename PFP, typename T> ...@@ -63,15 +64,17 @@ template <typename PFP, typename T>
class FunctorAverageOnSphereBorder : public FunctorMap<typename PFP::MAP> class FunctorAverageOnSphereBorder : public FunctorMap<typename PFP::MAP>
{ {
typedef typename PFP::VEC3 VEC3; typedef typename PFP::VEC3 VEC3;
protected: protected:
const AttributeHandler<T>& attr ; const AttributeHandler<T, VERTEX>& attr ;
const AttributeHandler<VEC3>& position ; const AttributeHandler<VEC3, VERTEX>& position ;
VEC3 center; VEC3 center;
typename PFP::REAL radius; typename PFP::REAL radius;
T sum ; T sum ;
unsigned int count ; unsigned int count ;
public: public:
FunctorAverageOnSphereBorder(typename PFP::MAP& map, const AttributeHandler<T>& a, const AttributeHandler<VEC3>& p) : FunctorAverageOnSphereBorder(typename PFP::MAP& map, const AttributeHandler<T, VERTEX>& a, const AttributeHandler<VEC3, VERTEX>& p) :
FunctorMap<typename PFP::MAP>(map), attr(a), position(p), sum(0), count(0) FunctorMap<typename PFP::MAP>(map), attr(a), position(p), sum(0), count(0)
{ {
center = VEC3(0); center = VEC3(0);
......
...@@ -35,7 +35,7 @@ namespace Filtering ...@@ -35,7 +35,7 @@ namespace Filtering
{ {
template <typename PFP> template <typename PFP>
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<typename PFP::VEC3, VERTEX>& position, AttributeHandler<typename PFP::VEC3, VERTEX>& position2, const FunctorSelect& select = allDarts)
{ {
typedef typename PFP::VEC3 VEC3 ; typedef typename PFP::VEC3 VEC3 ;
...@@ -44,9 +44,9 @@ void filterTaubin(typename PFP::MAP& map, typename PFP::TVEC3& position, typenam ...@@ -44,9 +44,9 @@ void filterTaubin(typename PFP::MAP& map, typename PFP::TVEC3& position, typenam
const float lambda = 0.6307 ; const float lambda = 0.6307 ;
const float mu = -0.6732 ; const float mu = -0.6732 ;
CellMarkerNoUnmark mv(map, VERTEX) ; CellMarkerNoUnmark<VERTEX> mv(map) ;
FunctorAverage<VEC3> fa1(position) ; FunctorAverage<VEC3, VERTEX> fa1(position) ;
for(Dart d = map.begin(); d != map.end(); map.next(d)) for(Dart d = map.begin(); d != map.end(); map.next(d))
{ {
if(select(d) && !mv.isMarked(d)) if(select(d) && !mv.isMarked(d))
...@@ -69,7 +69,7 @@ void filterTaubin(typename PFP::MAP& map, typename PFP::TVEC3& position, typenam ...@@ -69,7 +69,7 @@ void filterTaubin(typename PFP::MAP& map, typename PFP::TVEC3& position, typenam
} }
// unshrinking step // unshrinking step
FunctorAverage<VEC3> fa2(position2) ; FunctorAverage<VEC3, VERTEX> fa2(position2) ;
for(Dart d = map.begin(); d != map.end(); map.next(d)) for(Dart d = map.begin(); d != map.end(); map.next(d))
{ {
if(select(d) && mv.isMarked(d)) if(select(d) && mv.isMarked(d))
...@@ -96,16 +96,16 @@ void filterTaubin(typename PFP::MAP& map, typename PFP::TVEC3& position, typenam ...@@ -96,16 +96,16 @@ void filterTaubin(typename PFP::MAP& map, typename PFP::TVEC3& position, typenam
* Taubin filter modified as proposed by [Lav09] * Taubin filter modified as proposed by [Lav09]
*/ */
template <typename PFP> template <typename PFP>
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<typename PFP::VEC3, VERTEX>& position, AttributeHandler<typename PFP::VEC3, VERTEX>& position2, typename PFP::REAL radius, const FunctorSelect& select = allDarts)
{ {
typedef typename PFP::VEC3 VEC3 ; typedef typename PFP::VEC3 VEC3 ;
const float lambda = 0.6307 ; const float lambda = 0.6307 ;
const float mu = -0.6732 ; const float mu = -0.6732 ;
CellMarkerNoUnmark mv(map, VERTEX) ; CellMarkerNoUnmark<VERTEX> mv(map) ;
FunctorAverageOnSphereBorder<PFP, typename PFP::VEC3> fa1(map, position, position) ; FunctorAverageOnSphereBorder<PFP, VEC3> fa1(map, position, position) ;
Algo::Selection::Collector_WithinSphere<PFP> c1(map, position, radius) ; Algo::Selection::Collector_WithinSphere<PFP> c1(map, position, radius) ;
for(Dart d = map.begin(); d != map.end(); map.next(d)) 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 ...@@ -129,7 +129,7 @@ void filterTaubin_modified(typename PFP::MAP& map, typename PFP::TVEC3& position
} }
// unshrinking step // unshrinking step
FunctorAverageOnSphereBorder<PFP, typename PFP::VEC3> fa2(map, position2, position2) ; FunctorAverageOnSphereBorder<PFP, VEC3> fa2(map, position2, position2) ;
Algo::Selection::Collector_WithinSphere<PFP> c2(map, position2, radius) ; Algo::Selection::Collector_WithinSphere<PFP> c2(map, position2, radius) ;
for(Dart d = map.begin(); d != map.end(); map.next(d)) for(Dart d = map.begin(); d != map.end(); map.next(d))
{ {
......
...@@ -38,7 +38,7 @@ namespace Filtering ...@@ -38,7 +38,7 @@ namespace Filtering
{ {
template <typename PFP> template <typename PFP>
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<typename PFP::VEC3, VERTEX>& originalPosition, const AttributeHandler<typename PFP::VEC3, VERTEX>& position2, const FunctorSelect& select = allDarts)
{ {
typedef typename PFP::VEC3 VEC3 ; typedef typename PFP::VEC3 VEC3 ;
...@@ -85,7 +85,7 @@ float computeHaussdorf(typename PFP::MAP& map, const typename PFP::TVEC3& origin ...@@ -85,7 +85,7 @@ float computeHaussdorf(typename PFP::MAP& map, const typename PFP::TVEC3& origin
} }
template <typename PFP> template <typename PFP>
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<typename PFP::VEC3, VERTEX>& position, AttributeHandler<typename PFP::VEC3, VERTEX>& position2, const AttributeHandler<typename PFP::VEC3, VERTEX>& normal, const FunctorSelect& select = allDarts)
{ {
typedef typename PFP::VEC3 VEC3 ; typedef typename PFP::VEC3 VEC3 ;
......
...@@ -46,7 +46,7 @@ namespace Geometry ...@@ -46,7 +46,7 @@ namespace Geometry
* @param true if the faces of the volume must be in CCW order (default=true) * @param true if the faces of the volume must be in CCW order (default=true)
*/ */
template <typename PFP> template <typename PFP>
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<typename PFP::VEC3, VERTEX>& positions, bool CCW, unsigned int thread=0);
/** /**
* test if a point is inside a volume * 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 ...@@ -55,7 +55,7 @@ bool isConvex(typename PFP::MAP& map, Dart d, const typename PFP::TVEC3& positio
* @param the point * @param the point
*/ */
template <typename PFP> template <typename PFP>
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<typename PFP::VEC3, VERTEX>& positions, const typename PFP::VEC3& point);
/** /**
* test if a point is inside a volume * test if a point is inside a volume
...@@ -64,7 +64,7 @@ bool isPointInVolume(typename PFP::MAP& map, Dart d, const typename PFP::TVEC3& ...@@ -64,7 +64,7 @@ bool isPointInVolume(typename PFP::MAP& map, Dart d, const typename PFP::TVEC3&
* @param the point * @param the point
*/ */
template <typename PFP> template <typename PFP>
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<typename PFP::VEC3, VERTEX>& positions, const typename PFP::VEC3& point, bool CCW=true);
/** /**
* test if a point is inside a face in a plane * 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 ...@@ -73,7 +73,7 @@ bool isPointInConvexVolume(typename PFP::MAP& map, Dart d, const typename PFP::T
* @param the point * @param the point
*/ */
template <typename PFP> template <typename PFP>
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<typename PFP::VEC3, VERTEX>& positions, const typename PFP::VEC3& point, bool CCW=true);
/** /**
* test if a point is inside a face * test if a point is inside a face
...@@ -82,7 +82,7 @@ bool isPointInConvexFace2D(typename PFP::MAP& map, Dart d, const typename PFP::T ...@@ -82,7 +82,7 @@ bool isPointInConvexFace2D(typename PFP::MAP& map, Dart d, const typename PFP::T
* @param the point * @param the point
*/ */
template <typename PFP> template <typename PFP>
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<typename PFP::VEC3, VERTEX>& positions, const typename PFP::VEC3& point, bool CCW);
/** /**
* test if a point is on an edge * test if a point is on an edge
...@@ -91,7 +91,7 @@ bool isPointInConvexFace(typename PFP::MAP& map, Dart d, const typename PFP::TVE ...@@ -91,7 +91,7 @@ bool isPointInConvexFace(typename PFP::MAP& map, Dart d, const typename PFP::TVE
* @param the point * @param the point
*/ */
template <typename PFP> template <typename PFP>
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<typename PFP::VEC3, VERTEX>& positions, const typename PFP::VEC3& point);
/** /**