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

orbit as template -> decimation OK

parent adbc0c85
......@@ -87,32 +87,32 @@ public:
protected:
Predictor<PFP, T>* m_predictor ;
AttributeHandler<T>& m_attrV ; // vertex attribute to be approximated
AttributeHandler<T> m_approx ; // attribute to store approximation result
AttributeHandler<T> m_detail ; // attribute to store detail information for reconstruction
AttributeHandler<T, VERTEX>& m_attrV ; // vertex attribute to be approximated
AttributeHandler<T, EDGE> m_approx ; // attribute to store approximation result
AttributeHandler<T, EDGE> m_detail ; // attribute to store detail information for reconstruction
T m_app ;
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)
{
std::stringstream aname ;
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
{ // create an attribute to store the detail needed for reconstruction
std::stringstream dname ;
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()
{
this->m_map.template removeAttribute<T>(m_approx) ;
this->m_map.template removeAttribute(m_approx) ;
if(m_predictor)
this->m_map.template removeAttribute<T>(m_detail) ;
this->m_map.template removeAttribute(m_detail) ;
}
const std::string& getApproximatedAttributeName() const
......
......@@ -44,7 +44,7 @@ void decimate(
typename PFP::MAP& map,
SelectorType s,
ApproximatorType a,
typename PFP::TVEC3& position,
AttributeHandler<typename PFP::VEC3, VERTEX>& position,
unsigned int nbWantedVertices,
const FunctorSelect& selected = allDarts
) ;
......
......@@ -34,7 +34,7 @@ namespace Decimation
template <typename PFP>
void decimate(
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 ;
......@@ -88,8 +88,8 @@ void decimate(
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,6,typename PFP::REAL> > RGBfunctions = map.template getAttribute<Geom::Matrix<3,6,typename PFP::REAL> >(VERTEX, "colorPTM") ;
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>, 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_RGBfunctions<PFP>(map, RGBfunctions)) ;
break ;
......@@ -97,8 +97,8 @@ void decimate(
case A_LightfieldHalf :
{
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,6,typename PFP::REAL> > RGBfunctions = map.template getAttribute<Geom::Matrix<3,6,typename PFP::REAL> >(VERTEX, "colorPTM") ;
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>, 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_RGBfunctionsHalf<PFP>(map, RGBfunctions)) ;
break ;
......@@ -142,7 +142,7 @@ void decimate(
if(!selector->init())
return ;
unsigned int nbVertices = map.getNbOrbits<VERTEX>() ;
unsigned int nbVertices = map.template getNbOrbits<VERTEX>() ;
bool finished = false ;
Dart d ;
......
......@@ -54,7 +54,7 @@ private:
Dart cur ;
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_MapOrder()
......@@ -81,7 +81,7 @@ private:
bool allSkipped ;
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_Random()
......@@ -111,7 +111,7 @@ private:
} LengthEdgeInfo ;
typedef NoMathIOAttribute<LengthEdgeInfo> EdgeInfo ;
AttributeHandler<EdgeInfo> edgeInfo ;
AttributeHandler<EdgeInfo, EDGE> edgeInfo ;
std::multimap<float,Dart> edges ;
typename std::multimap<float,Dart>::iterator cur ;
......@@ -121,10 +121,10 @@ private:
void computeEdgeInfo(Dart d, EdgeInfo& einfo) ;
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)
{
edgeInfo = m.template addAttribute<EdgeInfo>(EDGE, "edgeInfo") ;
edgeInfo = m.template addAttribute<EdgeInfo, EDGE>("edgeInfo") ;
}
~EdgeSelector_Length()
{
......@@ -154,8 +154,8 @@ private:
} QEMedgeInfo ;
typedef NoMathIOAttribute<QEMedgeInfo> EdgeInfo ;
AttributeHandler<EdgeInfo> edgeInfo ;
AttributeHandler<Quadric<REAL> > quadric ;
AttributeHandler<EdgeInfo, EDGE> edgeInfo ;
AttributeHandler<Quadric<REAL>, VERTEX> quadric ;
Quadric<REAL> tmpQ ;
std::multimap<float,Dart> edges ;
......@@ -168,11 +168,11 @@ private:
void computeEdgeInfo(Dart d, EdgeInfo& einfo) ;
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)
{
edgeInfo = m.template addAttribute<EdgeInfo>(EDGE, "edgeInfo") ;
quadric = m.template addAttribute<Quadric<REAL> >(VERTEX, "QEMquadric") ;
edgeInfo = m.template addAttribute<EdgeInfo, EDGE>("edgeInfo") ;
quadric = m.template addAttribute<Quadric<REAL>, VERTEX>("QEMquadric") ;
}
~EdgeSelector_QEM()
{
......@@ -203,8 +203,8 @@ private:
} QEMedgeInfo ;
typedef NoMathIOAttribute<QEMedgeInfo> EdgeInfo ;
AttributeHandler<EdgeInfo> edgeInfo ;
AttributeHandler<Quadric<REAL> > quadric ;
AttributeHandler<EdgeInfo, EDGE> edgeInfo ;
AttributeHandler<Quadric<REAL>, VERTEX> quadric ;
std::multimap<float,Dart> edges ;
typename std::multimap<float,Dart>::iterator cur ;
......@@ -217,11 +217,11 @@ private:
void recomputeQuadric(const Dart d, const bool recomputeNeighbors = false) ;
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)
{
edgeInfo = m.template addAttribute<EdgeInfo>(EDGE, "edgeInfo") ;
quadric = m.template addAttribute<Quadric<REAL> >(VERTEX, "QEMquadric") ;
edgeInfo = m.template addAttribute<EdgeInfo, EDGE>("edgeInfo") ;
quadric = m.template addAttribute<Quadric<REAL>, VERTEX>("QEMquadric") ;
}
~EdgeSelector_QEMml()
{
......@@ -255,63 +255,63 @@ private:
Geom::BoundingBox<VEC3> bb ;
REAL radius ;
typename PFP::TVEC3 normal ;
AttributeHandler<EdgeInfo> edgeInfo ;
typename PFP::TREAL edgeangle ;
typename PFP::TREAL kmax ;
typename PFP::TREAL kmin ;
typename PFP::TVEC3 Kmax ;
typename PFP::TVEC3 Kmin ;
typename PFP::TVEC3 Knormal ;
AttributeHandler<VEC3, VERTEX> normal ;
AttributeHandler<EdgeInfo, EDGE> edgeInfo ;
AttributeHandler<REAL, EDGE> edgeangle ;
AttributeHandler<REAL, VERTEX> kmax ;
AttributeHandler<REAL, VERTEX> kmin ;
AttributeHandler<VEC3, VERTEX> Kmax ;
AttributeHandler<VEC3, VERTEX> Kmin ;
AttributeHandler<VEC3, VERTEX> Knormal ;
std::multimap<float,Dart> edges ;
typename std::multimap<float,Dart>::iterator cur ;
Approximator<PFP, typename PFP::VEC3>* m_positionApproximator ;
Approximator<PFP, VEC3>* m_positionApproximator ;
void initEdgeInfo(Dart d) ;
void updateEdgeInfo(Dart d, bool recompute) ;
void computeEdgeInfo(Dart d, EdgeInfo& einfo) ;
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)
{
bb = Algo::Geometry::computeBoundingBox<PFP>(m, pos) ;
radius = bb.diagSize() * 0.003 ;
normal = m.template getAttribute<VEC3>(VERTEX, "normal") ;
normal = m.template getAttribute<VEC3, VERTEX>("normal") ;
if(!normal.isValid())
{
normal = m.template addAttribute<VEC3>(VERTEX, "normal") ;
normal = m.template addAttribute<VEC3, VERTEX>("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())
{
edgeangle = m.template addAttribute<REAL>(EDGE, "edgeangle") ;
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") ;
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(!kmax.isValid())
{
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") ;
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") ;
edgeInfo = m.template addAttribute<EdgeInfo, EDGE>("edgeInfo") ;
}
~EdgeSelector_Curvature()
{
......@@ -347,7 +347,7 @@ private:
} MinDetailEdgeInfo ;
typedef NoMathIOAttribute<MinDetailEdgeInfo> EdgeInfo ;
AttributeHandler<EdgeInfo> edgeInfo ;
AttributeHandler<EdgeInfo, EDGE> edgeInfo ;
std::multimap<float,Dart> edges ;
typename std::multimap<float,Dart>::iterator cur ;
......@@ -359,10 +359,10 @@ private:
void computeEdgeInfo(Dart d, EdgeInfo& einfo) ;
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)
{
edgeInfo = m.template addAttribute<EdgeInfo>(EDGE, "edgeInfo") ;
edgeInfo = m.template addAttribute<EdgeInfo, EDGE>("edgeInfo") ;
}
~EdgeSelector_MinDetail()
{
......
......@@ -137,7 +137,7 @@ bool EdgeSelector_Length<PFP>::init()
edges.clear() ;
CellMarker eMark(m, EDGE) ;
CellMarker<EDGE> eMark(m) ;
for(Dart d = m.begin(); d != m.end(); m.next(d))
{
if(!eMark.isMarked(d))
......@@ -300,7 +300,7 @@ bool EdgeSelector_QEM<PFP>::init()
edges.clear() ;
CellMarker vMark(m, VERTEX) ;
CellMarker<VERTEX> vMark(m) ;
for(Dart d = m.begin(); d != m.end(); m.next(d))
{
if(!vMark.isMarked(d))
......@@ -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))
{
if(!eMark.isMarked(d))
......@@ -505,7 +505,7 @@ bool EdgeSelector_QEMml<PFP>::init()
edges.clear() ;
CellMarker vMark(m, VERTEX) ;
CellMarker<VERTEX> vMark(m) ;
for(Dart d = m.begin(); d != m.end(); m.next(d))
{
if(!vMark.isMarked(d))
......@@ -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))
{
if(!eMark.isMarked(d))
......@@ -735,7 +735,7 @@ bool EdgeSelector_Curvature<PFP>::init()
edges.clear() ;
CellMarker eMark(m, EDGE) ;
CellMarker<EDGE> eMark(m) ;
for(Dart d = m.begin(); d != m.end(); m.next(d))
{
if(!eMark.isMarked(d))
......@@ -877,8 +877,8 @@ void EdgeSelector_Curvature<PFP>::computeEdgeInfo(Dart d, EdgeInfo& einfo)
MAP& m = this->m_map ;
Dart dd = m.phi2(d) ;
unsigned int v1 = m.getEmbedding<VERTEX>(d) ;
unsigned int v2 = m.getEmbedding<VERTEX>(dd) ;
unsigned int v1 = m.template getEmbedding<VERTEX>(d) ;
unsigned int v2 = m.template getEmbedding<VERTEX>(dd) ;
m_positionApproximator->approximate(d) ;
......@@ -886,7 +886,7 @@ void EdgeSelector_Curvature<PFP>::computeEdgeInfo(Dart d, EdgeInfo& einfo)
Dart d2 = m.phi2(m.phi_1(d)) ;
Dart dd2 = m.phi2(m.phi_1(dd)) ;
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) ;
// compute things on the coarse version of the mesh
......@@ -899,8 +899,8 @@ void EdgeSelector_Curvature<PFP>::computeEdgeInfo(Dart d, EdgeInfo& einfo)
// vertex split to reset the initial connectivity and embeddings
m.insertTrianglePair(d, d2, dd2) ;
m.embedOrbit<VERTEX>(d, v1) ;
m.embedOrbit<VERTEX>(dd, v2) ;
m.template embedOrbit<VERTEX>(d, v1) ;
m.template embedOrbit<VERTEX>(dd, v2) ;
REAL err = 0 ;
......@@ -946,7 +946,7 @@ bool EdgeSelector_MinDetail<PFP>::init()
edges.clear() ;
CellMarker eMark(m, EDGE) ;
CellMarker<EDGE> eMark(m) ;
for(Dart d = m.begin(); d != m.end(); m.next(d))
{
if(!eMark.isMarked(d))
......
......@@ -45,11 +45,11 @@ public:
typedef typename PFP::REAL REAL ;
protected:
AttributeHandler<Quadric<REAL> > m_quadric ;
AttributeHandler<Quadric<REAL>, VERTEX> m_quadric ;
public:
Approximator_QEM(MAP& m, AttributeHandler<VEC3>& pos, Predictor<PFP, VEC3>* pred = NULL) :
Approximator<PFP, VEC3>(m, pos, EDGE, pred)
Approximator_QEM(MAP& m, AttributeHandler<VEC3, VERTEX>& pos, Predictor<PFP, VEC3>* pred = NULL) :
Approximator<PFP, VEC3>(m, pos, pred)
{}
~Approximator_QEM()
{}
......@@ -67,11 +67,11 @@ public:
typedef typename PFP::REAL REAL ;
protected:
AttributeHandler<Quadric<REAL> > m_quadric ;
AttributeHandler<Quadric<REAL>, VERTEX> m_quadric ;
public:
Approximator_QEMhalfEdge(MAP& m, AttributeHandler<VEC3>& pos, Predictor<PFP, VEC3>* pred = NULL) :
Approximator<PFP, VEC3>(m, pos, EDGE, pred)
Approximator_QEMhalfEdge(MAP& m, AttributeHandler<VEC3, VERTEX>& pos, Predictor<PFP, VEC3>* pred = NULL) :
Approximator<PFP, VEC3>(m, pos, pred)
{}
~Approximator_QEMhalfEdge()
{}
......@@ -88,8 +88,8 @@ public:
typedef typename PFP::VEC3 VEC3 ;
typedef typename PFP::REAL REAL ;
Approximator_MidEdge(MAP& m, AttributeHandler<VEC3>& pos, Predictor<PFP, VEC3>* pred = NULL) :
Approximator<PFP, VEC3>(m, pos, EDGE, pred)
Approximator_MidEdge(MAP& m, AttributeHandler<VEC3, VERTEX>& pos, Predictor<PFP, VEC3>* pred = NULL) :
Approximator<PFP, VEC3>(m, pos, pred)
{}
~Approximator_MidEdge()
{}
......@@ -106,8 +106,8 @@ public:
typedef typename PFP::VEC3 VEC3 ;
typedef typename PFP::REAL REAL ;
Approximator_HalfCollapse(MAP& m, AttributeHandler<VEC3>& pos, Predictor<PFP, VEC3>* pred = NULL) :
Approximator<PFP, VEC3>(m, pos, EDGE, pred)
Approximator_HalfCollapse(MAP& m, AttributeHandler<VEC3, VERTEX>& pos, Predictor<PFP, VEC3>* pred = NULL) :
Approximator<PFP, VEC3>(m, pos, pred)
{}
~Approximator_HalfCollapse()
{}
......@@ -124,8 +124,8 @@ public:
typedef typename PFP::VEC3 VEC3 ;
typedef typename PFP::REAL REAL ;
Approximator_CornerCutting(MAP& m, AttributeHandler<VEC3>& pos, Predictor<PFP, VEC3>* pred = NULL) :
Approximator<PFP, VEC3>(m, pos, EDGE, pred)
Approximator_CornerCutting(MAP& m, AttributeHandler<VEC3, VERTEX>& pos, Predictor<PFP, VEC3>* pred = NULL) :
Approximator<PFP, VEC3>(m, pos, pred)
{}
~Approximator_CornerCutting()
{}
......
......@@ -38,7 +38,7 @@ namespace Decimation
template <typename PFP>
bool Approximator_QEM<PFP>::init()
{
m_quadric = this->m_map.template getAttribute<Quadric<REAL> >(VERTEX, "QEMquadric") ;
m_quadric = this->m_map.template getAttribute<Quadric<REAL>, VERTEX>("QEMquadric") ;
if(this->m_predictor)
{
......@@ -112,7 +112,7 @@ void Approximator_QEM<PFP>::approximate(Dart d)
template <typename PFP>
bool Approximator_QEMhalfEdge<PFP>::init()
{
m_quadric = this->m_map.template getAttribute<Quadric<REAL> >(VERTEX, "QEMquadric") ;
m_quadric = this->m_map.template getAttribute<Quadric<REAL>, VERTEX>("QEMquadric") ;
if(this->m_predictor)
{
......@@ -211,7 +211,7 @@ void Approximator_MidEdge<PFP>::approximate(Dart d)
// temporary edge collapse
m.extractTrianglePair(d) ;
unsigned int newV = m.embedNewCell<VERTEX>(d2) ;
unsigned int newV = m.template embedNewCell<VERTEX>(d2) ;
this->m_attrV[newV] = this->m_approx[d] ;
// compute the detail vector
......@@ -220,8 +220,8 @@ void Approximator_MidEdge<PFP>::approximate(Dart d)
// vertex split to reset the initial connectivity and embeddings
m.insertTrianglePair(d, d2, dd2) ;
m.embedOrbit<VERTEX>(d, m.getEmbedding<VERTEX>(d)) ;
m.embedOrbit<VERTEX>(dd, m.getEmbedding<VERTEX>(dd)) ;
m.template embedOrbit<VERTEX>(d, m.template getEmbedding<VERTEX>(d)) ;
m.template embedOrbit<VERTEX>(dd, m.template getEmbedding<VERTEX>(dd)) ;
}
}
......@@ -259,7 +259,7 @@ void Approximator_HalfCollapse<PFP>::approximate(Dart d)
// temporary edge collapse
m.extractTrianglePair(d) ;
unsigned int newV = m.embedNewCell<VERTEX>(d2) ;
unsigned int newV = m.template embedNewCell<VERTEX>(d2) ;
this->m_attrV[newV] = this->m_approx[d] ;
// compute the detail vector
......@@ -268,8 +268,8 @@ void Approximator_HalfCollapse<PFP>::approximate(Dart d)
// vertex split to reset the initial connectivity and embeddings
m.insertTrianglePair(d, d2, dd2) ;
m.embedOrbit<VERTEX>(d, m.getEmbedding<VERTEX>(d)) ;
m.embedOrbit<VERTEX>(dd, m.getEmbedding<VERTEX>(dd)) ;
m.template embedOrbit<VERTEX>(d, m.template getEmbedding<VERTEX>(d)) ;
m.template embedOrbit<VERTEX>(dd, m.template getEmbedding<VERTEX>(dd)) ;
}
}
......
......@@ -44,7 +44,7 @@ public:
typedef typename PFP::VEC3 VEC3 ;
typedef typename PFP::REAL REAL ;
Predictor_HalfCollapse(MAP& m, AttributeHandler<VEC3>& pos) :
Predictor_HalfCollapse(MAP& m, AttributeHandler<VEC3, VERTEX>& pos) :
Predictor<PFP, VEC3>(m, pos)
{}
PredictorType getType() { return P_HalfCollapse ; }
......@@ -60,7 +60,7 @@ public:
typedef typename PFP::VEC3 VEC3 ;
typedef typename PFP::REAL REAL ;
Predictor_CornerCutting(MAP& m, AttributeHandler<VEC3>& pos) :
Predictor_CornerCutting(MAP& m, AttributeHandler<VEC3, VERTEX>& pos) :
Predictor<PFP, VEC3>(m, pos)
{}
PredictorType getType() { return P_CornerCutting ; }
......@@ -77,7 +77,7 @@ public:
typedef typename PFP::VEC3 VEC3 ;
typedef typename PFP::REAL REAL ;
Predictor_TangentPredict1(MAP& m, AttributeHandler<VEC3>& pos) :
Predictor_TangentPredict1(MAP& m, AttributeHandler<VEC3, VERTEX>& pos) :
Predictor<PFP, VEC3>(m, pos)
{}
PredictorType getType() { return P_TangentPredict1 ; }
......@@ -94,7 +94,7 @@ public:
typedef typename PFP::VEC3 VEC3 ;
typedef typename PFP::REAL REAL ;
Predictor_TangentPredict2(MAP& m, AttributeHandler<VEC3>& pos) :
Predictor_TangentPredict2(MAP& m, AttributeHandler<VEC3, VERTEX>& pos) :
Predictor<PFP, VEC3>(m, pos)
{}
PredictorType getType() { return P_TangentPredict2 ; }
......
......@@ -53,8 +53,8 @@ private:
} QEMhalfEdgeInfo ;
typedef NoMathIOAttribute<QEMhalfEdgeInfo> HalfEdgeInfo ;
AttributeHandler<HalfEdgeInfo> halfEdgeInfo ;
AttributeHandler<Quadric<REAL> > quadric ;
AttributeHandler<HalfEdgeInfo, DART> halfEdgeInfo ;
AttributeHandler<Quadric<REAL>, VERTEX> quadric ;
std::multimap<float,Dart> halfEdges ;
typename std::multimap<float,Dart>::iterator cur ;
......@@ -67,11 +67,11 @@ private:
void recomputeQuadric(const Dart d, const bool recomputeNeighbors = false) ;
public:
HalfEdgeSelector_QEMml(MAP& m, typename PFP::TVEC3& pos, std::vector<ApproximatorGen<PFP>*>& approx, const FunctorSelect& select = allDarts) :
HalfEdgeSelector_QEMml(MAP& m, AttributeHandler<typename PFP::VEC3, VERTEX>& pos, std::vector<ApproximatorGen<PFP>*>& approx, const FunctorSelect& select = allDarts) :
EdgeSelector<PFP>(m, pos, approx, select)
{
halfEdgeInfo = m.template addAttribute<HalfEdgeInfo>(DART, "halfEdgeInfo") ;
quadric = m.template addAttribute<Quadric<REAL> >(VERTEX, "QEMquadric") ;
halfEdgeInfo = m.template addAttribute<HalfEdgeInfo, DART>("halfEdgeInfo") ;
quadric = m.template addAttribute<Quadric<REAL>, VERTEX>("QEMquadric") ;
}
~HalfEdgeSelector_QEMml()
{
......@@ -105,11 +105,11 @@ private:
} LightfieldHalfEdgeInfo ;
typedef NoMathIOAttribute<LightfieldHalfEdgeInfo> HalfEdgeInfo ;
AttributeHandler<MATRIX33 > m_frame ;
AttributeHandler<MATRIX33, VERTEX> m_frame ;
AttributeHandler<HalfEdgeInfo> halfEdgeInfo ;
AttributeHandler<Quadric<REAL> > quadric ;
AttributeHandler<QuadricRGBfunctions<REAL> > quadricRGBfunctions ;
AttributeHandler<HalfEdgeInfo, DART> halfEdgeInfo ;
AttributeHandler<Quadric<REAL>, VERTEX> quadric ;
AttributeHandler<QuadricRGBfunctions<REAL>, EDGE> quadricRGBfunctions ;
std::multimap<float,Dart> halfEdges ;
typename std::multimap<float,Dart>::iterator cur ;
......@@ -124,14 +124,14 @@ private:
void recomputeQuadric(const Dart d, const bool recomputeNeighbors) ;
public:
HalfEdgeSelector_Lightfield(MAP& m, typename PFP::TVEC3& pos, std::vector<ApproximatorGen<PFP>*>& approx, const FunctorSelect& select = allDarts) :
HalfEdgeSelector_Lightfield(MAP& m, AttributeHandler<typename PFP::VEC3, VERTEX>& pos, std::vector<ApproximatorGen<PFP>*>& approx, const FunctorSelect& select = allDarts) :
EdgeSelector<PFP>(m, pos, approx, select)
{
m_frame = m.template getAttribute<MATRIX33>(VERTEX, "frame") ;