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 ") ...@@ -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_ZINRI ON CACHE BOOL "build CGoGN with Zinri lib ")
SET ( WITH_QT ON CACHE BOOL "build CGoGN with Qt lib ") SET ( WITH_QT ON CACHE BOOL "build CGoGN with Qt lib ")
SET ( WITH_NUMERICAL ON CACHE BOOL "build CGoGN with Numerical libs support ") 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) IF(WIN32)
set(CMAKE_PREFIX_PATH ${CGoGN_ROOT_DIR}/windows_dependencies CACHE STRING "path to dependencies") set(CMAKE_PREFIX_PATH ${CGoGN_ROOT_DIR}/windows_dependencies CACHE STRING "path to dependencies")
...@@ -34,6 +36,21 @@ ELSE (DEFINED ASSERTON) ...@@ -34,6 +36,21 @@ ELSE (DEFINED ASSERTON)
ENDIF (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/") add_definitions(-DSHADERPATH="${CGoGN_ROOT_DIR}/lib/Shaders/")
# define includes of external libs # define includes of external libs
......
...@@ -9,6 +9,18 @@ SET ( WITH_NUMERICAL ON CACHE BOOL "need numerical 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_ZINRI ON CACHE BOOL "need Zinri lib ")
SET ( WITH_QT ON CACHE BOOL "need Qt 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) IF(WIN32)
set(CMAKE_PREFIX_PATH ${CGoGN_ROOT_DIR}/windows_dependencies CACHE STRING "path to dependencies") set(CMAKE_PREFIX_PATH ${CGoGN_ROOT_DIR}/windows_dependencies CACHE STRING "path to dependencies")
ENDIF(WIN32) ENDIF(WIN32)
...@@ -20,6 +32,9 @@ find_package(LibXml2 REQUIRED) ...@@ -20,6 +32,9 @@ find_package(LibXml2 REQUIRED)
find_package(GLEW REQUIRED) find_package(GLEW REQUIRED)
IF (DEFINED ASSERTON) IF (DEFINED ASSERTON)
add_definitions(-DCGOGN_ASSERT_BOOL=${ASSERTON}) add_definitions(-DCGOGN_ASSERT_BOOL=${ASSERTON})
ELSE (DEFINED ASSERTON) ELSE (DEFINED ASSERTON)
......
...@@ -31,16 +31,36 @@ namespace CGoGN ...@@ -31,16 +31,36 @@ namespace CGoGN
{ {
const unsigned int EMBNULL = 0xffffffff; const unsigned int EMBNULL = 0xffffffff;
const unsigned int NB_ORBITS = 6;
const unsigned int NB_THREAD = 16; const unsigned int NB_THREAD = 16;
const unsigned int VERTEX = 0; //const unsigned int NB_ORBITS = 6;
const unsigned int EDGE = 1;
const unsigned int ORIENTED_FACE = 2; //const unsigned int VERTEX = 0;
const unsigned int FACE = 3; //const unsigned int EDGE = 1;
const unsigned int VOLUME = 4; //const unsigned int ORIENTED_FACE = 2;
const unsigned int DART = 5; //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 struct Dart
{ {
......
...@@ -92,7 +92,10 @@ public: ...@@ -92,7 +92,10 @@ public:
virtual void mark(Dart d) virtual void mark(Dart d)
{ {
assert(m_map.getMarkerSet(DART, m_thread).testMark(m_mark)); 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: ...@@ -101,7 +104,8 @@ public:
virtual void unmark(Dart d) virtual void unmark(Dart d)
{ {
assert(m_map.getMarkerSet(DART, m_thread).testMark(m_mark)); 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: ...@@ -110,7 +114,8 @@ public:
virtual bool isMarked(Dart d) const virtual bool isMarked(Dart d) const
{ {
assert(m_map.getMarkerSet(DART, m_thread).testMark(m_mark)); 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: ...@@ -133,27 +138,27 @@ public:
m_map.foreach_dart_of_orbit(orbit, d, fm, m_thread) ; m_map.foreach_dart_of_orbit(orbit, d, fm, m_thread) ;
} }
/** // /**
* mark the darts of the given orbit of d in the parent map // * mark the darts of the given orbit of d in the parent map
*/ // */
template <typename MAP> // template <typename MAP>
void markOrbitInParent(unsigned int orbit, Dart d) // void markOrbitInParent(unsigned int orbit, Dart d)
{ // {
assert(m_map.getMarkerSet(DART, m_thread).testMark(m_mark)); // assert(m_map.getMarkerSet(DART, m_thread).testMark(m_mark));
FunctorMark<GenericMap> fm(m_map, m_mark, m_map.getMarkVector(DART, m_thread)) ; // 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); // 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 // * unmark the darts of the given orbit of d in the parent map
*/ // */
template <typename MAP> // template <typename MAP>
void unmarkOrbitInParent(unsigned int orbit, Dart d) // void unmarkOrbitInParent(unsigned int orbit, Dart d)
{ // {
assert(m_map.getMarkerSet(DART, m_thread).testMark(m_mark)); // assert(m_map.getMarkerSet(DART, m_thread).testMark(m_mark));
FunctorUnmark<GenericMap> fm(m_map, m_mark, m_map.getMarkVector(DART, m_thread)) ; // 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); // foreach_dart_of_orbit_in_parent<MAP>(dynamic_cast<MAP*>(&m_map), orbit, d, fm, m_thread);
} // }
/** /**
* mark all darts * mark all darts
...@@ -250,7 +255,8 @@ public: ...@@ -250,7 +255,8 @@ public:
void mark(Dart d) void mark(Dart d)
{ {
DartMarkerGen::mark(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) void markOrbit(unsigned int orbit, Dart d)
...@@ -260,13 +266,13 @@ public: ...@@ -260,13 +266,13 @@ public:
m_map.foreach_dart_of_orbit(orbit, d, fm, m_thread) ; m_map.foreach_dart_of_orbit(orbit, d, fm, m_thread) ;
} }
template <typename MAP> // template <typename MAP>
void markOrbitInParent(unsigned int orbit, Dart d) // void markOrbitInParent(unsigned int orbit, Dart d)
{ // {
assert(m_map.getMarkerSet(DART, m_thread).testMark(m_mark)); // 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) ; // 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); // foreach_dart_of_orbit_in_parent<MAP>(dynamic_cast<MAP*>(&m_map), orbit, d, fm, m_thread);
} // }
// void mark(unsigned int d) // void mark(unsigned int d)
// { // {
......
...@@ -319,6 +319,22 @@ public: ...@@ -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 // Multiple Functor: to apply several Functors in turn to a dart
/********************************************************/ /********************************************************/
...@@ -360,7 +376,8 @@ public: ...@@ -360,7 +376,8 @@ public:
{} {}
bool operator()(Dart d) 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 ; return false ;
} }
} ; } ;
...@@ -377,8 +394,9 @@ public: ...@@ -377,8 +394,9 @@ public:
{} {}
bool operator()(Dart d) bool operator()(Dart d)
{ {
this->m_markTable->operator[](d.index).setMark(this->m_mark) ; unsigned int d_index = this->m_map.dartIndex(d);
m_markedDarts.push_back(d.index) ; this->m_markTable->operator[](d_index).setMark(this->m_mark) ;
m_markedDarts.push_back(d_index) ;
return false ; return false ;
} }
} ; } ;
...@@ -391,7 +409,8 @@ public: ...@@ -391,7 +409,8 @@ public:
{} {}
bool operator()(Dart d) 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 ; return false ;
} }
} ; } ;
......
...@@ -115,6 +115,28 @@ protected: ...@@ -115,6 +115,28 @@ protected:
std::vector<DartMarkerGen*> dartMarkers ; std::vector<DartMarkerGen*> dartMarkers ;
std::vector<CellMarkerGen*> cellMarkers ; 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: public:
static const unsigned int UNKNOWN_ATTRIB = AttributeContainer::UNKNOWN ; static const unsigned int UNKNOWN_ATTRIB = AttributeContainer::UNKNOWN ;
...@@ -152,6 +174,12 @@ protected: ...@@ -152,6 +174,12 @@ protected:
void deleteDart(Dart d) ; void deleteDart(Dart d) ;
public: 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 * return true if the dart d refers to a valid index
*/ */
...@@ -433,10 +461,19 @@ public: ...@@ -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_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_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) { std::cerr<< "Not implemented"<< std::endl; return false;}
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) { std::cerr<< "Not implemented"<< std::endl; return false;}
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) { std::cerr<< "Not implemented"<< std::endl; return false;}
virtual bool foreach_dart_of_cc(Dart d, FunctorType& f, unsigned int thread = 0) = 0 ;
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 * execute functor for each orbit
...@@ -495,38 +532,38 @@ protected: ...@@ -495,38 +532,38 @@ protected:
void boundaryUnmarkAll(); void boundaryUnmarkAll();
} ; } ;
//
template <typename MAP> //template <typename MAP>
bool foreach_dart_of_orbit_in_parent(MAP* ptrMap, unsigned int orbit, Dart d, FunctorType& f, unsigned int thread = 0) //bool foreach_dart_of_orbit_in_parent(MAP* ptrMap, unsigned int orbit, Dart d, FunctorType& f, unsigned int thread = 0)
{ //{
switch(orbit) // switch(orbit)
{ // {
case DART: return f(d); // case DART: return f(d);
case VERTEX: return ptrMap->MAP::ParentMap::foreach_dart_of_vertex(d, f, thread) ; // 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 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 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 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) ; // case VOLUME: return ptrMap->MAP::ParentMap::foreach_dart_of_volume(d, f, thread) ;
default: assert(!"Cells of this dimension are not handled") ; // default: assert(!"Cells of this dimension are not handled") ;
} // }
return false ; // return false ;
} //}
//
template <typename MAP> //template <typename MAP>
bool foreach_dart_of_orbit_in_parent2(MAP* ptrMap, unsigned int orbit, Dart d, FunctorType& f, unsigned int thread = 0) //bool foreach_dart_of_orbit_in_parent2(MAP* ptrMap, unsigned int orbit, Dart d, FunctorType& f, unsigned int thread = 0)
{ //{
switch(orbit) // switch(orbit)
{ // {
case DART: return f(d); // case DART: return f(d);
case VERTEX: return ptrMap->MAP::ParentMap::ParentMap::foreach_dart_of_vertex(d, f,thread) ; // 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 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 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 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) ; // case VOLUME: return ptrMap->MAP::ParentMap::ParentMap::foreach_dart_of_volume(d, f, thread) ;
default: assert(!"Cells of this dimension are not handled") ; // default: assert(!"Cells of this dimension are not handled") ;
} // }
return false ; // return false ;
} //}
} //namespace CGoGN } //namespace CGoGN
......
...@@ -24,11 +24,32 @@ ...@@ -24,11 +24,32 @@
namespace CGoGN namespace CGoGN
{ {
//#ifndef CGoGN_FORCE_MR
//inline bool GenericMap::chechXmlNode(xmlNodePtr node, const std::string& name) 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 * * DARTS MANAGEMENT *
...@@ -37,23 +58,28 @@ namespace CGoGN ...@@ -37,23 +58,28 @@ namespace CGoGN
inline Dart GenericMap::newDart() inline Dart GenericMap::newDart()
{ {
Dart d = Dart::create(m_attribs[DART].insertLine()); Dart d = Dart::create(m_attribs[DART].insertLine());
unsigned int d_index = dartIndex(d);
for(unsigned int i = 0; i < NB_ORBITS; ++i) for(unsigned int i = 0; i < NB_ORBITS; ++i)
if (m_embeddings[i]) if (m_embeddings[i])
(*m_embeddings[i])[d.index] = EMBNULL ; {
(*m_embeddings[i])[d_index] = EMBNULL ;
}
return d ; return d ;
} }
inline void GenericMap::deleteDart(Dart 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) 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) for(unsigned int orbit = 0; orbit < NB_ORBITS; ++orbit)
{ {
if (m_embeddings[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(emb != EMBNULL)
{ {
if(m_attribs[orbit].unrefLine(emb)) if(m_attribs[orbit].unrefLine(emb))
...@@ -68,7 +94,7 @@ inline void GenericMap::deleteDart(Dart d) ...@@ -68,7 +94,7 @@ inline void GenericMap::deleteDart(Dart d)
inline bool GenericMap::isDartValid(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() inline unsigned int GenericMap::getNbDarts()
...@@ -98,10 +124,12 @@ inline unsigned int GenericMap::getEmbedding(unsigned int orbit, Dart d) ...@@ -98,10 +124,12 @@ inline unsigned int GenericMap::getEmbedding(unsigned int orbit, Dart d)
{ {
assert(isOrbitEmbedded(orbit) || !"Invalid parameter: orbit not embedded"); assert(isOrbitEmbedded(orbit) || !"Invalid parameter: orbit not embedded");
unsigned int d_index = dartIndex(d);
if (orbit == DART) 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) inline void GenericMap::copyDartEmbedding(unsigned int orbit, Dart d, Dart e)
...@@ -192,7 +220,10 @@ inline Dart GenericMap::end() ...@@ -192,7 +220,10 @@ inline Dart GenericMap::end()
inline void GenericMap::next(Dart& d) 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: ...@@ -100,8 +100,49 @@ public:
/******************************************************************************* /*******************************************************************************