Commit 8058dafc authored by Kenneth Vanhoey's avatar Kenneth Vanhoey

Backup commit

parent d35be576
......@@ -175,6 +175,11 @@ public:
return m_approx[index][d] ;
}
const VertexAttribute<T>& getAttr(unsigned int index = 0) const
{
return *(m_attrV[index]) ;
}
std::vector<T> getAllApprox(Dart d) const
{
std::vector<T> res ;
......@@ -246,169 +251,6 @@ public:
}
} ;
//template <typename PFP, typename T>
//class ApproximatorEdge : public ApproximatorGen<PFP>
//{
//public:
// typedef typename PFP::MAP MAP ;
// typedef typename PFP::VEC3 VEC3 ;
// typedef typename PFP::REAL REAL ;
//
//protected:
// Predictor<PFP, T>* m_predictor ;
//
// std::vector<VertexAttribute<T>* > m_attrV ; // vertex attributes to be approximated
// std::vector<EdgeAttribute<T> > m_approx ; // attributes to store approximation result
// std::vector<EdgeAttribute<T> > m_detail ; // attributes to store detail information for reconstruction
// std::vector<T> m_app ;
//
//public:
// ApproximatorEdge(MAP& m, std::vector<VertexAttribute<T>* > va, Predictor<PFP, T> * predictor) :
// ApproximatorGen<PFP>(m), m_predictor(predictor), m_attrV(va)
// {
// const unsigned int& size = m_attrV.size() ;
// assert(size > 0 || !"ApproximatorEdge: no attributes provided") ;
//
// m_approx.resize(size) ;
// m_detail.resize(size) ;
// m_app.resize(size) ;
//
// for (unsigned int i = 0 ; i < size ; ++i)
// {
// if (!m_attrV[i]->isValid())
// std::cerr << "ApproximatorEdge Warning: attribute number " << i << " is not valid" << std::endl ;
//
// std::stringstream aname ;
// aname << "approx_" << m_attrV[i]->name() ;
// m_approx[i] = this->m_map.template addAttribute<T, EDGE>(aname.str()) ;
//
// if(m_predictor) // if predictors are associated to the approximator
// { // create attributes to store the details needed for reconstruction
// std::stringstream dname ;
// dname << "detail_" << m_attrV[i]->name() ;
// m_detail[i] = this->m_map.template addAttribute<T, EDGE>(dname.str()) ;
// }
// }
// }
//
// virtual ~ApproximatorEdge()
// {
// for (unsigned int i = 0 ; i < m_attrV.size() ; ++i)
// {
// this->m_map.template removeAttribute(m_approx[i]) ;
// if(m_predictor)
// this->m_map.template removeAttribute(m_detail[i]) ;
// }
// }
//
// const std::string& getApproximatedAttributeName(unsigned int index = 0) const
// {
// return m_attrV[index]->name() ;
// }
//
//// std::vector<std::string> getApproximatedAttributeNames() const
//// {
//// std::vector<std::string> names ;
//// names.resize(m_attrV.size()) ;
//// for (unsigned int i = 0 ; i < m_attrV.size() ; ++i)
//// names[i] = m_attrV[i]->name() ;
////
//// return names ;
//// }
//
// unsigned int getNbApproximated() const
// {
// return m_attrV.size() ;
// }
//
// void saveApprox(Dart d)
// {
// for (unsigned int i = 0 ; i < m_attrV.size() ; ++i)
// m_app[i] = m_approx[i][d] ;
// }
//
// void affectApprox(Dart d)
// {
// for (unsigned int i = 0 ; i < m_attrV.size() ; ++i)
// m_attrV[i]->operator[](d) = m_app[i] ;
// }
//
// const T& getApprox(Dart d, unsigned int index = 0) const
// {
// return m_approx[index][d] ;
// }
//
// std::vector<T> getAllApprox(Dart d) const
// {
// std::vector<T> res ;
// res.resize(m_attrV.size()) ;
// for (unsigned int i = 0 ; i < m_attrV.size() ; ++i)
// res[i] = m_approx[i][d] ;
//
// return res ;
// }
//
// const Predictor<PFP, T>* getPredictor() const
// {
// return m_predictor ;
// }
//
// const T& getDetail(Dart d, unsigned int index = 0) const
// {
// assert(m_predictor || !"Trying to get detail on a non-predictive scheme") ;
// return m_detail[index][d] ;
// }
//
// std::vector<T> getAllDetail(Dart d) const
// {
// assert(m_predictor || !"Trying to get detail on a non-predictive scheme") ;
//
// std::vector<T> res ;
// res.resize(m_attrV.size()) ;
// for (unsigned int i = 0 ; i < m_attrV.size() ; ++i)
// res[i] = m_detail[i][d] ;
// return res ;
// }
//
// void setDetail(Dart d, unsigned int index, T& val)
// {
// assert(m_predictor || !"Trying to set detail on a non-predictive scheme") ;
// m_detail[index][d] = val ;
// }
//
// void setDetail(Dart d, std::vector<T>& val)
// {
// assert(m_predictor || !"Trying to set detail on a non-predictive scheme") ;
//
// for (unsigned int i = 0 ; i < m_attrV.size() ; ++i)
// m_detail[index][d] = val[i] ;
// }
//
//
//// // TODO works only for vector types !!
//// REAL detailMagnitude(Dart d)
//// {
//// assert(m_predictor || !"Trying to get detail magnitude on a non-predictive scheme") ;
//// return m_detail[d].norm2() ;
//// }
//
// void addDetail(Dart d, double amount, bool sign, typename PFP::MATRIX33* detailTransform)
// {
// assert(m_predictor || !"Trying to add detail on a non-predictive scheme") ;
//
// for (unsigned int i = 0 ; i < m_attrV.size() ; ++i)
// {
// T det = m_detail[i][d] ;
// if(detailTransform)
// det = (*detailTransform) * det ;
// det *= amount ;
// if(!sign)
// det *= REAL(-1) ;
// m_attrV[i]->operator[](d) += det ;
// }
// }
//} ;
} //namespace Decimation
} //namespace Algo
......
......@@ -102,7 +102,7 @@ void decimate(
// pos
v_approx[0].push_back(attribs[0]) ;
approximators.push_back(new Approximator_QEMhalfEdge<PFP>(map, v_approx[0])) ;
approximators.push_back(new Approximator_HalfCollapse<PFP>(map, v_approx[0])) ;
// frame
assert(attribs.size() >= 4 || !"Decimate: A_hLightfieldHalf --> not enough attribs provided") ;
......@@ -187,6 +187,9 @@ void decimate(
case S_hLightfieldExp :
selector = new HalfEdgeSelector_LightfieldExp<PFP>(map, position, approximators, selected) ;
break ;
case S_hLightfieldKCL :
selector = new HalfEdgeSelector_LightfieldKCL<PFP>(map, position, approximators, selected) ;
break ;
}
for(typename std::vector<ApproximatorGen<PFP>*>::iterator it = approximators.begin(); it != approximators.end(); ++it)
......
......@@ -163,12 +163,16 @@ public:
TraversorE<typename PFP::MAP> travE(this->m_map) ;
for(Dart d = travE.begin() ; d != travE.end() ; d = travE.next())
{
(*errors)[d] = -1 ;
if (halfEdgeInfo[d].valid)
{
(*errors)[d] = halfEdgeInfo[d].it->first ;
}
else
(*errors)[d] = -1 ;
Dart dd = this->m_map.phi2(d) ;
if (halfEdgeInfo[dd].valid && halfEdgeInfo[dd].it->first < (*errors)[d])
{
(*errors)[d] = halfEdgeInfo[dd].it->first ;
}
}
}
} ;
......@@ -190,9 +194,9 @@ private:
{
typename std::multimap<float,Dart>::iterator it ;
bool valid ;
static std::string CGoGNnameOfType() { return "QEMextColorHalfEdgeInfo" ; }
} QEMextColorHalfEdgeInfo ;
typedef NoMathIOAttribute<QEMextColorHalfEdgeInfo> HalfEdgeInfo ;
static std::string CGoGNnameOfType() { return "LightfieldHalfEdgeInfo" ; }
} LightfieldHalfEdgeInfo ;
typedef NoMathIOAttribute<LightfieldHalfEdgeInfo> HalfEdgeInfo ;
DartAttribute<HalfEdgeInfo> halfEdgeInfo ;
......@@ -258,7 +262,7 @@ public:
(*errors)[d] = halfEdgeInfo[d].it->first ;
}
Dart dd = this->m_map.phi2(d) ;
if (halfEdgeInfo[dd].valid && halfEdgeInfo[d].it->first < (*errors)[d])
if (halfEdgeInfo[dd].valid && halfEdgeInfo[dd].it->first < (*errors)[d])
{
(*errors)[d] = halfEdgeInfo[dd].it->first ;
}
......@@ -283,9 +287,9 @@ private:
{
typename std::multimap<float,Dart>::iterator it ;
bool valid ;
static std::string CGoGNnameOfType() { return "QEMextColorHalfEdgeInfo" ; }
} QEMextColorHalfEdgeInfo ;
typedef NoMathIOAttribute<QEMextColorHalfEdgeInfo> HalfEdgeInfo ;
static std::string CGoGNnameOfType() { return "LightfieldHalfEdgeInfo" ; }
} LightfieldHalfEdgeInfo ;
typedef NoMathIOAttribute<LightfieldHalfEdgeInfo> HalfEdgeInfo ;
DartAttribute<HalfEdgeInfo> halfEdgeInfo ;
......@@ -298,7 +302,6 @@ private:
int m_approxindex_FN, m_attrindex_FN ;
std::vector<unsigned int> m_approxindex_HF, m_attrindex_HF ;
unsigned int m_K ;
int m_approxindex_color, m_attrindex_color ;
std::vector<Approximator<PFP, typename PFP::VEC3, DART>* > m_approx ;
......@@ -317,9 +320,7 @@ public:
m_attrindex_pos(-1),
m_approxindex_FN(-1),
m_attrindex_FN(-1),
m_K(0),
m_approxindex_color(-1),
m_attrindex_color(-1)
m_K(0)
{
halfEdgeInfo = m.template addAttribute<HalfEdgeInfo, DART>("halfEdgeInfo") ;
m_quadricGeom = m.template addAttribute<Utils::Quadric<REAL>, VERTEX>("QEMquadric") ;
......@@ -332,7 +333,113 @@ public:
this->m_map.removeAttribute(m_quadricGeom) ;
this->m_map.removeAttribute(halfEdgeInfo) ;
}
SelectorType getType() { return S_hLightfield ; }
SelectorType getType() { return S_hLightfieldExp ; }
bool init() ;
bool nextEdge(Dart& d) ;
void updateBeforeCollapse(Dart d) ;
void updateAfterCollapse(Dart d2, Dart dd2) ;
void updateWithoutCollapse() { }
void getEdgeErrors(EdgeAttribute<typename PFP::REAL> *errors)
{
assert(errors != NULL || !"EdgeSelector::setColorMap requires non null vertexattribute argument") ;
if (!errors->isValid())
std::cerr << "EdgeSelector::setColorMap requires valid edgeattribute argument" << std::endl ;
assert(halfEdgeInfo.isValid()) ;
TraversorE<typename PFP::MAP> travE(this->m_map) ;
for(Dart d = travE.begin() ; d != travE.end() ; d = travE.next())
{
(*errors)[d] = -1 ;
if (halfEdgeInfo[d].valid)
{
(*errors)[d] = halfEdgeInfo[d].it->first ;
}
Dart dd = this->m_map.phi2(d) ;
if (halfEdgeInfo[dd].valid && halfEdgeInfo[dd].it->first < (*errors)[d])
{
(*errors)[d] = halfEdgeInfo[dd].it->first ;
}
}
}
} ;
/*****************************************************************************************************************
* HALF-EDGE LIGHTFIELD METRIC KCL08-like *
*****************************************************************************************************************/
template <typename PFP>
class HalfEdgeSelector_LightfieldKCL : public EdgeSelector<PFP>
{
public:
typedef typename PFP::MAP MAP ;
typedef typename PFP::REAL REAL ;
typedef typename PFP::VEC3 VEC3 ;
private:
typedef struct
{
typename std::multimap<float,Dart>::iterator it ;
bool valid ;
static std::string CGoGNnameOfType() { return "LightfieldHalfEdgeInfo" ; }
} LightfieldHalfEdgeInfo ;
typedef NoMathIOAttribute<LightfieldHalfEdgeInfo> HalfEdgeInfo ;
DartAttribute<HalfEdgeInfo> halfEdgeInfo ;
VertexAttribute<Utils::Quadric<REAL> > m_quadricGeom ;
VertexAttribute<REAL> m_visualImportance ;
VertexAttribute<VEC3> m_avgColor ;
int m_approxindex_pos, m_attrindex_pos ;
int m_approxindex_FT, m_attrindex_FT ;
int m_approxindex_FB, m_attrindex_FB ;
int m_approxindex_FN, m_attrindex_FN ;
std::vector<unsigned int> m_approxindex_HF, m_attrindex_HF ;
unsigned int m_K ;
REAL tmpVisualImportance ;
std::vector<Approximator<PFP, typename PFP::VEC3,DART>* > m_approx ;
std::multimap<float,Dart> halfEdges ;
typename std::multimap<float,Dart>::iterator cur ;
void initHalfEdgeInfo(Dart d) ;
void updateHalfEdgeInfo(Dart d, bool recompute) ;
void computeHalfEdgeInfo(Dart d, HalfEdgeInfo& einfo) ;
void recomputeQuadric(const Dart d, const bool recomputeNeighbors = false) ;
REAL computeLightfieldError(Dart v0) ;
REAL computeSquaredLightfieldDifference(Dart d1, Dart d2) ;
public:
HalfEdgeSelector_LightfieldKCL(MAP& m, VertexAttribute<typename PFP::VEC3>& pos, std::vector<ApproximatorGen<PFP>*>& approx, const FunctorSelect& select = allDarts) :
EdgeSelector<PFP>(m, pos, approx, select),
m_approxindex_pos(-1),
m_attrindex_pos(-1),
m_approxindex_FT(-1),
m_attrindex_FT(-1),
m_approxindex_FB(-1),
m_attrindex_FB(-1),
m_approxindex_FN(-1),
m_attrindex_FN(-1),
m_K(0)
{
halfEdgeInfo = m.template addAttribute<HalfEdgeInfo, DART>("halfEdgeInfo") ;
m_quadricGeom = m.template addAttribute<Utils::Quadric<REAL>, VERTEX>("QEMquadric") ;
m_visualImportance = m.template addAttribute<typename PFP::REAL, VERTEX>("VisualImportance") ;
m_avgColor = m.template getAttribute<typename PFP::VEC3, VERTEX>("color") ;
assert(m_avgColor.isValid()) ;
}
~HalfEdgeSelector_LightfieldKCL()
{
this->m_map.removeAttribute(m_quadricGeom) ;
this->m_map.removeAttribute(halfEdgeInfo) ;
this->m_map.removeAttribute(m_visualImportance) ;
}
SelectorType getType() { return S_hLightfieldKCL ; }
bool init() ;
bool nextEdge(Dart& d) ;
void updateBeforeCollapse(Dart d) ;
......@@ -356,10 +463,11 @@ public:
(*errors)[d] = halfEdgeInfo[d].it->first ;
}
Dart dd = this->m_map.phi2(d) ;
if (halfEdgeInfo[dd].valid && halfEdgeInfo[d].it->first < (*errors)[d])
if (halfEdgeInfo[dd].valid && halfEdgeInfo[dd].it->first < (*errors)[d])
{
(*errors)[d] = halfEdgeInfo[dd].it->first ;
}
//m_avgColor[d] = VEC3(m_visualImportance[d]/6.,m_visualImportance[d]/6.,m_visualImportance[d]/6.) ;
}
}
} ;
......
......@@ -186,12 +186,12 @@ void HalfEdgeSelector_QEMml<PFP>::updateAfterCollapse(Dart d2, Dart dd2)
{
updateHalfEdgeInfo(vit, true) ;
Dart d = m.phi2(vit) ;
if (d != vit) ;
if (d != vit)
updateHalfEdgeInfo(d, true) ;
updateHalfEdgeInfo(m.phi1(vit), true) ;
d = m.phi2(m.phi1(vit)) ;
if (d != m.phi1(vit)) ;
if (d != m.phi1(vit))
updateHalfEdgeInfo(d, true) ;
Dart stop = m.phi2(vit) ;
......@@ -200,12 +200,12 @@ void HalfEdgeSelector_QEMml<PFP>::updateAfterCollapse(Dart d2, Dart dd2)
do {
updateHalfEdgeInfo(vit2, true) ;
d = m.phi2(vit2) ;
if (d != vit2) ;
if (d != vit2)
updateHalfEdgeInfo(d, true) ;
updateHalfEdgeInfo(m.phi1(vit2), false) ;
d = m.phi2(m.phi1(vit2)) ;
if (d != m.phi1(vit2)) ;
if (d != m.phi1(vit2))
updateHalfEdgeInfo(d, false) ;
vit2 = m.phi12(vit2) ;
......@@ -476,12 +476,12 @@ void HalfEdgeSelector_QEMextColor<PFP>::updateAfterCollapse(Dart d2, Dart dd2)
{
updateHalfEdgeInfo(vit, true) ;
Dart d = m.phi2(vit) ;
if (d != vit) ;
if (d != vit)
updateHalfEdgeInfo(d, true) ;
updateHalfEdgeInfo(m.phi1(vit), true) ;
d = m.phi2(m.phi1(vit)) ;
if (d != m.phi1(vit)) ;
if (d != m.phi1(vit))
updateHalfEdgeInfo(d, true) ;
Dart stop = m.phi2(vit) ;
......@@ -490,12 +490,12 @@ void HalfEdgeSelector_QEMextColor<PFP>::updateAfterCollapse(Dart d2, Dart dd2)
do {
updateHalfEdgeInfo(vit2, true) ;
d = m.phi2(vit2) ;
if (d != vit2) ;
if (d != vit2)
updateHalfEdgeInfo(d, true) ;
updateHalfEdgeInfo(m.phi1(vit2), false) ;
d = m.phi2(m.phi1(vit2)) ;
if (d != m.phi1(vit2)) ;
if (d != m.phi1(vit2))
updateHalfEdgeInfo(d, false) ;
vit2 = m.phi12(vit2) ;
......@@ -692,7 +692,6 @@ bool HalfEdgeSelector_Lightfield<PFP>::init()
}
}
m_K = k ;
std::cout << m_K << std::endl ;
if(ok < 5)
return false ;
......@@ -818,12 +817,12 @@ void HalfEdgeSelector_Lightfield<PFP>::updateAfterCollapse(Dart d2, Dart dd2)
{
updateHalfEdgeInfo(vit, true) ;
Dart d = m.phi2(vit) ;
if (d != vit) ;
if (d != vit)
updateHalfEdgeInfo(d, true) ;
updateHalfEdgeInfo(m.phi1(vit), true) ;
d = m.phi2(m.phi1(vit)) ;
if (d != m.phi1(vit)) ;
if (d != m.phi1(vit))
updateHalfEdgeInfo(d, true) ;
Dart stop = m.phi2(vit) ;
......@@ -832,12 +831,12 @@ void HalfEdgeSelector_Lightfield<PFP>::updateAfterCollapse(Dart d2, Dart dd2)
do {
updateHalfEdgeInfo(vit2, true) ;
d = m.phi2(vit2) ;
if (d != vit2) ;
if (d != vit2)
updateHalfEdgeInfo(d, true) ;
updateHalfEdgeInfo(m.phi1(vit2), false) ;
d = m.phi2(m.phi1(vit2)) ;
if (d != m.phi1(vit2)) ;
if (d != m.phi1(vit2))
updateHalfEdgeInfo(d, false) ;
vit2 = m.phi12(vit2) ;
......@@ -1182,12 +1181,12 @@ void HalfEdgeSelector_LightfieldExp<PFP>::updateAfterCollapse(Dart d2, Dart dd2)
{
updateHalfEdgeInfo(vit, true) ;
Dart d = m.phi2(vit) ;
if (d != vit) ;
if (d != vit)
updateHalfEdgeInfo(d, true) ;
updateHalfEdgeInfo(m.phi1(vit), true) ;
d = m.phi2(m.phi1(vit)) ;
if (d != m.phi1(vit)) ;
if (d != m.phi1(vit))
updateHalfEdgeInfo(d, true) ;
Dart stop = m.phi2(vit) ;
......@@ -1196,12 +1195,12 @@ void HalfEdgeSelector_LightfieldExp<PFP>::updateAfterCollapse(Dart d2, Dart dd2)
do {
updateHalfEdgeInfo(vit2, true) ;
d = m.phi2(vit2) ;
if (d != vit2) ;
if (d != vit2)
updateHalfEdgeInfo(d, true) ;
updateHalfEdgeInfo(m.phi1(vit2), false) ;
d = m.phi2(m.phi1(vit2)) ;
if (d != m.phi1(vit2)) ;
if (d != m.phi1(vit2))
updateHalfEdgeInfo(d, false) ;
vit2 = m.phi12(vit2) ;
......@@ -1305,15 +1304,14 @@ void HalfEdgeSelector_LightfieldExp<PFP>::computeHalfEdgeInfo(Dart d, HalfEdgeIn
double alpha = alpha1 + alpha2 ;
VEC3 avgColDiff = m_avgColor[d] ;
avgColDiff -= m_avgColor[dd] ;
assert(m_quadricHF.isValid() | !"EdgeSelector_Lightfield<PFP>::computeEdgeInfo: quadricHF is not valid") ;
assert(m_quadricHF.isValid() | !"EdgeSelector_LightfieldExp<PFP>::computeEdgeInfo: quadricHF is not valid") ;
Utils::QuadricHF<REAL> quadHF = m_quadricHF[d] ;
//std::cout << quadGeom(newPos) / (alpha/M_PI + quadHF(newHF)) << std::endl ;
// sum of QEM metric and frame orientation difference
const REAL& err =
quadGeom(newPos) + // geom
(alpha / M_PI) * avgColDiff.norm() + // average color times covering area
(alpha / M_PI) * avgColDiff.norm2() / 3. + // average color times covering area
//alpha / M_PI + // frame
quadHF(newHF) // function coefficients
;
......@@ -1328,6 +1326,460 @@ void HalfEdgeSelector_LightfieldExp<PFP>::computeHalfEdgeInfo(Dart d, HalfEdgeIn
}
}
/************************************************************************************
* HALF EDGE LIGHTFIELD SELECTOR (using QEMml half-edge) KCL-like *
************************************************************************************/
template <typename PFP>
bool HalfEdgeSelector_LightfieldKCL<PFP>::init()
{
MAP& m = this->m_map ;
// Verify availability of required approximators
unsigned int ok = 0 ;
unsigned int k = 0 ;
for (unsigned int approxindex = 0 ; approxindex < this->m_approximators.size() ; ++approxindex)
{
if (this->m_approximators[approxindex]->getType() != A_hHalfCollapse)
{
std::cerr << "Approximator for selector (HalfEdgeSelector_LightfieldKCL) must be of A_hHalfCollapse" << std::endl ;
return false ;
}
assert(this->m_approximators[approxindex]->getType() == A_hHalfCollapse
|| !"Approximator for selector (HalfEdgeSelector_Lightfield) must be of A_hHalfCollapse") ;
bool saved = false ;
for (unsigned int attrindex = 0 ; attrindex < this->m_approximators[approxindex]->getNbApproximated() ; ++ attrindex)
{
// constraint : 2 approximators in specific order
if(ok == 0 && this->m_approximators[approxindex]->getApproximatedAttributeName(attrindex) == "position")
{
++ok ;
m_approxindex_pos = approxindex ;
m_attrindex_pos = attrindex ;
if (!saved)
{
m_approx.push_back(reinterpret_cast<Approximator<PFP, VEC3, DART>* >(this->m_approximators[approxindex])) ;
saved = true ;
}
}
else if(ok == 1 && this->m_approximators[approxindex]->getApproximatedAttributeName(attrindex) == "frameT")
{
++ok ;
m_approxindex_FT = approxindex ;
m_attrindex_FT = attrindex ;
if (!saved)
{
m_approx.push_back(reinterpret_cast<Approximator<PFP, VEC3, DART>* >(this->m_approximators[approxindex])) ;
assert(this->m_approx[approxindex]->getAttr(attrindex).isValid() || !"HalfEdgeSelector_LightfieldExp: frameT attribute is not valid") ;
saved = true ;
}
}
else if(ok == 2 && this->m_approximators[approxindex]->getApproximatedAttributeName(attrindex) == "frameB")
{
++ok ;
m_approxindex_FB = approxindex ;
m_attrindex_FB = attrindex ;
assert(this->m_approx[approxindex]->getAttr(attrindex).isValid() || !"HalfEdgeSelector_LightfieldExp: frameB attribute is not valid") ;
if (!saved)
{
m_approx.push_back(reinterpret_cast<Approximator<PFP, VEC3, DART>* >(this->m_approximators[approxindex])) ;
saved = true ;
}
}
else if(ok == 3 && this->m_approximators[approxindex]->getApproximatedAttributeName(attrindex) == "frameN")
{
++ok ;
m_approxindex_FN = approxindex ;
m_attrindex_FN = attrindex ;
assert(this->m_approx[approxindex]->getAttr(attrindex).isValid() || !"HalfEdgeSelector_LightfieldExp: frameN attribute is not valid") ;
if (!saved)
{
m_approx.push_back(reinterpret_cast<Approximator<PFP, VEC3, DART>* >(this->m_approximators[approxindex])) ;
saved = true ;
}
}
else
{
std::stringstream s ;
s << "PBcoefs" << k ;
if(ok > 3 && this->m_approximators[approxindex]->getApproximatedAttributeName(attrindex) == s.str().c_str())
{
++ok ;