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 };
template <typename PFP, typename T>
void filterAverageAttribute_OneRing(
typename PFP::MAP& map,
const AttributeHandler<T>& attIn,
AttributeHandler<T>& attOut,
const AttributeHandler<T, VERTEX>& attIn,
AttributeHandler<T, VERTEX>& attOut,
int neigh,
const FunctorSelect& select = allDarts)
{
FunctorAverage<T> fa(attIn) ;
FunctorAverage<T, VERTEX> fa(attIn) ;
Algo::Selection::Collector_OneRing<PFP> col(map) ;
TraversorV<typename PFP::MAP> t(map, select) ;
......@@ -86,14 +86,14 @@ void filterAverageAttribute_OneRing(
template <typename PFP, typename T>
void filterAverageVertexAttribute_WithinSphere(
typename PFP::MAP& map,
const AttributeHandler<T>& attIn,
AttributeHandler<T>& attOut,
const AttributeHandler<T, VERTEX>& attIn,
AttributeHandler<T, VERTEX>& attOut,
int neigh,
typename PFP::TVEC3 & position,
AttributeHandler<typename PFP::VEC3, VERTEX>& position,
typename PFP::REAL radius,
const FunctorSelect& select = allDarts)
{
FunctorAverage<T> faInside(attIn) ;
FunctorAverage<T, VERTEX> faInside(attIn) ;
FunctorAverageOnSphereBorder<PFP, T> faBorder(map, attIn, position) ;
Algo::Selection::Collector_WithinSphere<PFP> col(map, position, radius) ;
......@@ -128,14 +128,14 @@ void filterAverageVertexAttribute_WithinSphere(
template <typename PFP, typename T>
void filterAverageEdgeAttribute_WithinSphere(
typename PFP::MAP& map,
const AttributeHandler<T>& attIn,
AttributeHandler<T>& attOut,
const AttributeHandler<T, EDGE>& attIn,
AttributeHandler<T, EDGE>& attOut,
int neigh,
typename PFP::TVEC3 & position,
AttributeHandler<typename PFP::VEC3, VERTEX>& position,
typename PFP::REAL radius,
const FunctorSelect& select = allDarts)
{
FunctorAverage<T> fa(attIn) ;
FunctorAverage<T, EDGE> fa(attIn) ;
Algo::Selection::Collector_WithinSphere<PFP> col(map, position, radius) ;
TraversorE<typename PFP::MAP> t(map, select) ;
......@@ -156,14 +156,14 @@ void filterAverageEdgeAttribute_WithinSphere(
template <typename PFP, typename T>
void filterAverageFaceAttribute_WithinSphere(
typename PFP::MAP& map,
const AttributeHandler<T>& attIn,
AttributeHandler<T>& attOut,
const AttributeHandler<T, FACE>& attIn,
AttributeHandler<T, FACE>& attOut,
int neigh,
typename PFP::TVEC3 & position,
AttributeHandler<typename PFP::VEC3, VERTEX>& position,
typename PFP::REAL radius,
const FunctorSelect& select = allDarts)
{
FunctorAverage<T> fa(attIn) ;
FunctorAverage<T, FACE> fa(attIn) ;
Algo::Selection::Collector_WithinSphere<PFP> col(map, position, radius) ;
TraversorF<typename PFP::MAP> t(map, select) ;
......
......@@ -41,12 +41,12 @@ namespace Filtering
template <typename PFP>
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<typename PFP::VEC3, VERTEX>& position,
AttributeHandler<typename PFP::VEC3, VERTEX>& position2,
const AttributeHandler<typename PFP::REAL, FACE>& faceArea,
const AttributeHandler<typename PFP::VEC3, FACE>& faceCentroid,
const AttributeHandler<typename PFP::VEC3, FACE>& faceNormal,
const AttributeHandler<typename PFP::VEC3, FACE>& faceNewNormal,
const FunctorSelect& select)
{
typedef typename PFP::VEC3 VEC3 ;
......@@ -75,20 +75,20 @@ void computeNewPositionsFromFaceNormals(
}
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::REAL REAL ;
AutoAttributeHandler<REAL> faceArea(map, FACE, "faceArea") ;
AutoAttributeHandler<VEC3> faceNormal(map, FACE, "faceNormal") ;
AutoAttributeHandler<VEC3> faceCentroid(map, FACE, "faceCentroid") ;
AutoAttributeHandler<REAL, FACE> faceArea(map, "faceArea") ;
AutoAttributeHandler<VEC3, FACE> faceNormal(map, "faceNormal") ;
AutoAttributeHandler<VEC3, FACE> faceCentroid(map, "faceCentroid") ;
Algo::Geometry::computeAreaFaces<PFP>(map, position, faceArea, select) ;
Algo::Geometry::computeNormalFaces<PFP>(map, position, faceNormal, select) ;
Algo::Geometry::computeCentroidFaces<PFP>(map, position, faceCentroid, select) ;
AutoAttributeHandler<VEC3> faceNewNormal(map, FACE, "faceNewNormal") ;
AutoAttributeHandler<VEC3, FACE> faceNewNormal(map, "faceNewNormal") ;
// Compute new normals
TraversorF<typename PFP::MAP> tf(map, select) ;
......@@ -119,20 +119,20 @@ void filterAverageNormals(typename PFP::MAP& map, const typename PFP::TVEC3& pos
}
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::REAL REAL ;
AutoAttributeHandler<REAL> faceArea(map, FACE, "faceArea") ;
AutoAttributeHandler<VEC3> faceNormal(map, FACE, "faceNormal") ;
AutoAttributeHandler<VEC3> faceCentroid(map, FACE, "faceCentroid") ;
AutoAttributeHandler<REAL, FACE> faceArea(map, "faceArea") ;
AutoAttributeHandler<VEC3, FACE> faceNormal(map, "faceNormal") ;
AutoAttributeHandler<VEC3, FACE> faceCentroid(map, "faceCentroid") ;
Algo::Geometry::computeAreaFaces<PFP>(map, position, faceArea, select) ;
Algo::Geometry::computeNormalFaces<PFP>(map, position, faceNormal, select) ;
Algo::Geometry::computeCentroidFaces<PFP>(map, position, faceCentroid, select) ;
AutoAttributeHandler<VEC3> faceNewNormal(map, FACE, "faceNewNormal") ;
AutoAttributeHandler<VEC3, FACE> faceNewNormal(map, "faceNewNormal") ;
// Compute new normals
TraversorF<typename PFP::MAP> tf(map, select) ;
......@@ -204,20 +204,20 @@ void filterMMSE(typename PFP::MAP& map, float sigmaN2, const typename PFP::TVEC3
}
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::REAL REAL ;
AutoAttributeHandler<REAL> faceArea(map, FACE, "faceArea") ;
AutoAttributeHandler<VEC3> faceNormal(map, FACE, "faceNormal") ;
AutoAttributeHandler<VEC3> faceCentroid(map, FACE, "faceCentroid") ;
AutoAttributeHandler<REAL, FACE> faceArea(map, "faceArea") ;
AutoAttributeHandler<VEC3, FACE> faceNormal(map, "faceNormal") ;
AutoAttributeHandler<VEC3, FACE> faceCentroid(map, "faceCentroid") ;
Algo::Geometry::computeAreaFaces<PFP>(map, position, faceArea, select) ;
Algo::Geometry::computeNormalFaces<PFP>(map, position, faceNormal, select) ;
Algo::Geometry::computeCentroidFaces<PFP>(map, position, faceCentroid, select) ;
AutoAttributeHandler<VEC3> faceNewNormal(map, FACE, "faceNewNormal") ;
AutoAttributeHandler<VEC3, FACE> 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 <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::REAL REAL ;
AutoAttributeHandler<REAL> faceArea(map, FACE, "faceArea") ;
AutoAttributeHandler<VEC3> faceNormal(map, FACE, "faceNormal") ;
AutoAttributeHandler<VEC3> faceCentroid(map, FACE, "faceCentroid") ;
AutoAttributeHandler<REAL, FACE> faceArea(map, "faceArea") ;
AutoAttributeHandler<VEC3, FACE> faceNormal(map, "faceNormal") ;
AutoAttributeHandler<VEC3, FACE> faceCentroid(map, "faceCentroid") ;
Algo::Geometry::computeAreaFaces<PFP>(map, position, faceArea, select) ;
Algo::Geometry::computeNormalFaces<PFP>(map, position, faceNormal, select) ;
Algo::Geometry::computeCentroidFaces<PFP>(map, position, faceCentroid, select) ;
AutoAttributeHandler<REAL> vertexArea(map, VERTEX, "vertexArea") ;
AutoAttributeHandler<VEC3> faceNewNormal(map, FACE, "faceNewNormal") ;
AutoAttributeHandler<VEC3> vertexNewNormal(map, VERTEX, "vertexNewNormal") ;
AutoAttributeHandler<REAL, VERTEX> vertexArea(map, "vertexArea") ;
AutoAttributeHandler<VEC3, FACE> faceNewNormal(map, "faceNewNormal") ;
AutoAttributeHandler<VEC3, VERTEX> vertexNewNormal(map, "vertexNewNormal") ;
long nbTot = 0 ;
long nbAdapt = 0 ;
......
......@@ -35,7 +35,7 @@ namespace Filtering
{
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 ;
......@@ -57,7 +57,7 @@ void sigmaBilateral(typename PFP::MAP& map, const typename PFP::TVEC3& position,
}
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 ;
......@@ -93,7 +93,7 @@ void filterBilateral(typename PFP::MAP& map, const typename PFP::TVEC3& position
}
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 ;
......
......@@ -37,15 +37,16 @@ namespace Algo
namespace Filtering
{
template <typename T>
template <typename T, unsigned int ORBIT>
class FunctorAverage : public virtual FunctorType
{
protected:
const AttributeHandler<T>& attr ;
const AttributeHandler<T, ORBIT>& attr ;
T sum ;
unsigned int count ;
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)
{
......@@ -63,15 +64,17 @@ template <typename PFP, typename T>
class FunctorAverageOnSphereBorder : public FunctorMap<typename PFP::MAP>
{
typedef typename PFP::VEC3 VEC3;
protected:
const AttributeHandler<T>& attr ;
const AttributeHandler<VEC3>& position ;
const AttributeHandler<T, VERTEX>& attr ;
const AttributeHandler<VEC3, VERTEX>& position ;
VEC3 center;
typename PFP::REAL radius;
T sum ;
unsigned int count ;
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)
{
center = VEC3(0);
......
......@@ -35,7 +35,7 @@ namespace Filtering
{
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 ;
......@@ -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<VERTEX> mv(map) ;
FunctorAverage<VEC3> fa1(position) ;
FunctorAverage<VEC3, VERTEX> 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<VEC3> fa2(position2) ;
FunctorAverage<VEC3, VERTEX> 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 <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 ;
const float lambda = 0.6307 ;
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) ;
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<PFP, typename PFP::VEC3> fa2(map, position2, position2) ;
FunctorAverageOnSphereBorder<PFP, VEC3> fa2(map, position2, position2) ;
Algo::Selection::Collector_WithinSphere<PFP> c2(map, position2, radius) ;
for(Dart d = map.begin(); d != map.end(); map.next(d))
{
......
......@@ -38,7 +38,7 @@ namespace Filtering
{
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 ;
......@@ -85,7 +85,7 @@ float computeHaussdorf(typename PFP::MAP& map, const typename PFP::TVEC3& origin
}
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 ;
......
......@@ -46,7 +46,7 @@ namespace Geometry
* @param true if the faces of the volume must be in CCW order (default=true)
*/
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
......@@ -55,7 +55,7 @@ bool isConvex(typename PFP::MAP& map, Dart d, const typename PFP::TVEC3& positio
* @param the point
*/
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
......@@ -64,7 +64,7 @@ bool isPointInVolume(typename PFP::MAP& map, Dart d, const typename PFP::TVEC3&
* @param the point
*/
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
......@@ -73,7 +73,7 @@ bool isPointInConvexVolume(typename PFP::MAP& map, Dart d, const typename PFP::T
* @param the point
*/
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
......@@ -82,7 +82,7 @@ bool isPointInConvexFace2D(typename PFP::MAP& map, Dart d, const typename PFP::T
* @param the point
*/
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
......@@ -91,7 +91,7 @@ bool isPointInConvexFace(typename PFP::MAP& map, Dart d, const typename PFP::TVE
* @param the point
*/
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);
/**
* 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 <typename PFP>
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<typename PFP::VEC3, VERTEX>& 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 <typename PFP>
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<typename PFP::VEC3, VERTEX>& 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 <typename PFP>
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<typename PFP::VEC3, VERTEX>& positions, const typename PFP::VEC3 points[4], bool CCW);
} // namespace Geometry
......
......@@ -39,7 +39,7 @@ namespace Geometry
{
template <typename PFP>
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<typename PFP::VEC3, VERTEX>& position, bool CCW, unsigned int thread)
{
//get all the dart of the volume
std::vector<Dart> vStore;
......@@ -63,7 +63,7 @@ bool isConvex(typename PFP::MAP& map, Dart d, const typename PFP::TVEC3& positio
}
template <typename PFP>
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<typename PFP::VEC3, VERTEX>& 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 <typename PFP>
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<typename PFP::VEC3, VERTEX>& 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 <typename PFP>
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<typename PFP::VEC3, VERTEX>& 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 <typename PFP>
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<typename PFP::VEC3, VERTEX>& 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 <typename PFP>
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<typename PFP::VEC3, VERTEX>& 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 <typename PFP>
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<typename PFP::VEC3, VERTEX>& 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 <typename PFP>
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<typename PFP::VEC3, VERTEX>& position, const typename PFP::VEC3& point)
{
return Geom::arePointsEquals(point, position[d]);
}
template <typename PFP>
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<typename PFP::VEC3, VERTEX>& position, const typename PFP::VEC3 points[4], bool CCW)
{
typedef typename PFP::VEC3 VEC3 ;
......
......@@ -46,7 +46,7 @@ namespace Geometry
* @return true if segment intersects the face
*/
template <typename PFP>
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<typename PFP::VEC3, VERTEX>& 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 <typename PFP>
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<typename PFP::VEC3, VERTEX>& 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 <typename PFP>
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<typename PFP::VEC3, VERTEX>& 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 <typename PFP>
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<typename PFP::VEC3, VERTEX>& position, typename PFP::REAL& alpha) ;
} // namespace Geometry
......
......@@ -41,7 +41,7 @@ namespace Geometry
{
template <typename PFP>
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<typename PFP::VEC3, VERTEX>& 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 <typename PFP>
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<typename PFP::VEC3, VERTEX>& 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 <typename PFP>
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<typename PFP::VEC3, VERTEX>& position)
{
typedef typename PFP::VEC3 VEC3 ;
......@@ -228,7 +228,7 @@ bool areTrianglesInIntersection(typename PFP::MAP& map, Dart tri1, Dart tri2, co
}
template <typename PFP>
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<typename PFP::VEC3, VERTEX>& position, typename PFP::REAL& alpha)
{
typedef typename PFP::VEC3 VEC3 ;
typedef typename PFP::REAL REAL ;
......
......@@ -38,7 +38,7 @@ namespace Geometry
{
template <typename PFP>
bool isTetrahedronWellOriented(typename PFP::MAP& map, Dart d, const typename PFP::TVEC3& positions, bool CCW)
bool isTetrahedronWellOriented(typename PFP::MAP& map