Commit 0ba912f1 authored by Pierre Kraemer's avatar Pierre Kraemer
Browse files

orbit as template -> decimation OK

parent adbc0c85
...@@ -87,32 +87,32 @@ public: ...@@ -87,32 +87,32 @@ public:
protected: protected:
Predictor<PFP, T>* m_predictor ; Predictor<PFP, T>* m_predictor ;
AttributeHandler<T>& m_attrV ; // vertex attribute to be approximated AttributeHandler<T, VERTEX>& m_attrV ; // vertex attribute to be approximated
AttributeHandler<T> m_approx ; // attribute to store approximation result AttributeHandler<T, EDGE> m_approx ; // attribute to store approximation result
AttributeHandler<T> m_detail ; // attribute to store detail information for reconstruction AttributeHandler<T, EDGE> m_detail ; // attribute to store detail information for reconstruction
T m_app ; T m_app ;
public: public:
Approximator(MAP& m, AttributeHandler<T>& a, unsigned int orbit, Predictor<PFP, T>* predictor) : Approximator(MAP& m, AttributeHandler<T, VERTEX>& a, Predictor<PFP, T>* predictor) :
ApproximatorGen<PFP>(m), m_predictor(predictor), m_attrV(a) ApproximatorGen<PFP>(m), m_predictor(predictor), m_attrV(a)
{ {
std::stringstream aname ; std::stringstream aname ;
aname << "approx_" << m_attrV.name() ; aname << "approx_" << m_attrV.name() ;
m_approx = this->m_map.template addAttribute<T>(orbit, aname.str()) ; m_approx = this->m_map.template addAttribute<T, EDGE>(aname.str()) ;
if(m_predictor) // if a predictor is associated to the approximator if(m_predictor) // if a predictor is associated to the approximator
{ // create an attribute to store the detail needed for reconstruction { // create an attribute to store the detail needed for reconstruction
std::stringstream dname ; std::stringstream dname ;
dname << "detail_" << m_attrV.name() ; dname << "detail_" << m_attrV.name() ;
m_detail = this->m_map.template addAttribute<T>(orbit, dname.str()) ; m_detail = this->m_map.template addAttribute<T, EDGE>(dname.str()) ;
} }
} }
virtual ~Approximator() virtual ~Approximator()
{ {
this->m_map.template removeAttribute<T>(m_approx) ; this->m_map.template removeAttribute(m_approx) ;
if(m_predictor) if(m_predictor)
this->m_map.template removeAttribute<T>(m_detail) ; this->m_map.template removeAttribute(m_detail) ;
} }
const std::string& getApproximatedAttributeName() const const std::string& getApproximatedAttributeName() const
......
...@@ -44,7 +44,7 @@ void decimate( ...@@ -44,7 +44,7 @@ void decimate(
typename PFP::MAP& map, typename PFP::MAP& map,
SelectorType s, SelectorType s,
ApproximatorType a, ApproximatorType a,
typename PFP::TVEC3& position, AttributeHandler<typename PFP::VEC3, VERTEX>& position,
unsigned int nbWantedVertices, unsigned int nbWantedVertices,
const FunctorSelect& selected = allDarts const FunctorSelect& selected = allDarts
) ; ) ;
......
...@@ -34,7 +34,7 @@ namespace Decimation ...@@ -34,7 +34,7 @@ namespace Decimation
template <typename PFP> template <typename PFP>
void decimate( void decimate(
typename PFP::MAP& map, SelectorType s, ApproximatorType a, typename PFP::MAP& map, SelectorType s, ApproximatorType a,
typename PFP::TVEC3& position, unsigned int nbWantedVertices, const FunctorSelect& selected AttributeHandler<typename PFP::VEC3, VERTEX>& position, unsigned int nbWantedVertices, const FunctorSelect& selected
) )
{ {
std::vector<ApproximatorGen<PFP>*> approximators ; std::vector<ApproximatorGen<PFP>*> approximators ;
...@@ -88,8 +88,8 @@ void decimate( ...@@ -88,8 +88,8 @@ void decimate(
CGoGNerr << "In function decimate : colorPTM[" << i << "] is not valid" << CGoGNendl ; CGoGNerr << "In function decimate : colorPTM[" << i << "] is not valid" << CGoGNendl ;
} }
*/ */
AttributeHandler<Geom::Matrix<3,3,typename PFP::REAL> > frame = map.template getAttribute<Geom::Matrix<3,3,typename PFP::REAL> >(VERTEX, "frame") ; AttributeHandler<Geom::Matrix<3,3,typename PFP::REAL>, VERTEX> frame = map.template getAttribute<Geom::Matrix<3,3,typename PFP::REAL>, VERTEX>("frame") ;
AttributeHandler<Geom::Matrix<3,6,typename PFP::REAL> > RGBfunctions = map.template getAttribute<Geom::Matrix<3,6,typename PFP::REAL> >(VERTEX, "colorPTM") ; AttributeHandler<Geom::Matrix<3,6,typename PFP::REAL>, VERTEX> RGBfunctions = map.template getAttribute<Geom::Matrix<3,6,typename PFP::REAL>, VERTEX>("colorPTM") ;
approximators.push_back(new Approximator_Frame<PFP>(map, frame)) ; approximators.push_back(new Approximator_Frame<PFP>(map, frame)) ;
approximators.push_back(new Approximator_RGBfunctions<PFP>(map, RGBfunctions)) ; approximators.push_back(new Approximator_RGBfunctions<PFP>(map, RGBfunctions)) ;
break ; break ;
...@@ -97,8 +97,8 @@ void decimate( ...@@ -97,8 +97,8 @@ void decimate(
case A_LightfieldHalf : case A_LightfieldHalf :
{ {
approximators.push_back(new Approximator_HalfCollapse<PFP>(map, position)) ; approximators.push_back(new Approximator_HalfCollapse<PFP>(map, position)) ;
AttributeHandler<Geom::Matrix<3,3,typename PFP::REAL> > frame = map.template getAttribute<Geom::Matrix<3,3,typename PFP::REAL> >(VERTEX, "frame") ; AttributeHandler<Geom::Matrix<3,3,typename PFP::REAL>, VERTEX> frame = map.template getAttribute<Geom::Matrix<3,3,typename PFP::REAL>, VERTEX>("frame") ;
AttributeHandler<Geom::Matrix<3,6,typename PFP::REAL> > RGBfunctions = map.template getAttribute<Geom::Matrix<3,6,typename PFP::REAL> >(VERTEX, "colorPTM") ; AttributeHandler<Geom::Matrix<3,6,typename PFP::REAL>, VERTEX> RGBfunctions = map.template getAttribute<Geom::Matrix<3,6,typename PFP::REAL>, VERTEX>("colorPTM") ;
approximators.push_back(new Approximator_FrameHalf<PFP>(map, frame)) ; approximators.push_back(new Approximator_FrameHalf<PFP>(map, frame)) ;
approximators.push_back(new Approximator_RGBfunctionsHalf<PFP>(map, RGBfunctions)) ; approximators.push_back(new Approximator_RGBfunctionsHalf<PFP>(map, RGBfunctions)) ;
break ; break ;
...@@ -142,7 +142,7 @@ void decimate( ...@@ -142,7 +142,7 @@ void decimate(
if(!selector->init()) if(!selector->init())
return ; return ;
unsigned int nbVertices = map.getNbOrbits<VERTEX>() ; unsigned int nbVertices = map.template getNbOrbits<VERTEX>() ;
bool finished = false ; bool finished = false ;
Dart d ; Dart d ;
......
...@@ -54,7 +54,7 @@ private: ...@@ -54,7 +54,7 @@ private:
Dart cur ; Dart cur ;
public: public:
EdgeSelector_MapOrder(MAP& m, typename PFP::TVEC3& pos, std::vector<ApproximatorGen<PFP>*>& approx, const FunctorSelect& select) : EdgeSelector_MapOrder(MAP& m, AttributeHandler<typename PFP::VEC3, VERTEX>& pos, std::vector<ApproximatorGen<PFP>*>& approx, const FunctorSelect& select) :
EdgeSelector<PFP>(m, pos, approx, select) EdgeSelector<PFP>(m, pos, approx, select)
{} {}
~EdgeSelector_MapOrder() ~EdgeSelector_MapOrder()
...@@ -81,7 +81,7 @@ private: ...@@ -81,7 +81,7 @@ private:
bool allSkipped ; bool allSkipped ;
public: public:
EdgeSelector_Random(MAP& m, typename PFP::TVEC3& pos, std::vector<ApproximatorGen<PFP>*>& approx, const FunctorSelect& select) : EdgeSelector_Random(MAP& m, AttributeHandler<typename PFP::VEC3, VERTEX>& pos, std::vector<ApproximatorGen<PFP>*>& approx, const FunctorSelect& select) :
EdgeSelector<PFP>(m, pos, approx, select) EdgeSelector<PFP>(m, pos, approx, select)
{} {}
~EdgeSelector_Random() ~EdgeSelector_Random()
...@@ -111,7 +111,7 @@ private: ...@@ -111,7 +111,7 @@ private:
} LengthEdgeInfo ; } LengthEdgeInfo ;
typedef NoMathIOAttribute<LengthEdgeInfo> EdgeInfo ; typedef NoMathIOAttribute<LengthEdgeInfo> EdgeInfo ;
AttributeHandler<EdgeInfo> edgeInfo ; AttributeHandler<EdgeInfo, EDGE> edgeInfo ;
std::multimap<float,Dart> edges ; std::multimap<float,Dart> edges ;
typename std::multimap<float,Dart>::iterator cur ; typename std::multimap<float,Dart>::iterator cur ;
...@@ -121,10 +121,10 @@ private: ...@@ -121,10 +121,10 @@ private:
void computeEdgeInfo(Dart d, EdgeInfo& einfo) ; void computeEdgeInfo(Dart d, EdgeInfo& einfo) ;
public: public:
EdgeSelector_Length(MAP& m, typename PFP::TVEC3& pos, std::vector<ApproximatorGen<PFP>*>& approx, const FunctorSelect& select) : EdgeSelector_Length(MAP& m, AttributeHandler<typename PFP::VEC3, VERTEX>& pos, std::vector<ApproximatorGen<PFP>*>& approx, const FunctorSelect& select) :
EdgeSelector<PFP>(m, pos, approx, select) EdgeSelector<PFP>(m, pos, approx, select)
{ {
edgeInfo = m.template addAttribute<EdgeInfo>(EDGE, "edgeInfo") ; edgeInfo = m.template addAttribute<EdgeInfo, EDGE>("edgeInfo") ;
} }
~EdgeSelector_Length() ~EdgeSelector_Length()
{ {
...@@ -154,8 +154,8 @@ private: ...@@ -154,8 +154,8 @@ private:
} QEMedgeInfo ; } QEMedgeInfo ;
typedef NoMathIOAttribute<QEMedgeInfo> EdgeInfo ; typedef NoMathIOAttribute<QEMedgeInfo> EdgeInfo ;
AttributeHandler<EdgeInfo> edgeInfo ; AttributeHandler<EdgeInfo, EDGE> edgeInfo ;
AttributeHandler<Quadric<REAL> > quadric ; AttributeHandler<Quadric<REAL>, VERTEX> quadric ;
Quadric<REAL> tmpQ ; Quadric<REAL> tmpQ ;
std::multimap<float,Dart> edges ; std::multimap<float,Dart> edges ;
...@@ -168,11 +168,11 @@ private: ...@@ -168,11 +168,11 @@ private:
void computeEdgeInfo(Dart d, EdgeInfo& einfo) ; void computeEdgeInfo(Dart d, EdgeInfo& einfo) ;
public: public:
EdgeSelector_QEM(MAP& m, typename PFP::TVEC3& pos, std::vector<ApproximatorGen<PFP>*>& approx, const FunctorSelect& select) : EdgeSelector_QEM(MAP& m, AttributeHandler<typename PFP::VEC3, VERTEX>& pos, std::vector<ApproximatorGen<PFP>*>& approx, const FunctorSelect& select) :
EdgeSelector<PFP>(m, pos, approx, select) EdgeSelector<PFP>(m, pos, approx, select)
{ {
edgeInfo = m.template addAttribute<EdgeInfo>(EDGE, "edgeInfo") ; edgeInfo = m.template addAttribute<EdgeInfo, EDGE>("edgeInfo") ;
quadric = m.template addAttribute<Quadric<REAL> >(VERTEX, "QEMquadric") ; quadric = m.template addAttribute<Quadric<REAL>, VERTEX>("QEMquadric") ;
} }
~EdgeSelector_QEM() ~EdgeSelector_QEM()
{ {
...@@ -203,8 +203,8 @@ private: ...@@ -203,8 +203,8 @@ private:
} QEMedgeInfo ; } QEMedgeInfo ;
typedef NoMathIOAttribute<QEMedgeInfo> EdgeInfo ; typedef NoMathIOAttribute<QEMedgeInfo> EdgeInfo ;
AttributeHandler<EdgeInfo> edgeInfo ; AttributeHandler<EdgeInfo, EDGE> edgeInfo ;
AttributeHandler<Quadric<REAL> > quadric ; AttributeHandler<Quadric<REAL>, VERTEX> quadric ;
std::multimap<float,Dart> edges ; std::multimap<float,Dart> edges ;
typename std::multimap<float,Dart>::iterator cur ; typename std::multimap<float,Dart>::iterator cur ;
...@@ -217,11 +217,11 @@ private: ...@@ -217,11 +217,11 @@ private:
void recomputeQuadric(const Dart d, const bool recomputeNeighbors = false) ; void recomputeQuadric(const Dart d, const bool recomputeNeighbors = false) ;
public: public:
EdgeSelector_QEMml(MAP& m, typename PFP::TVEC3& pos, std::vector<ApproximatorGen<PFP>*>& approx, const FunctorSelect& select) : EdgeSelector_QEMml(MAP& m, AttributeHandler<typename PFP::VEC3, VERTEX>& pos, std::vector<ApproximatorGen<PFP>*>& approx, const FunctorSelect& select) :
EdgeSelector<PFP>(m, pos, approx, select) EdgeSelector<PFP>(m, pos, approx, select)
{ {
edgeInfo = m.template addAttribute<EdgeInfo>(EDGE, "edgeInfo") ; edgeInfo = m.template addAttribute<EdgeInfo, EDGE>("edgeInfo") ;
quadric = m.template addAttribute<Quadric<REAL> >(VERTEX, "QEMquadric") ; quadric = m.template addAttribute<Quadric<REAL>, VERTEX>("QEMquadric") ;
} }
~EdgeSelector_QEMml() ~EdgeSelector_QEMml()
{ {
...@@ -255,63 +255,63 @@ private: ...@@ -255,63 +255,63 @@ private:
Geom::BoundingBox<VEC3> bb ; Geom::BoundingBox<VEC3> bb ;
REAL radius ; REAL radius ;
typename PFP::TVEC3 normal ; AttributeHandler<VEC3, VERTEX> normal ;
AttributeHandler<EdgeInfo> edgeInfo ; AttributeHandler<EdgeInfo, EDGE> edgeInfo ;
typename PFP::TREAL edgeangle ; AttributeHandler<REAL, EDGE> edgeangle ;
typename PFP::TREAL kmax ; AttributeHandler<REAL, VERTEX> kmax ;
typename PFP::TREAL kmin ; AttributeHandler<REAL, VERTEX> kmin ;
typename PFP::TVEC3 Kmax ; AttributeHandler<VEC3, VERTEX> Kmax ;
typename PFP::TVEC3 Kmin ; AttributeHandler<VEC3, VERTEX> Kmin ;
typename PFP::TVEC3 Knormal ; AttributeHandler<VEC3, VERTEX> Knormal ;
std::multimap<float,Dart> edges ; std::multimap<float,Dart> edges ;
typename std::multimap<float,Dart>::iterator cur ; typename std::multimap<float,Dart>::iterator cur ;
Approximator<PFP, typename PFP::VEC3>* m_positionApproximator ; Approximator<PFP, VEC3>* m_positionApproximator ;
void initEdgeInfo(Dart d) ; void initEdgeInfo(Dart d) ;
void updateEdgeInfo(Dart d, bool recompute) ; void updateEdgeInfo(Dart d, bool recompute) ;
void computeEdgeInfo(Dart d, EdgeInfo& einfo) ; void computeEdgeInfo(Dart d, EdgeInfo& einfo) ;
public: public:
EdgeSelector_Curvature(MAP& m, typename PFP::TVEC3& pos, std::vector<ApproximatorGen<PFP>*>& approx, const FunctorSelect& select) : EdgeSelector_Curvature(MAP& m, AttributeHandler<VEC3, VERTEX>& pos, std::vector<ApproximatorGen<PFP>*>& approx, const FunctorSelect& select) :
EdgeSelector<PFP>(m, pos, approx, select) EdgeSelector<PFP>(m, pos, approx, select)
{ {
bb = Algo::Geometry::computeBoundingBox<PFP>(m, pos) ; bb = Algo::Geometry::computeBoundingBox<PFP>(m, pos) ;
radius = bb.diagSize() * 0.003 ; radius = bb.diagSize() * 0.003 ;
normal = m.template getAttribute<VEC3>(VERTEX, "normal") ; normal = m.template getAttribute<VEC3, VERTEX>("normal") ;
if(!normal.isValid()) if(!normal.isValid())
{ {
normal = m.template addAttribute<VEC3>(VERTEX, "normal") ; normal = m.template addAttribute<VEC3, VERTEX>("normal") ;
Algo::Geometry::computeNormalVertices<PFP>(m, pos, normal) ; Algo::Geometry::computeNormalVertices<PFP>(m, pos, normal) ;
} }
edgeangle = m.template getAttribute<REAL>(EDGE, "edgeangle") ; edgeangle = m.template getAttribute<REAL, EDGE>("edgeangle") ;
if(!edgeangle.isValid()) if(!edgeangle.isValid())
{ {
edgeangle = m.template addAttribute<REAL>(EDGE, "edgeangle") ; edgeangle = m.template addAttribute<REAL, EDGE>("edgeangle") ;
Algo::Geometry::computeAnglesBetweenNormalsOnEdges<PFP>(m, pos, edgeangle) ; Algo::Geometry::computeAnglesBetweenNormalsOnEdges<PFP>(m, pos, edgeangle) ;
} }
kmax = m.template getAttribute<REAL>(VERTEX, "kmax") ; kmax = m.template getAttribute<REAL, VERTEX>("kmax") ;
kmin = m.template getAttribute<REAL>(VERTEX, "kmin") ; kmin = m.template getAttribute<REAL, VERTEX>("kmin") ;
Kmax = m.template getAttribute<VEC3>(VERTEX, "Kmax") ; Kmax = m.template getAttribute<VEC3, VERTEX>("Kmax") ;
Kmin = m.template getAttribute<VEC3>(VERTEX, "Kmin") ; Kmin = m.template getAttribute<VEC3, VERTEX>("Kmin") ;
Knormal = m.template getAttribute<VEC3>(VERTEX, "Knormal") ; Knormal = m.template getAttribute<VEC3, VERTEX>("Knormal") ;
// as all these attributes are computed simultaneously by computeCurvatureVertices // 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 // one can assume that if one of them is not valid, the others must be created too
if(!kmax.isValid()) if(!kmax.isValid())
{ {
kmax = m.template addAttribute<REAL>(VERTEX, "kmax") ; kmax = m.template addAttribute<REAL, VERTEX>("kmax") ;
kmin = m.template addAttribute<REAL>(VERTEX, "kmin") ; kmin = m.template addAttribute<REAL, VERTEX>("kmin") ;
Kmax = m.template addAttribute<VEC3>(VERTEX, "Kmax") ; Kmax = m.template addAttribute<VEC3, VERTEX>("Kmax") ;
Kmin = m.template addAttribute<VEC3>(VERTEX, "Kmin") ; Kmin = m.template addAttribute<VEC3, VERTEX>("Kmin") ;
Knormal = m.template addAttribute<VEC3>(VERTEX, "Knormal") ; Knormal = m.template addAttribute<VEC3, VERTEX>("Knormal") ;
Algo::Geometry::computeCurvatureVertices_NormalCycles<PFP>(m, radius, pos, normal, edgeangle, kmax, kmin, Kmax, Kmin, Knormal) ; Algo::Geometry::computeCurvatureVertices_NormalCycles<PFP>(m, radius, pos, normal, edgeangle, kmax, kmin, Kmax, Kmin, Knormal) ;
} }
edgeInfo = m.template addAttribute<EdgeInfo>(EDGE, "edgeInfo") ; edgeInfo = m.template addAttribute<EdgeInfo, EDGE>("edgeInfo") ;
} }
~EdgeSelector_Curvature() ~EdgeSelector_Curvature()
{ {
...@@ -347,7 +347,7 @@ private: ...@@ -347,7 +347,7 @@ private:
} MinDetailEdgeInfo ; } MinDetailEdgeInfo ;
typedef NoMathIOAttribute<MinDetailEdgeInfo> EdgeInfo ; typedef NoMathIOAttribute<MinDetailEdgeInfo> EdgeInfo ;
AttributeHandler<EdgeInfo> edgeInfo ; AttributeHandler<EdgeInfo, EDGE> edgeInfo ;
std::multimap<float,Dart> edges ; std::multimap<float,Dart> edges ;
typename std::multimap<float,Dart>::iterator cur ; typename std::multimap<float,Dart>::iterator cur ;
...@@ -359,10 +359,10 @@ private: ...@@ -359,10 +359,10 @@ private:
void computeEdgeInfo(Dart d, EdgeInfo& einfo) ; void computeEdgeInfo(Dart d, EdgeInfo& einfo) ;
public: public:
EdgeSelector_MinDetail(MAP& m, typename PFP::TVEC3& pos, std::vector<ApproximatorGen<PFP>*>& approx, const FunctorSelect& select) : EdgeSelector_MinDetail(MAP& m, AttributeHandler<typename PFP::VEC3, VERTEX>& pos, std::vector<ApproximatorGen<PFP>*>& approx, const FunctorSelect& select) :
EdgeSelector<PFP>(m, pos, approx, select) EdgeSelector<PFP>(m, pos, approx, select)
{ {
edgeInfo = m.template addAttribute<EdgeInfo>(EDGE, "edgeInfo") ; edgeInfo = m.template addAttribute<EdgeInfo, EDGE>("edgeInfo") ;
} }
~EdgeSelector_MinDetail() ~EdgeSelector_MinDetail()
{ {
......
...@@ -137,7 +137,7 @@ bool EdgeSelector_Length<PFP>::init() ...@@ -137,7 +137,7 @@ bool EdgeSelector_Length<PFP>::init()
edges.clear() ; edges.clear() ;
CellMarker eMark(m, EDGE) ; CellMarker<EDGE> eMark(m) ;
for(Dart d = m.begin(); d != m.end(); m.next(d)) for(Dart d = m.begin(); d != m.end(); m.next(d))
{ {
if(!eMark.isMarked(d)) if(!eMark.isMarked(d))
...@@ -300,7 +300,7 @@ bool EdgeSelector_QEM<PFP>::init() ...@@ -300,7 +300,7 @@ bool EdgeSelector_QEM<PFP>::init()
edges.clear() ; edges.clear() ;
CellMarker vMark(m, VERTEX) ; CellMarker<VERTEX> vMark(m) ;
for(Dart d = m.begin(); d != m.end(); m.next(d)) for(Dart d = m.begin(); d != m.end(); m.next(d))
{ {
if(!vMark.isMarked(d)) if(!vMark.isMarked(d))
...@@ -326,7 +326,7 @@ bool EdgeSelector_QEM<PFP>::init() ...@@ -326,7 +326,7 @@ bool EdgeSelector_QEM<PFP>::init()
} }
} }
CellMarker eMark(m, EDGE) ; CellMarker<EDGE> eMark(m) ;
for(Dart d = m.begin(); d != m.end(); m.next(d)) for(Dart d = m.begin(); d != m.end(); m.next(d))
{ {
if(!eMark.isMarked(d)) if(!eMark.isMarked(d))
...@@ -505,7 +505,7 @@ bool EdgeSelector_QEMml<PFP>::init() ...@@ -505,7 +505,7 @@ bool EdgeSelector_QEMml<PFP>::init()
edges.clear() ; edges.clear() ;
CellMarker vMark(m, VERTEX) ; CellMarker<VERTEX> vMark(m) ;
for(Dart d = m.begin(); d != m.end(); m.next(d)) for(Dart d = m.begin(); d != m.end(); m.next(d))
{ {
if(!vMark.isMarked(d)) if(!vMark.isMarked(d))
...@@ -531,7 +531,7 @@ bool EdgeSelector_QEMml<PFP>::init() ...@@ -531,7 +531,7 @@ bool EdgeSelector_QEMml<PFP>::init()
} }
} }
CellMarker eMark(m, EDGE) ; CellMarker<EDGE> eMark(m) ;
for(Dart d = m.begin(); d != m.end(); m.next(d)) for(Dart d = m.begin(); d != m.end(); m.next(d))
{ {
if(!eMark.isMarked(d)) if(!eMark.isMarked(d))
...@@ -735,7 +735,7 @@ bool EdgeSelector_Curvature<PFP>::init() ...@@ -735,7 +735,7 @@ bool EdgeSelector_Curvature<PFP>::init()
edges.clear() ; edges.clear() ;
CellMarker eMark(m, EDGE) ; CellMarker<EDGE> eMark(m) ;
for(Dart d = m.begin(); d != m.end(); m.next(d)) for(Dart d = m.begin(); d != m.end(); m.next(d))
{ {
if(!eMark.isMarked(d)) if(!eMark.isMarked(d))
...@@ -877,8 +877,8 @@ void EdgeSelector_Curvature<PFP>::computeEdgeInfo(Dart d, EdgeInfo& einfo) ...@@ -877,8 +877,8 @@ void EdgeSelector_Curvature<PFP>::computeEdgeInfo(Dart d, EdgeInfo& einfo)
MAP& m = this->m_map ; MAP& m = this->m_map ;
Dart dd = m.phi2(d) ; Dart dd = m.phi2(d) ;
unsigned int v1 = m.getEmbedding<VERTEX>(d) ; unsigned int v1 = m.template getEmbedding<VERTEX>(d) ;
unsigned int v2 = m.getEmbedding<VERTEX>(dd) ; unsigned int v2 = m.template getEmbedding<VERTEX>(dd) ;
m_positionApproximator->approximate(d) ; m_positionApproximator->approximate(d) ;
...@@ -886,7 +886,7 @@ void EdgeSelector_Curvature<PFP>::computeEdgeInfo(Dart d, EdgeInfo& einfo) ...@@ -886,7 +886,7 @@ void EdgeSelector_Curvature<PFP>::computeEdgeInfo(Dart d, EdgeInfo& einfo)
Dart d2 = m.phi2(m.phi_1(d)) ; Dart d2 = m.phi2(m.phi_1(d)) ;
Dart dd2 = m.phi2(m.phi_1(dd)) ; Dart dd2 = m.phi2(m.phi_1(dd)) ;
m.extractTrianglePair(d) ; m.extractTrianglePair(d) ;
unsigned int newV = m.embedNewCell<VERTEX>(d2) ; unsigned int newV = m.template embedNewCell<VERTEX>(d2) ;
this->m_position[newV] = m_positionApproximator->getApprox(d) ; this->m_position[newV] = m_positionApproximator->getApprox(d) ;
// compute things on the coarse version of the mesh // compute things on the coarse version of the mesh
...@@ -899,8 +899,8 @@ void EdgeSelector_Curvature<PFP>::computeEdgeInfo(Dart d, EdgeInfo& einfo) ...@@ -899,8 +899,8 @@ void EdgeSelector_Curvature<PFP>::computeEdgeInfo(Dart d, EdgeInfo& einfo)
// vertex split to reset the initial connectivity and embeddings // vertex split to reset the initial connectivity and embeddings
m.insertTrianglePair(d, d2, dd2) ; m.insertTrianglePair(d, d2, dd2) ;
m.embedOrbit<VERTEX>(d, v1) ; m.template embedOrbit<VERTEX>(d, v1) ;
m.embedOrbit<VERTEX>(dd, v2) ; m.template embedOrbit<VERTEX>(dd, v2) ;
REAL err = 0 ; REAL err = 0 ;
...@@ -946,7 +946,7 @@ bool EdgeSelector_MinDetail<PFP>::init() ...@@ -946,7 +946,7 @@ bool EdgeSelector_MinDetail<PFP>::init()
edges.clear() ; edges.clear() ;
CellMarker eMark(m, EDGE) ; CellMarker<EDGE> eMark(m) ;
for(Dart d = m.begin(); d != m.end(); m.next(d)) for(Dart d = m.begin(); d != m.end(); m.next(d))
{ {
if(!eMark.isMarked(d)) if(!eMark.isMarked(d))
......
...@@ -45,11 +45,11 @@ public: ...@@ -45,11 +45,11 @@ public:
typedef typename PFP::REAL REAL ; typedef typename PFP::REAL REAL ;
protected: protected:
AttributeHandler<Quadric<REAL> > m_quadric ; AttributeHandler<Quadric<REAL>, VERTEX> m_quadric ;
public: public:
Approximator_QEM(MAP& m, AttributeHandler<VEC3>& pos, Predictor<PFP, VEC3>* pred = NULL) : Approximator_QEM(MAP& m, AttributeHandler<VEC3, VERTEX>& pos, Predictor<PFP, VEC3>* pred = NULL) :
Approximator<PFP, VEC3>(m, pos, EDGE, pred) Approximator<PFP, VEC3>(m, pos, pred)
{} {}
~Approximator_QEM() ~Approximator_QEM()