Commit 4d0c2298 authored by untereiner's avatar untereiner

some changes on edge selectors

parent 395037bf
......@@ -65,6 +65,8 @@ public:
void updateBeforeCollapse(Dart d)
{}
void updateAfterCollapse(Dart d2, Dart dd2) ;
bool nextEdgeWithoutUpdates(Dart& d) { }
} ;
template <typename PFP>
......@@ -92,6 +94,8 @@ public:
void updateBeforeCollapse(Dart d2)
{}
void updateAfterCollapse(Dart d2, Dart dd2) ;
bool nextEdgeWithoutUpdates(Dart& d) { }
} ;
template <typename PFP>
......@@ -135,6 +139,8 @@ public:
bool nextEdge(Dart& d) ;
void updateBeforeCollapse(Dart d) ;
void updateAfterCollapse(Dart d2, Dart dd2) ;
bool nextEdgeWithoutUpdates(Dart& d) { }
} ;
template <typename PFP>
......@@ -184,6 +190,8 @@ public:
bool nextEdge(Dart& d) ;
void updateBeforeCollapse(Dart d) ;
void updateAfterCollapse(Dart d2, Dart dd2) ;
bool nextEdgeWithoutUpdates(Dart& d);
} ;
template <typename PFP>
......@@ -233,6 +241,8 @@ public:
bool nextEdge(Dart& d) ;
void updateBeforeCollapse(Dart d) ;
void updateAfterCollapse(Dart d2, Dart dd2) ;
bool nextEdgeWithoutUpdates(Dart& d) { }
} ;
template <typename PFP>
......@@ -328,6 +338,8 @@ public:
bool nextEdge(Dart& d) ;
void updateBeforeCollapse(Dart d) ;
void updateAfterCollapse(Dart d2, Dart dd2) ;
bool nextEdgeWithoutUpdates(Dart& d) { }
} ;
template <typename PFP>
......@@ -373,6 +385,8 @@ public:
bool nextEdge(Dart& d) ;
void updateBeforeCollapse(Dart d) ;
void updateAfterCollapse(Dart d2, Dart dd2) ;
bool nextEdgeWithoutUpdates(Dart& d) { }
} ;
} // namespace Decimation
......
......@@ -479,6 +479,20 @@ void EdgeSelector_QEM<PFP>::computeEdgeInfo(Dart d, EdgeInfo& einfo)
einfo.valid = true ;
}
template <typename PFP>
bool EdgeSelector_QEM<PFP>::nextEdgeWithoutUpdates(Dart& d)
{
if(cur == edges.end() || edges.empty())
return false ;
EdgeInfo& einfo = edgeInfo[(*cur).second] ;
einfo.valid = false ;
edges.erase(einfo.it) ;
cur = edges.begin();
d = (*cur).second ;
return true ;
}
/************************************************************************************
* QUADRIC ERROR METRIC (Memoryless version) *
************************************************************************************/
......
......@@ -75,6 +75,8 @@ public:
virtual bool nextEdge(Dart& d) = 0 ;
virtual void updateBeforeCollapse(Dart d) = 0 ;
virtual void updateAfterCollapse(Dart d2, Dart dd2) = 0 ;
virtual bool nextEdgeWithoutUpdates(Dart& d) = 0;
} ;
} // namespace Decimation
......
......@@ -157,7 +157,7 @@ void Map2MR_PM<PFP>::addNewLevel(unsigned int percentWantedVertices)
Dart d ;
while(!finished)
{
if(!m_selector->nextEdge(d))
if(!m_selector->nextEdgeWithoutUpdates(d))
break ;
if(!me.isMarked(d))
......@@ -186,12 +186,12 @@ void Map2MR_PM<PFP>::addNewLevel(unsigned int percentWantedVertices)
edges.push_back(d);
}
//std::cout << "nbDeletedVertex : " << nbDeletedVertex << std::endl;
if(nbDeletedVertex >= nbWantedPerLevel)
finished = true ;
}
std::cout << "nbDeletedVertices : " << nbDeletedVertex << std::endl;
//create the new level
m_map.addLevelFront();
......@@ -239,7 +239,7 @@ void Map2MR_PM<PFP>::collapseEdge(Dart d)
m_map.incDartLevel(m_map.phi_1(m_map.phi2(d)));
m_map.incDartLevel(m_map.phi1(m_map.phi2(d)));
m_map.printMR();
//m_map.printMR();
m_map.duplicateDartAtOneLevel(d, 0);
m_map.duplicateDartAtOneLevel(m_map.phi1(d), 0);
......@@ -255,7 +255,7 @@ void Map2MR_PM<PFP>::collapseEdge(Dart d)
m_map.collapseEdge(d);
m_map.printMR();
//m_map.printMR();
}
......
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