Commit c6d8c4e1 authored by Kenneth Vanhoey's avatar Kenneth Vanhoey

Merge cgogn:~cgogn/CGoGN

parents 4e5e69b1 695d8500
......@@ -186,7 +186,6 @@ void Viewer::importMesh(std::string& filename)
m_render->initPrimitives<PFP>(myMap, allDarts, Algo::Render::GL2::TRIANGLES) ;
bb = Algo::Geometry::computeBoundingBox<PFP>(myMap, position) ;
gPosObj = bb.center() ;
normalBaseSize = bb.diagSize() / 100.0f ;
vertexBaseSize = normalBaseSize * 2.0f ;
......@@ -198,7 +197,7 @@ void Viewer::importMesh(std::string& filename)
m_positionVBO->updateData(position) ;
m_normalVBO->updateData(normal) ;
setParamObject(bb.maxSize(), gPosObj.data()) ;
setParamObject(bb.maxSize(), bb.center().data()) ;
updateGLMatrices() ;
}
......
......@@ -78,7 +78,6 @@ public:
float shininess ;
Geom::BoundingBox<PFP::VEC3> bb ;
Geom::Vec3f gPosObj ;
float normalBaseSize ;
float normalScaleFactor ;
float vertexBaseSize ;
......
......@@ -27,6 +27,11 @@
#include "Algo/Decimation/selector.h"
#include "Container/fakeAttribute.h"
#include "Utils/qem.h"
#include "Utils/quadricRGBfunctions.h"
#include "Algo/Geometry/curvature.h"
namespace CGoGN
{
......@@ -246,12 +251,17 @@ private:
} CurvatureEdgeInfo ;
typedef NoMathIOAttribute<CurvatureEdgeInfo> EdgeInfo ;
Geom::BoundingBox<VEC3> bb ;
REAL radius ;
typename PFP::TVEC3 normal ;
AttributeHandler<EdgeInfo> edgeInfo ;
typename PFP::TREAL k1 ;
typename PFP::TREAL k2 ;
typename PFP::TVEC3 K1 ;
typename PFP::TVEC3 K2 ;
typename PFP::TREAL edgeangle ;
typename PFP::TREAL kmax ;
typename PFP::TREAL kmin ;
typename PFP::TVEC3 Kmax ;
typename PFP::TVEC3 Kmin ;
typename PFP::TVEC3 Knormal ;
std::multimap<float,Dart> edges ;
typename std::multimap<float,Dart>::iterator cur ;
......@@ -266,6 +276,9 @@ public:
EdgeSelector_Curvature(MAP& m, typename PFP::TVEC3& pos, std::vector<ApproximatorGen<PFP>*>& approx, const FunctorSelect& select = SelectorTrue()) :
EdgeSelector<PFP>(m, pos, approx, select)
{
bb = Algo::Geometry::computeBoundingBox<PFP>(m, pos) ;
radius = bb.diagSize() * 0.003 ;
normal = m.template getAttribute<VEC3>(VERTEX, "normal") ;
if(!normal.isValid())
{
......@@ -273,29 +286,40 @@ public:
Algo::Geometry::computeNormalVertices<PFP>(m, pos, normal) ;
}
k1 = m.template getAttribute<REAL>(VERTEX, "k1") ;
k2 = m.template getAttribute<REAL>(VERTEX, "k2") ;
K1 = m.template getAttribute<VEC3>(VERTEX, "K1") ;
K2 = m.template getAttribute<VEC3>(VERTEX, "K2") ;
edgeangle = m.template getAttribute<REAL>(VERTEX, "edgeangle") ;
if(!edgeangle.isValid())
{
edgeangle = m.template addAttribute<REAL>(EDGE, "edgeangle") ;
Algo::Geometry::computeAnglesBetweenNormalsOnEdges<PFP>(m, pos, edgeangle) ;
}
kmax = m.template getAttribute<REAL>(VERTEX, "kmax") ;
kmin = m.template getAttribute<REAL>(VERTEX, "kmin") ;
Kmax = m.template getAttribute<VEC3>(VERTEX, "Kmax") ;
Kmin = m.template getAttribute<VEC3>(VERTEX, "Kmin") ;
Knormal = m.template getAttribute<VEC3>(VERTEX, "Knormal") ;
// as all these attributes are computed simultaneously by computeCurvatureVertices
// one can assume that if one of them is not valid, the others must be created too
if(!k1.isValid())
if(!kmax.isValid())
{
k1 = m.template addAttribute<REAL>(VERTEX, "k1") ;
k2 = m.template addAttribute<REAL>(VERTEX, "k2") ;
K1 = m.template addAttribute<VEC3>(VERTEX, "K1") ;
K2 = m.template addAttribute<VEC3>(VERTEX, "K2") ;
Algo::Geometry::computeCurvatureVertices<PFP>(m, this->m_position, normal, k1, k2, K1, K2) ;
kmax = m.template addAttribute<REAL>(VERTEX, "kmax") ;
kmin = m.template addAttribute<REAL>(VERTEX, "kmin") ;
Kmax = m.template addAttribute<VEC3>(VERTEX, "Kmax") ;
Kmin = m.template addAttribute<VEC3>(VERTEX, "Kmin") ;
Knormal = m.template addAttribute<VEC3>(VERTEX, "Knormal") ;
Algo::Geometry::computeCurvatureVertices_NormalCycles<PFP>(m, radius, pos, normal, edgeangle, kmax, kmin, Kmax, Kmin, Knormal) ;
}
edgeInfo = m.template addAttribute<EdgeInfo>(EDGE, "edgeInfo") ;
}
~EdgeSelector_Curvature()
{
this->m_map.removeAttribute(k1) ;
this->m_map.removeAttribute(k2) ;
this->m_map.removeAttribute(K1) ;
this->m_map.removeAttribute(K2) ;
this->m_map.removeAttribute(edgeangle) ;
this->m_map.removeAttribute(kmax) ;
this->m_map.removeAttribute(kmin) ;
this->m_map.removeAttribute(Kmax) ;
this->m_map.removeAttribute(Kmin) ;
this->m_map.removeAttribute(Knormal) ;
this->m_map.removeAttribute(edgeInfo) ;
}
SelectorType getType() { return S_Curvature ; }
......
......@@ -795,14 +795,14 @@ void EdgeSelector_Curvature<PFP>::updateAfterCollapse(Dart d2, Dart dd2)
MAP& m = this->m_map ;
normal[d2] = Algo::Geometry::vertexNormal<PFP>(m, d2, this->m_position) ;
Algo::Geometry::computeCurvatureVertex<PFP>(m, d2, this->m_position, normal, k1, k2, K1, K2) ;
Algo::Geometry::computeCurvatureVertex_NormalCycles<PFP>(m, d2, radius, this->m_position, normal, edgeangle, kmax, kmin, Kmax, Kmin, Knormal) ;
Dart vit = d2 ;
do
{
Dart nVert = m.phi1(vit) ;
normal[nVert] = Algo::Geometry::vertexNormal<PFP>(m, nVert, this->m_position) ;
Algo::Geometry::computeCurvatureVertex<PFP>(m, nVert, this->m_position, normal, k1, k2, K1, K2) ;
Algo::Geometry::computeCurvatureVertex_NormalCycles<PFP>(m, nVert, radius, this->m_position, normal, edgeangle, kmax, kmin, Kmax, Kmin, Knormal) ;
updateEdgeInfo(m.phi1(vit), false) ; // must recompute some edge infos in the
if(vit == d2 || vit == dd2) // neighborhood of the collapsed edge
......@@ -891,11 +891,11 @@ void EdgeSelector_Curvature<PFP>::computeEdgeInfo(Dart d, EdgeInfo& einfo)
// compute things on the coarse version of the mesh
normal[newV] = Algo::Geometry::vertexNormal<PFP>(m, d2, this->m_position) ;
Algo::Geometry::computeCurvatureVertex<PFP>(m, d2, this->m_position, normal, k1, k2, K1, K2) ;
Algo::Geometry::computeCurvatureVertex_NormalCycles<PFP>(m, d2, radius, this->m_position, normal, edgeangle, kmax, kmin, Kmax, Kmin, Knormal) ;
VEC3 norm = normal[newV] ;
REAL mCurv = ( k1[newV] + k2[newV] ) / REAL(2) ;
VEC3 cDir1 = K1[newV] ;
// VEC3 norm = normal[newV] ;
REAL mCurv = (kmax[newV] + kmin[newV]) / REAL(2) ;
// VEC3 cDir1 = Kmax[newV] ;
// vertex split to reset the initial connectivity and embeddings
m.insertTrianglePair(d, d2, dd2) ;
......@@ -904,17 +904,17 @@ void EdgeSelector_Curvature<PFP>::computeEdgeInfo(Dart d, EdgeInfo& einfo)
REAL err = 0 ;
REAL norm_deviation_1 = REAL(1) / abs(norm * normal[v1]) ;
REAL norm_deviation_2 = REAL(1) / abs(norm * normal[v2]) ;
err += norm_deviation_1 + norm_deviation_2 ;
// REAL norm_deviation_1 = REAL(1) / abs(norm * normal[v1]) ;
// REAL norm_deviation_2 = REAL(1) / abs(norm * normal[v2]) ;
// err += norm_deviation_1 + norm_deviation_2 ;
REAL mCurv_deviation_1 = abs(mCurv - (k1[v1] + k2[v1] / REAL(2))) ;
REAL mCurv_deviation_2 = abs(mCurv - (k1[v2] + k2[v2] / REAL(2))) ;
REAL mCurv_deviation_1 = abs(mCurv - (kmax[v1] + kmin[v1] / REAL(2))) ;
REAL mCurv_deviation_2 = abs(mCurv - (kmax[v2] + kmin[v2] / REAL(2))) ;
err += mCurv_deviation_1 + mCurv_deviation_2 ;
REAL cDir1_deviation_1 = REAL(1) / abs(cDir1 * K1[v1]) ;
REAL cDir1_deviation_2 = REAL(1) / abs(cDir1 * K1[v2]) ;
err += cDir1_deviation_1 + cDir1_deviation_2 ;
// REAL cDir1_deviation_1 = REAL(1) / abs(cDir1 * Kmax[v1]) ;
// REAL cDir1_deviation_2 = REAL(1) / abs(cDir1 * Kmax[v2]) ;
// err += cDir1_deviation_1 + cDir1_deviation_2 ;
einfo.it = edges.insert(std::make_pair(err, d)) ;
einfo.valid = true ;
......
......@@ -25,11 +25,6 @@
#ifndef __SELECTOR_H__
#define __SELECTOR_H__
#include "Utils/qem.h"
#include "Utils/quadricRGBfunctions.h"
#include "Container/fakeAttribute.h"
#include "Algo/Geometry/curvature.h"
namespace CGoGN
{
......@@ -39,7 +34,6 @@ namespace Algo
namespace Decimation
{
enum SelectorType
{
S_MapOrder,
......@@ -53,11 +47,9 @@ enum SelectorType
S_hLightfield
} ;
template <typename PFP> class ApproximatorGen ;
template <typename PFP, typename T> class Approximator ;
template <typename PFP>
class EdgeSelector
{
......@@ -91,5 +83,4 @@ public:
} // namespace CGoGN
#endif
......@@ -30,7 +30,7 @@ namespace CGoGN
namespace Algo
{
namespace Filters2D
namespace Filtering
{
/**
......@@ -48,7 +48,6 @@ void computeNewPositionsFromFaceNormals(
const typename PFP::TVEC3& faceNewNormal,
const FunctorSelect& select)
{
typedef typename PFP::MAP MAP ;
typedef typename PFP::VEC3 VEC3 ;
typedef typename PFP::REAL REAL ;
......@@ -70,9 +69,7 @@ void computeNewPositionsFromFaceNormals(
{
sumAreas += faceArea[dd] ;
VEC3 vT = faceCentroid[dd] - pos_d ;
const VEC3& normal = faceNewNormal[dd] ;
REAL scal = vT * normal ;
vT = scal * faceNormal[dd] ;
vT = (vT * faceNewNormal[dd]) * faceNormal[dd] ;
displ += faceArea[dd] * vT ;
dd = map.phi1(map.phi2(dd)) ;
} while(dd != d) ;
......@@ -84,9 +81,8 @@ void computeNewPositionsFromFaceNormals(
template <typename PFP>
void filterAverageNormals(typename PFP::MAP& map, const typename PFP::TVEC3& position, typename PFP::TVEC3& position2, const FunctorSelect& select)
void filterAverageNormals(typename PFP::MAP& map, const typename PFP::TVEC3& position, typename PFP::TVEC3& position2, const FunctorSelect& select = SelectorTrue())
{
typedef typename PFP::MAP MAP ;
typedef typename PFP::VEC3 VEC3 ;
typedef typename PFP::REAL REAL ;
......@@ -148,9 +144,8 @@ 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)
void filterMMSE(typename PFP::MAP& map, float sigmaN2, const typename PFP::TVEC3& position, typename PFP::TVEC3& position2, const FunctorSelect& select = SelectorTrue())
{
typedef typename PFP::MAP MAP ;
typedef typename PFP::VEC3 VEC3 ;
typedef typename PFP::REAL REAL ;
......@@ -252,9 +247,8 @@ 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)
void filterTNBA(typename PFP::MAP& map, float sigmaN2, float SUSANthreshold, const typename PFP::TVEC3& position, typename PFP::TVEC3& position2, const FunctorSelect& select = SelectorTrue())
{
typedef typename PFP::MAP MAP ;
typedef typename PFP::VEC3 VEC3 ;
typedef typename PFP::REAL REAL ;
......@@ -392,9 +386,8 @@ 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)
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 = SelectorTrue())
{
typedef typename PFP::MAP MAP ;
typedef typename PFP::VEC3 VEC3 ;
typedef typename PFP::REAL REAL ;
......@@ -550,7 +543,7 @@ void filterVNBA(typename PFP::MAP& map, float sigmaN2, float SUSANthreshold, con
// CGoGNout <<" adaptive rate = "<< float(nbAdapt)/float(nbTot)<<CGoGNendl;
}
} //namespace Filters2D
} //namespace Filtering
} //namespace Algo
......
......@@ -22,20 +22,26 @@
* *
*******************************************************************************/
#include "Algo/Filtering/functors.h"
#include "Algo/Selection/collector.h"
namespace CGoGN
{
namespace Algo
{
namespace Filters2D
namespace Filtering
{
template <typename PFP>
void filterAverage(typename PFP::MAP& map, const typename PFP::TVEC3& position, typename PFP::TVEC3& position2, const FunctorSelect& select)
void filterAveragePositions(typename PFP::MAP& map, const typename PFP::TVEC3& position, typename PFP::TVEC3& position2, const FunctorSelect& select = SelectorTrue())
{
typedef typename PFP::VEC3 VEC3 ;
FunctorAverage<typename PFP::MAP, typename PFP::VEC3> fa(map, position) ;
Algo::Selection::Collector_OneRing<PFP> c(map) ;
CellMarker markV(map, VERTEX);
for(Dart d = map.begin(); d != map.end(); map.next(d))
{
......@@ -43,30 +49,16 @@ void filterAverage(typename PFP::MAP& map, const typename PFP::TVEC3& position,
{
markV.mark(d);
// get position of vertex
const VEC3& pos_d = position[d] ;
// traversal of neighbour vertices
VEC3 l(0) ;
int nbE = 0 ;
Dart dd = d ;
do
{
Dart e = map.phi2(dd) ;
l += position[e] - pos_d ;
nbE++ ;
dd = map.phi1(e) ;
} while(dd != d) ;
l /= float(nbE) ;
position2[d] = pos_d + l ;
c.collectBorder(d) ;
fa.reset() ;
c.applyOnBorder(fa) ;
position2[d] = fa.getAverage() ;
}
}
}
} //namespace Filters2D
} // namespace Filtering
} //namespace Algo
} // namespace Algo
} //namespace CGoGN
} // namespace CGoGN
......@@ -30,7 +30,7 @@ namespace CGoGN
namespace Algo
{
namespace Filters2D
namespace Filtering
{
......@@ -57,8 +57,7 @@ void sigmaBilateral(typename PFP::MAP& map, const typename PFP::TVEC3& position,
Dart e = map.phi2(dd) ;
if(!mv.isMarked(e))
{
VEC3 vec = Algo::Geometry::vectorOutOfDart<PFP>(map, dd, position) ;
sumLengths += vec.norm() ;
sumLengths += Algo::Geometry::edgeLength<PFP>(map, dd, position) ;
sumAngles += Geom::angle(normal[d], normal[e]) ;
++nbEdges ;
}
......@@ -74,7 +73,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)
void filterBilateral(typename PFP::MAP& map, const typename PFP::TVEC3& position, typename PFP::TVEC3& position2, const typename PFP::TVEC3& normal, const FunctorSelect& select = SelectorTrue())
{
typedef typename PFP::VEC3 VEC3 ;
......@@ -112,7 +111,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)
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 = SelectorTrue())
{
typedef typename PFP::VEC3 VEC3 ;
......@@ -171,7 +170,7 @@ void filterSUSAN(typename PFP::MAP& map, float SUSANthreshold, const typename PF
// CGoGNout <<" susan rate = "<< float(nbSusan)/float(nbTot)<<CGoGNendl;
}
} //namespace Filters2D
} //namespace Filtering
} //namespace Algo
......
......@@ -22,50 +22,92 @@
* *
*******************************************************************************/
#include "Algo/Filtering/functors.h"
#include "Algo/Selection/collector.h"
namespace CGoGN
{
namespace Algo
{
namespace Filters2D
namespace Filtering
{
template <typename PFP>
void filterTaubin(typename PFP::MAP& map, typename PFP::TVEC3& position, typename PFP::TVEC3& position2, const FunctorSelect& select = SelectorTrue())
{
typedef typename PFP::VEC3 VEC3 ;
FunctorAverage<typename PFP::MAP, typename PFP::VEC3> fa(map, position) ;
Algo::Selection::Collector_OneRing<PFP> c(map) ;
const float lambda = 0.6307 ;
const float mu = -0.6732 ;
CellMarkerNoUnmark mv(map, VERTEX) ;
for(Dart d = map.begin(); d != map.end(); map.next(d))
{
if(select(d) && !mv.isMarked(d))
{
mv.mark(d);
c.collectBorder(d) ;
fa.reset() ;
c.applyOnBorder(fa) ;
VEC3 p = position[d] ;
VEC3 displ = fa.getAverage() - p ;
displ *= lambda ;
position2[d] = p + displ ;
}
}
// unshrinking step
for(Dart d = map.begin(); d != map.end(); map.next(d))
{
if(select(d) && mv.isMarked(d))
{
mv.unmark(d);
c.collectBorder(d) ;
fa.reset() ;
c.applyOnBorder(fa) ;
VEC3 p = position2[d] ;
VEC3 displ = fa.getAverage() - p ;
displ *= mu ;
position[d] = p + displ ;
}
}
}
/**
* Taubin filter modified as proposed by [Lav09]
*/
template <typename PFP>
void filterTaubin(typename PFP::MAP& map, typename PFP::TVEC3& position, typename PFP::TVEC3& position2, const FunctorSelect& select)
void filterTaubin_modified(typename PFP::MAP& map, typename PFP::TVEC3& position, typename PFP::TVEC3& position2, const FunctorSelect& select = SelectorTrue())
{
typedef typename PFP::VEC3 VEC3 ;
FunctorAverage<typename PFP::MAP, typename PFP::VEC3> fa(map, position) ;
Algo::Selection::Collector_OneRing<PFP> c(map) ;
const float lambda = 0.6307 ;
const float mu = -0.6732 ;
CellMarkerNoUnmark mv(map, VERTEX);
CellMarkerNoUnmark mv(map, VERTEX) ;
for(Dart d = map.begin(); d != map.end(); map.next(d))
{
if(select(d) && !mv.isMarked(d))
{
mv.mark(d);
// get pos of vertex
const VEC3& pos_d = position[d] ;
// traversal of vertices neighborhood
VEC3 l(0) ;
int nbE = 0 ;
Dart dd = d ;
do
{
Dart e = map.phi2(dd) ;
l += position[e] - pos_d ;
nbE++ ;
dd = map.phi1(e) ;
} while(dd != d) ;
l /= float(nbE) ;
l *= lambda ;
position2[d] = pos_d + l ;
c.collectBorder(d) ;
fa.reset() ;
c.applyOnBorder(fa) ;
VEC3 p = position[d] ;
VEC3 displ = fa.getAverage() - p ;
displ *= lambda ;
position2[d] = p + displ ;
}
}
......@@ -76,31 +118,19 @@ void filterTaubin(typename PFP::MAP& map, typename PFP::TVEC3& position, typenam
{
mv.unmark(d);
// get pos of vertex
const VEC3& pos_d = position2[d] ;
// traversal of vertices neighborhood
VEC3 l(0) ;
int nbE = 0 ;
Dart dd = d ;
do
{
Dart e = map.phi2(dd) ;
l += position2[e] - pos_d ;
nbE++ ;
dd = map.phi1(e) ;
} while(dd != d) ;
l /= float(nbE) ;
l *= mu ;
position[d] = pos_d + l ;
c.collectBorder(d) ;
fa.reset() ;
c.applyOnBorder(fa) ;
VEC3 p = position2[d] ;
VEC3 displ = fa.getAverage() - p ;
displ *= mu ;
position[d] = p + displ ;
}
}
}
} //namespace Filters2D
} // namespace Filtering
} //namespace Algo
} // namespace Algo
} //namespace CGoGN
} // namespace CGoGN
......@@ -34,11 +34,11 @@ namespace CGoGN
namespace Algo
{
namespace Filters2D
namespace Filtering
{
template <typename PFP>
float computeHaussdorf(typename PFP::MAP& map, const typename PFP::TVEC3& originalPosition, const typename PFP::TVEC3& position2, const FunctorSelect& select)
float computeHaussdorf(typename PFP::MAP& map, const typename PFP::TVEC3& originalPosition, const typename PFP::TVEC3& position2, const FunctorSelect& select = SelectorTrue())
{
typedef typename PFP::VEC3 VEC3 ;
......@@ -92,7 +92,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)
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 = SelectorTrue())
{
typedef typename PFP::VEC3 VEC3 ;
......@@ -143,7 +143,7 @@ void computeNoise(typename PFP::MAP& map, long amount, const typename PFP::TVEC3
}
}
} //namespace Filters2D
} //namespace Filtering
} //namespace Algo
......
/*******************************************************************************
* CGoGN: Combinatorial and Geometric modeling with Generic N-dimensional Maps *
* version 0.1 *
* Copyright (C) 2009-2011, IGG Team, LSIIT, University of Strasbourg *
* *
* This library is free software; you can redistribute it and/or modify it *
* under the terms of the GNU Lesser General Public License as published by the *
* Free Software Foundation; either version 2.1 of the License, or (at your *
* option) any later version. *
* *
* This library is distributed in the hope that it will be useful, but WITHOUT *
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or *
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License *
* for more details. *
* *
* You should have received a copy of the GNU Lesser General Public License *
* along with this library; if not, write to the Free Software Foundation, *
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *
* *
* Web site: http://cgogn.u-strasbg.fr/ *
* Contact information: cgogn@unistra.fr *
* *
*******************************************************************************/
#ifndef __FILTERS_2D__
#define __FILTERS_2D__
namespace CGoGN
{
namespace Algo
{
namespace Filters2D
{
enum Filters { AVERAGE, TAUBIN, BILATERAL, AVERAGE_NORMAL, MMSE, SUSAN, TNBA, VNBA } ;
/**
* Average filter need:
* vertex embedding with position & position2
*/
template <typename PFP>
void filterAverage(typename PFP::MAP& map, const typename PFP::TVEC3& position, typename PFP::TVEC3& position2, const FunctorSelect& select = SelectorTrue()) ;
/**
* Taubin filter need:
* vertex embedding with position & position2
*/