Commit 6ae8656b authored by Sylvain Thery's avatar Sylvain Thery

add possibility to use Multi-resolution (with #ifdef)

-> use map.dartIndex(d) instead of d.index
add new orbits (orbit_in_parent), functional with Map & GMap
-> storage of attributes not operational with EmbeddedGMaps
add traversor for incident cell of volume
parent b6f05612
......@@ -15,6 +15,8 @@ SET ( WITH_ASSIMP ON CACHE BOOL "build CGoGN with Assimp ")
SET ( WITH_ZINRI ON CACHE BOOL "build CGoGN with Zinri lib ")
SET ( WITH_QT ON CACHE BOOL "build CGoGN with Qt lib ")
SET ( WITH_NUMERICAL ON CACHE BOOL "build CGoGN with Numerical libs support ")
# for CGoGN MR
SET ( FORCE_MR "0" CACHE STRING "0:none / 1 force multi / 2: force mono")
IF(WIN32)
set(CMAKE_PREFIX_PATH ${CGoGN_ROOT_DIR}/windows_dependencies CACHE STRING "path to dependencies")
......@@ -34,6 +36,21 @@ ELSE (DEFINED ASSERTON)
ENDIF (DEFINED ASSERTON)
IF (FORCE_MR EQUAL 0)
file(WRITE ${CGoGN_ROOT_DIR}/include/cgogn_mr.h "0" )
ENDIF (FORCE_MR EQUAL 0)
IF (FORCE_MR EQUAL 1)
add_definitions(-DCGoGN_FORCE_MR=1)
file(WRITE ${CGoGN_ROOT_DIR}/include/cgogn_mr.h "1" )
ENDIF (FORCE_MR EQUAL 1)
IF (FORCE_MR EQUAL 2)
add_definitions(-DCGoGN_FORCE_MR=2)
file(WRITE ${CGoGN_ROOT_DIR}/include/cgogn_mr.h "2" )
ENDIF (FORCE_MR EQUAL 2)
add_definitions(-DSHADERPATH="${CGoGN_ROOT_DIR}/lib/Shaders/")
# define includes of external libs
......
......@@ -9,6 +9,18 @@ SET ( WITH_NUMERICAL ON CACHE BOOL "need numerical libs")
SET ( WITH_ZINRI ON CACHE BOOL "need Zinri lib ")
SET ( WITH_QT ON CACHE BOOL "need Qt lib ")
# for CGoGN MR
file(STRINGS ${CGoGN_ROOT_DIR}/include/cgogn_mr.h FORCE_MR)
#MESSAGE (STATUS "MR" ${FORCE_MR})
IF (FORCE_MR EQUAL 1)
add_definitions(-DCGoGN_FORCE_MR=1)
ENDIF (FORCE_MR EQUAL 1)
IF (FORCE_MR EQUAL 2)
add_definitions(-DCGoGN_FORCE_MR=2)
ENDIF (FORCE_MR EQUAL 2)
IF(WIN32)
set(CMAKE_PREFIX_PATH ${CGoGN_ROOT_DIR}/windows_dependencies CACHE STRING "path to dependencies")
ENDIF(WIN32)
......@@ -20,6 +32,9 @@ find_package(LibXml2 REQUIRED)
find_package(GLEW REQUIRED)
IF (DEFINED ASSERTON)
add_definitions(-DCGOGN_ASSERT_BOOL=${ASSERTON})
ELSE (DEFINED ASSERTON)
......
......@@ -31,16 +31,36 @@ namespace CGoGN
{
const unsigned int EMBNULL = 0xffffffff;
const unsigned int NB_ORBITS = 6;
const unsigned int NB_THREAD = 16;
const unsigned int VERTEX = 0;
const unsigned int EDGE = 1;
const unsigned int ORIENTED_FACE = 2;
const unsigned int FACE = 3;
const unsigned int VOLUME = 4;
const unsigned int DART = 5;
//const unsigned int NB_ORBITS = 6;
//const unsigned int VERTEX = 0;
//const unsigned int EDGE = 1;
//const unsigned int ORIENTED_FACE = 2;
//const unsigned int FACE = 3;
//const unsigned int VOLUME = 4;
//const unsigned int DART = 5;
//
const unsigned int NB_ORBITS = 11;
const unsigned int DART = 0;
const unsigned int VERTEX = 1;
const unsigned int EDGE = 2;
const unsigned int FACE = 3;
const unsigned int VOLUME = 4;
const unsigned int CC = 5;
const unsigned int VERTEX1 = 6;
const unsigned int EDGE1 = 7;
const unsigned int VERTEX2 = 8;
const unsigned int EDGE2 = 9;
const unsigned int FACE2 = 10;
struct Dart
{
......
......@@ -92,7 +92,10 @@ public:
virtual void mark(Dart d)
{
assert(m_map.getMarkerSet(DART, m_thread).testMark(m_mark));
m_map.getMarkVector(DART, m_thread)->operator[](d.index).setMark(m_mark);
// m_map.getMarkVector(DART, m_thread)->operator[](d.index).setMark(m_mark);
unsigned int d_index = m_map.dartIndex(d);
m_map.getMarkVector(DART, m_thread)->operator[](d_index).setMark(m_mark);
}
/**
......@@ -101,7 +104,8 @@ public:
virtual void unmark(Dart d)
{
assert(m_map.getMarkerSet(DART, m_thread).testMark(m_mark));
m_map.getMarkVector(DART, m_thread)->operator[](d.index).unsetMark(m_mark);
unsigned int d_index = m_map.dartIndex(d);
m_map.getMarkVector(DART, m_thread)->operator[](d_index).unsetMark(m_mark);
}
/**
......@@ -110,7 +114,8 @@ public:
virtual bool isMarked(Dart d) const
{
assert(m_map.getMarkerSet(DART, m_thread).testMark(m_mark));
return m_map.getMarkVector(DART, m_thread)->operator[](d.index).testMark(m_mark);
unsigned int d_index = m_map.dartIndex(d);
return m_map.getMarkVector(DART, m_thread)->operator[](d_index).testMark(m_mark);
}
/**
......@@ -133,27 +138,27 @@ public:
m_map.foreach_dart_of_orbit(orbit, d, fm, m_thread) ;
}
/**
* mark the darts of the given orbit of d in the parent map
*/
template <typename MAP>
void markOrbitInParent(unsigned int orbit, Dart d)
{
assert(m_map.getMarkerSet(DART, m_thread).testMark(m_mark));
FunctorMark<GenericMap> fm(m_map, m_mark, m_map.getMarkVector(DART, m_thread)) ;
foreach_dart_of_orbit_in_parent<MAP>(dynamic_cast<MAP*>(&m_map), orbit, d, fm, m_thread);
}
/**
* unmark the darts of the given orbit of d in the parent map
*/
template <typename MAP>
void unmarkOrbitInParent(unsigned int orbit, Dart d)
{
assert(m_map.getMarkerSet(DART, m_thread).testMark(m_mark));
FunctorUnmark<GenericMap> fm(m_map, m_mark, m_map.getMarkVector(DART, m_thread)) ;
foreach_dart_of_orbit_in_parent<MAP>(dynamic_cast<MAP*>(&m_map), orbit, d, fm, m_thread);
}
// /**
// * mark the darts of the given orbit of d in the parent map
// */
// template <typename MAP>
// void markOrbitInParent(unsigned int orbit, Dart d)
// {
// assert(m_map.getMarkerSet(DART, m_thread).testMark(m_mark));
// FunctorMark<GenericMap> fm(m_map, m_mark, m_map.getMarkVector(DART, m_thread)) ;
// foreach_dart_of_orbit_in_parent<MAP>(dynamic_cast<MAP*>(&m_map), orbit, d, fm, m_thread);
// }
//
// /**
// * unmark the darts of the given orbit of d in the parent map
// */
// template <typename MAP>
// void unmarkOrbitInParent(unsigned int orbit, Dart d)
// {
// assert(m_map.getMarkerSet(DART, m_thread).testMark(m_mark));
// FunctorUnmark<GenericMap> fm(m_map, m_mark, m_map.getMarkVector(DART, m_thread)) ;
// foreach_dart_of_orbit_in_parent<MAP>(dynamic_cast<MAP*>(&m_map), orbit, d, fm, m_thread);
// }
/**
* mark all darts
......@@ -250,7 +255,8 @@ public:
void mark(Dart d)
{
DartMarkerGen::mark(d) ;
m_markedDarts.push_back(d.index) ;
unsigned int d_index = m_map.dartIndex(d);
m_markedDarts.push_back(d_index) ;
}
void markOrbit(unsigned int orbit, Dart d)
......@@ -260,13 +266,13 @@ public:
m_map.foreach_dart_of_orbit(orbit, d, fm, m_thread) ;
}
template <typename MAP>
void markOrbitInParent(unsigned int orbit, Dart d)
{
assert(m_map.getMarkerSet(DART, m_thread).testMark(m_mark));
FunctorMarkStore<GenericMap> fm(m_map, m_mark, m_map.getMarkVector(DART, m_thread), m_markedDarts) ;
foreach_dart_of_orbit_in_parent<MAP>(dynamic_cast<MAP*>(&m_map), orbit, d, fm, m_thread);
}
// template <typename MAP>
// void markOrbitInParent(unsigned int orbit, Dart d)
// {
// assert(m_map.getMarkerSet(DART, m_thread).testMark(m_mark));
// FunctorMarkStore<GenericMap> fm(m_map, m_mark, m_map.getMarkVector(DART, m_thread), m_markedDarts) ;
// foreach_dart_of_orbit_in_parent<MAP>(dynamic_cast<MAP*>(&m_map), orbit, d, fm, m_thread);
// }
// void mark(unsigned int d)
// {
......
......@@ -319,6 +319,22 @@ public:
};
template <typename MAP>
class FunctorStoreNotBoundary : public FunctorMap<MAP>
{
protected:
std::vector<Dart>& m_vec;
public:
FunctorStoreNotBoundary(MAP& map, std::vector<Dart>& vec) : FunctorMap<MAP>(map), m_vec(vec) {}
bool operator()(Dart d)
{
if (!this->m_map.isBoundaryMarked(d))
m_vec.push_back(d);
return false;
}
};
// Multiple Functor: to apply several Functors in turn to a dart
/********************************************************/
......@@ -360,7 +376,8 @@ public:
{}
bool operator()(Dart d)
{
this->m_markTable->operator[](d.index).setMark(this->m_mark) ;
unsigned int d_index = this->m_map.dartIndex(d);
this->m_markTable->operator[](d_index).setMark(this->m_mark) ;
return false ;
}
} ;
......@@ -377,8 +394,9 @@ public:
{}
bool operator()(Dart d)
{
this->m_markTable->operator[](d.index).setMark(this->m_mark) ;
m_markedDarts.push_back(d.index) ;
unsigned int d_index = this->m_map.dartIndex(d);
this->m_markTable->operator[](d_index).setMark(this->m_mark) ;
m_markedDarts.push_back(d_index) ;
return false ;
}
} ;
......@@ -391,7 +409,8 @@ public:
{}
bool operator()(Dart d)
{
this->m_markTable->operator[](d.index).unsetMark(this->m_mark) ;
unsigned int d_index = this->m_map.dartIndex(d);
this->m_markTable->operator[](d_index).unsetMark(this->m_mark) ;
return false ;
}
} ;
......
......@@ -115,6 +115,28 @@ protected:
std::vector<DartMarkerGen*> dartMarkers ;
std::vector<CellMarkerGen*> cellMarkers ;
/**
* is map a multiresolution map
*/
#ifndef CGoGN_FORCE_MR
bool m_isMultiRes;
#elif CGoGN_FORCE_MR == 1
static const bool m_isMultiRes=true;
#else
static const bool m_isMultiRes=false;
#endif
AttributeContainer m_mrattribs ;
std::vector< AttributeMultiVector<unsigned int> > m_mrDarts;
AttributeMultiVector<unsigned char> m_mrLevels;
unsigned int m_mrCurrentLevel;
std::vector<unsigned int> m_mrLevelStack;
public:
static const unsigned int UNKNOWN_ATTRIB = AttributeContainer::UNKNOWN ;
......@@ -152,6 +174,12 @@ protected:
void deleteDart(Dart d) ;
public:
/**
* get the index of dart in topological table
*/
unsigned int dartIndex(Dart d);
/**
* return true if the dart d refers to a valid index
*/
......@@ -433,10 +461,19 @@ public:
virtual bool foreach_dart_of_vertex(Dart d, FunctorType& f, unsigned int thread = 0) = 0 ;
virtual bool foreach_dart_of_edge(Dart d, FunctorType& f, unsigned int thread = 0) = 0 ;
virtual bool foreach_dart_of_oriented_face(Dart d, FunctorType& f, unsigned int thread = 0) = 0 ;
virtual bool foreach_dart_of_face(Dart d, FunctorType& f, unsigned int thread = 0) = 0 ;
virtual bool foreach_dart_of_volume(Dart d, FunctorType& f, unsigned int thread = 0) = 0 ;
virtual bool foreach_dart_of_cc(Dart d, FunctorType& f, unsigned int thread = 0) = 0 ;
virtual bool foreach_dart_of_face(Dart d, FunctorType& f, unsigned int thread = 0) { std::cerr<< "Not implemented"<< std::endl; return false;}
virtual bool foreach_dart_of_volume(Dart d, FunctorType& f, unsigned int thread = 0) { std::cerr<< "Not implemented"<< std::endl; return false;}
virtual bool foreach_dart_of_cc(Dart d, FunctorType& f, unsigned int thread = 0) { std::cerr<< "Not implemented"<< std::endl; return false;}
virtual bool foreach_dart_of_vertex1(Dart d, FunctorType& f, unsigned int thread = 0) { std::cerr<< "Not implemented"<< std::endl; return false;}
virtual bool foreach_dart_of_edge1(Dart d, FunctorType& f, unsigned int thread = 0) { std::cerr<< "Not implemented"<< std::endl; return false;}
virtual bool foreach_dart_of_vertex2(Dart d, FunctorType& f, unsigned int thread = 0) { std::cerr<< "Not implemented"<< std::endl; return false;}
virtual bool foreach_dart_of_edge2(Dart d, FunctorType& f, unsigned int thread = 0) { std::cerr<< "Not implemented"<< std::endl; return false;}
virtual bool foreach_dart_of_face2(Dart d, FunctorType& f, unsigned int thread = 0) { std::cerr<< "Not implemented"<< std::endl; return false;}
/**
* execute functor for each orbit
......@@ -495,38 +532,38 @@ protected:
void boundaryUnmarkAll();
} ;
template <typename MAP>
bool foreach_dart_of_orbit_in_parent(MAP* ptrMap, unsigned int orbit, Dart d, FunctorType& f, unsigned int thread = 0)
{
switch(orbit)
{
case DART: return f(d);
case VERTEX: return ptrMap->MAP::ParentMap::foreach_dart_of_vertex(d, f, thread) ;
case EDGE: return ptrMap->MAP::ParentMap::foreach_dart_of_edge(d, f, thread) ;
case ORIENTED_FACE: return ptrMap->MAP::ParentMap::foreach_dart_of_oriented_face(d, f, thread) ;
case FACE: return ptrMap->MAP::ParentMap::foreach_dart_of_face(d, f, thread) ;
case VOLUME: return ptrMap->MAP::ParentMap::foreach_dart_of_volume(d, f, thread) ;
default: assert(!"Cells of this dimension are not handled") ;
}
return false ;
}
template <typename MAP>
bool foreach_dart_of_orbit_in_parent2(MAP* ptrMap, unsigned int orbit, Dart d, FunctorType& f, unsigned int thread = 0)
{
switch(orbit)
{
case DART: return f(d);
case VERTEX: return ptrMap->MAP::ParentMap::ParentMap::foreach_dart_of_vertex(d, f,thread) ;
case EDGE: return ptrMap->MAP::ParentMap::ParentMap::foreach_dart_of_edge(d, f, thread) ;
case ORIENTED_FACE: return ptrMap->MAP::ParentMap::ParentMap::foreach_dart_of_oriented_face(d, f, thread) ;
case FACE: return ptrMap->MAP::ParentMap::ParentMap::foreach_dart_of_face(d, f, thread) ;
case VOLUME: return ptrMap->MAP::ParentMap::ParentMap::foreach_dart_of_volume(d, f, thread) ;
default: assert(!"Cells of this dimension are not handled") ;
}
return false ;
}
//
//template <typename MAP>
//bool foreach_dart_of_orbit_in_parent(MAP* ptrMap, unsigned int orbit, Dart d, FunctorType& f, unsigned int thread = 0)
//{
// switch(orbit)
// {
// case DART: return f(d);
// case VERTEX: return ptrMap->MAP::ParentMap::foreach_dart_of_vertex(d, f, thread) ;
// case EDGE: return ptrMap->MAP::ParentMap::foreach_dart_of_edge(d, f, thread) ;
// case ORIENTED_FACE: return ptrMap->MAP::ParentMap::foreach_dart_of_oriented_face(d, f, thread) ;
// case FACE: return ptrMap->MAP::ParentMap::foreach_dart_of_face(d, f, thread) ;
// case VOLUME: return ptrMap->MAP::ParentMap::foreach_dart_of_volume(d, f, thread) ;
// default: assert(!"Cells of this dimension are not handled") ;
// }
// return false ;
//}
//
//template <typename MAP>
//bool foreach_dart_of_orbit_in_parent2(MAP* ptrMap, unsigned int orbit, Dart d, FunctorType& f, unsigned int thread = 0)
//{
// switch(orbit)
// {
// case DART: return f(d);
// case VERTEX: return ptrMap->MAP::ParentMap::ParentMap::foreach_dart_of_vertex(d, f,thread) ;
// case EDGE: return ptrMap->MAP::ParentMap::ParentMap::foreach_dart_of_edge(d, f, thread) ;
// case ORIENTED_FACE: return ptrMap->MAP::ParentMap::ParentMap::foreach_dart_of_oriented_face(d, f, thread) ;
// case FACE: return ptrMap->MAP::ParentMap::ParentMap::foreach_dart_of_face(d, f, thread) ;
// case VOLUME: return ptrMap->MAP::ParentMap::ParentMap::foreach_dart_of_volume(d, f, thread) ;
// default: assert(!"Cells of this dimension are not handled") ;
// }
// return false ;
//}
} //namespace CGoGN
......
......@@ -24,11 +24,32 @@
namespace CGoGN
{
//inline bool GenericMap::chechXmlNode(xmlNodePtr node, const std::string& name)
//#ifndef CGoGN_FORCE_MR
inline unsigned int GenericMap::dartIndex(Dart d)
{
if (m_isMultiRes)
{
std::cout << "Not implemented"<< std::endl;
return 0xffffffff;
}
return d.index;
}
//#elif CGoGN_FORCE_MR == 1
//inline unsigned int GenericMap::dartIndex(Dart d)
//{
// std::cout << "Not implemented"<< std::endl;
// return 0xffffffff;
//}
//#else
//inline unsigned int GenericMap::dartIndex(Dart d)
//{
// return (strcmp((char*)(node->name),(char*)(name.c_str())) == 0);
// return d.index;
//}
//#endif
/****************************************
* DARTS MANAGEMENT *
......@@ -37,23 +58,28 @@ namespace CGoGN
inline Dart GenericMap::newDart()
{
Dart d = Dart::create(m_attribs[DART].insertLine());
unsigned int d_index = dartIndex(d);
for(unsigned int i = 0; i < NB_ORBITS; ++i)
if (m_embeddings[i])
(*m_embeddings[i])[d.index] = EMBNULL ;
{
(*m_embeddings[i])[d_index] = EMBNULL ;
}
return d ;
}
inline void GenericMap::deleteDart(Dart d)
{
m_attribs[DART].removeLine(d.index) ;
unsigned int d_index = dartIndex(d);
m_attribs[DART].removeLine(d_index) ;
for (unsigned int t = 0; t < m_nbThreads; ++t)
m_markTables[DART][t]->operator[](d.index).clear() ;
m_markTables[DART][t]->operator[](d_index).clear() ;
for(unsigned int orbit = 0; orbit < NB_ORBITS; ++orbit)
{
if (m_embeddings[orbit])
{
unsigned int emb = (*m_embeddings[orbit])[d.index] ;
unsigned int emb = (*m_embeddings[orbit])[d_index] ;
if(emb != EMBNULL)
{
if(m_attribs[orbit].unrefLine(emb))
......@@ -68,7 +94,7 @@ inline void GenericMap::deleteDart(Dart d)
inline bool GenericMap::isDartValid(Dart d)
{
return !d.isNil() && m_attribs[DART].used(d.index) ;
return !d.isNil() && m_attribs[DART].used( dartIndex(d)) ;
}
inline unsigned int GenericMap::getNbDarts()
......@@ -98,10 +124,12 @@ inline unsigned int GenericMap::getEmbedding(unsigned int orbit, Dart d)
{
assert(isOrbitEmbedded(orbit) || !"Invalid parameter: orbit not embedded");
unsigned int d_index = dartIndex(d);
if (orbit == DART)
return d.index;
return d_index;
return (*m_embeddings[orbit])[d.index] ;
return (*m_embeddings[orbit])[d_index] ;
}
inline void GenericMap::copyDartEmbedding(unsigned int orbit, Dart d, Dart e)
......@@ -192,7 +220,10 @@ inline Dart GenericMap::end()
inline void GenericMap::next(Dart& d)
{
m_attribs[DART].next(d.index) ;
unsigned int d_index = dartIndex(d);
m_attribs[DART].next(d_index) ;
d = Dart::create(d_index);
}
/****************************************
......
......@@ -100,8 +100,49 @@ public:
/*******************************************************************************
VOLUME CENTERED TRAVERSALS
*******************************************************************************/
// Traverse the vertices incident to a given volume
template <typename MAP, unsigned int ORBIT>
class Traversor3WX
{
private:
MAP& m ;
Dart start ;
Dart current ;
DartMarkerStore* dmark ;
CellMarkerStore* cmark ;
TraversorDartsOfOrbit<MAP> m_tradoo;
public:
Traversor3WX(MAP& map, Dart dart, bool forceDartMarker = false, unsigned int thread = 0) ;
~Traversor3WX();
Dart begin() ;
Dart end() ;
Dart next() ;
} ;
template <typename MAP>
class Traversor3WV: public Traversor3WX<MAP,VERTEX>
{
public:
Traversor3WV(MAP& m, Dart dart, bool forceDartMarker = false, unsigned int thread = 0) : Traversor3WX<MAP,VERTEX>(m, dart, forceDartMarker, thread) {}
};
template <typename MAP>
class Traversor3WE: public Traversor3WX<MAP,EDGE>
{
public:
Traversor3WE(MAP& m, Dart dart, bool forceDartMarker = false, unsigned int thread = 0) : Traversor3WX<MAP,EDGE>(m, dart, forceDartMarker, thread) {}
};
template <typename MAP>
class Traversor3WF: public Traversor3WX<MAP,FACE>
{
public:
Traversor3WF(MAP& m, Dart dart, bool forceDartMarker = false, unsigned int thread = 0) : Traversor3WX<MAP,FACE>(m, dart, forceDartMarker, thread) {}
};
} // namespace CGoGN
......
......@@ -60,4 +60,63 @@ Dart Traversor3VE<MAP>::next()
return current ;
}
template <typename MAP, unsigned int ORBIT>
Traversor3WX<MAP,ORBIT>::Traversor3WX(MAP& map, Dart dart, bool forceDartMarker, unsigned int thread) :
m(map), start(dart),dmark(NULL), cmark(NULL), m_tradoo(map,VOLUME,dart,thread)
{
if(!forceDartMarker && map.isOrbitEmbedded(ORBIT))
cmark = new CellMarkerStore(map, ORBIT, thread) ;
else
dmark = new DartMarkerStore(map, thread) ;
}
template <typename MAP, unsigned int ORBIT>
Traversor3WX<MAP,ORBIT>::~Traversor3WX()
{
if (cmark)
delete cmark;
if (dmark)
delete dmark;
}
template <typename MAP, unsigned int ORBIT>
Dart Traversor3WX<MAP,ORBIT>::begin()
{
current = m_tradoo.begin() ;
return current;
}
template <typename MAP, unsigned int ORBIT>
Dart Traversor3WX<MAP,ORBIT>::end()
{
return NIL ;
}
template <typename MAP, unsigned int ORBIT>
Dart Traversor3WX<MAP,ORBIT>::next()
{
if(current != NIL)
{
if (cmark)
{
cmark->mark(current);
current = m_tradoo.next();
while ((current != NIL) && cmark->isMarked(current))
current = m_tradoo.next();
}
else
{
dmark->markOrbit(ORBIT, current);
current = m_tradoo.next();
while ((current != NIL) && dmark->isMarked(current))
current = m_tradoo.next();
}
}
return current ;
}
} // namespace CGoGN
......@@ -31,6 +31,189 @@
namespace CGoGN
{
//
//template <typename MAP>
//class TraversorCell
//{
//private:
// MAP& m ;
// unsigned int m_orbit ;
// DartMarker* dmark ;
// CellMarker* cmark ;
// Dart current ;
// bool firstTraversal ;
// const FunctorSelect& m_good ;
//
//public:
// TraversorCell(MAP& map, unsigned int orbit, const FunctorSelect& good = allDarts, bool forceDartMarker = false, unsigned int thread = 0) :
// m(map), m_orbit(orbit), dmark(NULL), cmark(NULL), current(NIL), firstTraversal(true), m_good(good)
// {
// if(!forceDartMarker && map.isOrbitEmbedded(m_orbit))
// cmark = new CellMarker(map, m_orbit, thread) ;
// else
// dmark = new DartMarker(map, thread) ;
// }
//
// ~TraversorCell()
// {
// if(dmark)
// delete dmark ;
// else
// delete cmark ;
// }
//
// Dart begin()
// {
// if(!firstTraversal)
// {
// if(dmark)
// dmark->unmarkAll() ;
// else
// cmark->unmarkAll() ;
// }
//
// current = m.begin() ;
// while(current != m.end() && (m.isBoundaryMarked(current) || !m_good(current)))
// m.next(current) ;
//
// if(current == m.end())
// current = NIL ;
// else
// {
// if(dmark)
// dmark->markOrbit(m_orbit, current) ;
// else
// cmark->mark(current) ;
// }
//
// firstTraversal = false ;
// return current ;
// }
//
// Dart end() { return NIL ; }
//
// Dart next()
// {
// if(current != NIL)
// {
// bool ismarked ;
// if(dmark)
// ismarked = dmark->isMarked(current) ;
// else
// ismarked = cmark->isMarked(current) ;
//
// while(current != NIL && (ismarked || m.isBoundaryMarked(current) || !m_good(current)))
// {
// m.next(current) ;
// if(current == m.end())
// current = NIL ;
// else
// {
// if(dmark)
// ismarked = dmark->isMarked(current) ;
// else
// ismarked = cmark->isMarked(current) ;
// }
// }
//
// if(current != NIL)
// {
// if(dmark)