Commit 42e522b2 authored by Sylvain Thery's avatar Sylvain Thery

Merge branch 'master' of cgogn:~vanhoey/CGoGN

parents b753071a 4df69175
...@@ -466,9 +466,9 @@ public: ...@@ -466,9 +466,9 @@ public:
(*errors)[d] = halfEdgeInfo[d].it->first ; (*errors)[d] = halfEdgeInfo[d].it->first ;
} }
Dart dd = this->m_map.phi2(d) ; Dart dd = this->m_map.phi2(d) ;
if (halfEdgeInfo[dd].valid && halfEdgeInfo[dd].it->first < (*errors)[d]) if (halfEdgeInfo[dd].valid && halfEdgeInfo[dd].it->first > (*errors)[d])
{ {
(*errors)[d] = halfEdgeInfo[dd].it->first ; (*errors)[dd] = halfEdgeInfo[dd].it->first ;
} }
//m_avgColor[d] = VEC3(m_visualImportance[d]/6.,m_visualImportance[d]/6.,m_visualImportance[d]/6.) ; //m_avgColor[d] = VEC3(m_visualImportance[d]/6.,m_visualImportance[d]/6.,m_visualImportance[d]/6.) ;
} }
......
...@@ -296,7 +296,6 @@ bool HalfEdgeSelector_QEMextColor<PFP>::init() ...@@ -296,7 +296,6 @@ bool HalfEdgeSelector_QEMextColor<PFP>::init()
{ {
assert(this->m_approximators[approxindex]->getType() == A_hQEM assert(this->m_approximators[approxindex]->getType() == A_hQEM
|| this->m_approximators[approxindex]->getType() == A_hHalfCollapse || this->m_approximators[approxindex]->getType() == A_hHalfCollapse
|| this->m_approximators[approxindex]->getType() != A_Lightfield
|| !"Approximator for selector (HalfEdgeSelector_QEMextColor) must be of a half-edge approximator") ; || !"Approximator for selector (HalfEdgeSelector_QEMextColor) must be of a half-edge approximator") ;
bool saved = false ; bool saved = false ;
...@@ -1673,9 +1672,9 @@ void HalfEdgeSelector_LightfieldKCL<PFP>::computeHalfEdgeInfo(Dart d, HalfEdgeIn ...@@ -1673,9 +1672,9 @@ void HalfEdgeSelector_LightfieldKCL<PFP>::computeHalfEdgeInfo(Dart d, HalfEdgeIn
// New position // New position
const VEC3& newPos = (this->m_approx[m_approxindex_pos]->getAttr(m_attrindex_pos))[d] ; // get newPos const VEC3& newPos = (this->m_approx[m_approxindex_pos]->getAttr(m_attrindex_pos))[d] ; // get newPos
const REAL geomErr = quadGeom(newPos) ; const REAL& geomErr = quadGeom(newPos) ;
const REAL visualI = m_visualImportance[dd] ; const REAL& visualI = m_visualImportance[dd] ;
const REAL lferr = computeLightfieldError(d) ; const REAL& lferr = computeLightfieldError(d) ;
//std::cout << lferr/geomErr << std::endl ; //std::cout << lferr/geomErr << std::endl ;
const REAL& err = const REAL& err =
...@@ -1702,8 +1701,19 @@ typename PFP::REAL HalfEdgeSelector_LightfieldKCL<PFP>::computeLightfieldError(D ...@@ -1702,8 +1701,19 @@ typename PFP::REAL HalfEdgeSelector_LightfieldKCL<PFP>::computeLightfieldError(D
{ {
Dart v1 = this->m_map.phi1(v0) ; Dart v1 = this->m_map.phi1(v0) ;
//return computeSquaredLightfieldDifference(v0,v1) ;
REAL err = 0 ; REAL err = 0 ;
/*Traversor2VVaE<MAP> tv0(this->m_map,v0) ; // all vertices surrounding vertex v0
for (Dart vi = tv0.begin() ; vi != tv0.end() ; vi = tv0.next())
{
if (vi != v1)
{
err += computeSquaredLightfieldDifference(v1,vi) ;
}
}
return err ;
*/
// return computeSquaredLightfieldDifference(v0,v1) ;
Traversor2VVaE<MAP> tv(this->m_map,v1) ; // all vertices surrounding vertex v0 Traversor2VVaE<MAP> tv(this->m_map,v1) ; // all vertices surrounding vertex v0
for (Dart vi = tv.begin() ; vi != tv.end() ; vi = tv.next()) for (Dart vi = tv.begin() ; vi != tv.end() ; vi = tv.next())
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment