Commit 0345ab1b authored by Sylvain Thery's avatar Sylvain Thery

bug in quicktraversal with boundary

parent e8672e4d
......@@ -468,15 +468,30 @@ inline void GenericMap::updateQuickTraversal()
{
assert(m_quickTraversal[ORBIT] != NULL || !"updateQuickTraversal on a disabled orbit") ;
CellMarker<ORBIT> cm(*this) ;
for(Dart d = begin(); d != end(); next(d))
// CellMarker<ORBIT> cm(*this) ;
// for(Dart d = begin(); d != end(); next(d))
// {
// if ((!cm.isMarked(d)) && (!isBoundaryMarkedCurrent(d)))
// {
// cm.mark(d) ;
// (*m_quickTraversal[ORBIT])[getEmbedding<ORBIT>(d)] = d ;
// }
// }
// ensure that we do not try to use quick traversal in Traversors
AttributeMultiVector<Dart>* qt = m_quickTraversal[ORBIT];
m_quickTraversal[ORBIT] = NULL;
// fill the quick travsersal
TraversorCell<GenericMap,VOLUME> trav(*this);
for(Dart d = trav.begin(); d != trav.end(); d=trav.next())
{
if(!cm.isMarked(d))
{
cm.mark(d) ;
(*m_quickTraversal[ORBIT])[getEmbedding<ORBIT>(d)] = d ;
}
(*qt)[getEmbedding<ORBIT>(d)] = d ;
}
// restore ptr
m_quickTraversal[ORBIT] = qt;
}
template <unsigned int ORBIT>
......
......@@ -33,6 +33,19 @@
namespace CGoGN
{
/// Macro for simple syntax traversal (can be nested)
/// parameters:
/// - cell type
/// - name of iterator variable (automatically declared)
/// - map type
/// - map used
///
/// Ex: FOR_ALL_CELLS(VERTEX, di, myMap) { ... }
///
#define FOR_ALL_CELLS(ORBIT, NAME_ITER, MAP_TYPE, MAP_PARAM) TraversorCell<MAP_TYPE, (ORBIT)> NAME_ITER_TraversalMacroLocalLoop(MAP_PARAM); \
for (Dart NAME_ITER = NAME_ITER_TraversalMacroLocalLoop.begin(); NAME_ITER != NAME_ITER_TraversalMacroLocalLoop.end(); NAME_ITER = NAME_ITER_TraversalMacroLocalLoop.next())
template <typename MAP, unsigned int ORBIT>
class TraversorCell //: public Traversor<MAP>
{
......
......@@ -37,20 +37,20 @@ template <typename MAP, unsigned int ORBIT>
class VTraversorCell : public Traversor
{
private:
MAP& m ;
const MAP& m ;
AttributeContainer* cont ;
const AttributeContainer* cont ;
unsigned int qCurrent ;
DartMarker* dmark ;
CellMarker<ORBIT>* cmark ;
AttributeMultiVector<Dart>* quickTraversal ;
const AttributeMultiVector<Dart>* quickTraversal ;
Dart current ;
bool firstTraversal ;
public:
VTraversorCell(MAP& map, bool forceDartMarker = false, unsigned int thread = 0) ;
VTraversorCell(const MAP& map, bool forceDartMarker = false, unsigned int thread = 0) ;
~VTraversorCell() ;
......@@ -68,20 +68,20 @@ template <unsigned int ORBIT>
class VTraversorCell<GenericMap,ORBIT> : public Traversor
{
private:
GenericMap& m ;
const GenericMap& m ;
AttributeContainer* cont ;
const AttributeContainer* cont ;
unsigned int qCurrent ;
DartMarker* dmark ;
CellMarker<ORBIT>* cmark ;
AttributeMultiVector<Dart>* quickTraversal ;
const AttributeMultiVector<Dart>* quickTraversal ;
Dart current ;
bool firstTraversal ;
public:
VTraversorCell(GenericMap& map, bool forceDartMarker = false, unsigned int thread = 0) ;
VTraversorCell(const GenericMap& map, bool forceDartMarker = false, unsigned int thread = 0) ;
~VTraversorCell() ;
......
......@@ -26,7 +26,7 @@ namespace CGoGN
{
template <typename MAP, unsigned int ORBIT>
VTraversorCell<MAP, ORBIT>::VTraversorCell(MAP& map, bool forceDartMarker, unsigned int thread) :
VTraversorCell<MAP, ORBIT>::VTraversorCell(const MAP& map, bool forceDartMarker, unsigned int thread) :
m(map), dmark(NULL), cmark(NULL), quickTraversal(NULL), current(NIL), firstTraversal(true)
{
if(forceDartMarker)
......@@ -159,7 +159,7 @@ void VTraversorCell<MAP, ORBIT>::skip(Dart d)
//special version (partial specialization) for Genric Map
template <unsigned int ORBIT>
VTraversorCell<GenericMap, ORBIT>::VTraversorCell(GenericMap& map, bool forceDartMarker, unsigned int thread) :
VTraversorCell<GenericMap, ORBIT>::VTraversorCell(const GenericMap& map, bool forceDartMarker, unsigned int thread) :
m(map), dmark(NULL), cmark(NULL), quickTraversal(NULL), current(NIL), firstTraversal(true)
{
if(forceDartMarker)
......
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