Commit cb1ede68 authored by Pierre Kraemer's avatar Pierre Kraemer

orbit in template..

parent ba596b91
...@@ -235,7 +235,7 @@ void MyGlutWin::myKeyboard(unsigned char keycode, int x, int y) ...@@ -235,7 +235,7 @@ void MyGlutWin::myKeyboard(unsigned char keycode, int x, int y)
/** affichage **/ /** affichage **/
case 'd' : case 'd' :
{ {
int nbVertices = myMap.getNbOrbits(VERTEX) ; int nbVertices = myMap.getNbOrbits<VERTEX>() ;
CGoGNout << "nb darts = " << myMap.getNbOrbits(DART) << CGoGNendl; CGoGNout << "nb darts = " << myMap.getNbOrbits(DART) << CGoGNendl;
...@@ -399,9 +399,9 @@ int main(int argc, char **argv) ...@@ -399,9 +399,9 @@ int main(int argc, char **argv)
maillageTest(); maillageTest();
} }
//CGoGNout << "Nb Tetrahedron = " << myMap.getNbOrbits(VOLUME) << CGoGNendl; //CGoGNout << "Nb Tetrahedron = " << myMap.getNbOrbits<VOLUME>() << CGoGNendl;
// " / Nb Edges = " << myMap.getNbOrbits(EDGE) << // " / Nb Edges = " << myMap.getNbOrbits<EDGE>() <<
// " / Nb Vertices = " << myMap.getNbOrbits(VERTEX) << CGoGNendl; // " / Nb Vertices = " << myMap.getNbOrbits<VERTEX>() << CGoGNendl;
// un peu d'interface // un peu d'interface
MyGlutWin* mgw = new MyGlutWin(&argc,argv,1200,800); MyGlutWin* mgw = new MyGlutWin(&argc,argv,1200,800);
......
...@@ -558,7 +558,7 @@ void MyGlutWin::myKeyboard(unsigned char keycode, int x, int y) ...@@ -558,7 +558,7 @@ void MyGlutWin::myKeyboard(unsigned char keycode, int x, int y)
case 's': case 's':
{ {
unsigned int nbVertices = myMap.getNbOrbits(VERTEX) ; unsigned int nbVertices = myMap.getNbOrbits<VERTEX>() ;
GLint t1 = glutGet(GLUT_ELAPSED_TIME) ; GLint t1 = glutGet(GLUT_ELAPSED_TIME) ;
...@@ -818,9 +818,9 @@ int main(int argc, char** argv) ...@@ -818,9 +818,9 @@ int main(int argc, char** argv)
// myMap.closeMap(m) ; // myMap.closeMap(m) ;
} }
CGoGNout << myMap.getNbOrbits(VERTEX) << CGoGNendl ; CGoGNout << myMap.getNbOrbits<VERTEX>() << CGoGNendl ;
CGoGNout << myMap.getNbOrbits(EDGE) << CGoGNendl ; CGoGNout << myMap.getNbOrbits<EDGE>() << CGoGNendl ;
CGoGNout << myMap.getNbOrbits(FACE) << CGoGNendl ; CGoGNout << myMap.getNbOrbits<FACE>() << CGoGNendl ;
// compute width and position of object for centering // compute width and position of object for centering
Geom::BoundingBox<PFP::VEC3> bb = Algo::Geometry::computeBoundingBox<PFP>(myMap, mgw->position) ; Geom::BoundingBox<PFP::VEC3> bb = Algo::Geometry::computeBoundingBox<PFP>(myMap, mgw->position) ;
......
...@@ -143,7 +143,7 @@ int main(int argc, char **argv) ...@@ -143,7 +143,7 @@ int main(int argc, char **argv)
{ {
fonction_exemple<PFP>(myMap, position, d); fonction_exemple<PFP>(myMap, position, d);
// marque tous les brins de la face de d // marque tous les brins de la face de d
mf.markOrbit(FACE, d); mf.markOrbit<FACE>(d);
} }
} }
......
...@@ -142,7 +142,7 @@ void decimate( ...@@ -142,7 +142,7 @@ void decimate(
if(!selector->init()) if(!selector->init())
return ; return ;
unsigned int nbVertices = map.getNbOrbits(VERTEX) ; unsigned int nbVertices = map.getNbOrbits<VERTEX>() ;
bool finished = false ; bool finished = false ;
Dart d ; Dart d ;
......
...@@ -322,7 +322,7 @@ bool EdgeSelector_QEM<PFP>::init() ...@@ -322,7 +322,7 @@ bool EdgeSelector_QEM<PFP>::init()
quadric[d] += q ; // and add the contribution of quadric[d] += q ; // and add the contribution of
quadric[d1] += q ; // this quadric to the ones quadric[d1] += q ; // this quadric to the ones
quadric[d_1] += q ; // of the 3 incident vertices quadric[d_1] += q ; // of the 3 incident vertices
mark.markOrbit(FACE, d) ; mark.markOrbit<FACE>(d) ;
} }
} }
...@@ -527,7 +527,7 @@ bool EdgeSelector_QEMml<PFP>::init() ...@@ -527,7 +527,7 @@ bool EdgeSelector_QEMml<PFP>::init()
quadric[d] += q ; // and add the contribution of quadric[d] += q ; // and add the contribution of
quadric[d1] += q ; // this quadric to the ones quadric[d1] += q ; // this quadric to the ones
quadric[d_1] += q ; // of the 3 incident vertices quadric[d_1] += q ; // of the 3 incident vertices
mark.markOrbit(FACE, d) ; mark.markOrbit<FACE>(d) ;
} }
} }
...@@ -886,7 +886,7 @@ void EdgeSelector_Curvature<PFP>::computeEdgeInfo(Dart d, EdgeInfo& einfo) ...@@ -886,7 +886,7 @@ void EdgeSelector_Curvature<PFP>::computeEdgeInfo(Dart d, EdgeInfo& einfo)
Dart d2 = m.phi2(m.phi_1(d)) ; Dart d2 = m.phi2(m.phi_1(d)) ;
Dart dd2 = m.phi2(m.phi_1(dd)) ; Dart dd2 = m.phi2(m.phi_1(dd)) ;
m.extractTrianglePair(d) ; m.extractTrianglePair(d) ;
unsigned int newV = m.embedNewCell(VERTEX, d2) ; unsigned int newV = m.embedNewCell<VERTEX>(d2) ;
this->m_position[newV] = m_positionApproximator->getApprox(d) ; this->m_position[newV] = m_positionApproximator->getApprox(d) ;
// compute things on the coarse version of the mesh // compute things on the coarse version of the mesh
...@@ -899,8 +899,8 @@ void EdgeSelector_Curvature<PFP>::computeEdgeInfo(Dart d, EdgeInfo& einfo) ...@@ -899,8 +899,8 @@ void EdgeSelector_Curvature<PFP>::computeEdgeInfo(Dart d, EdgeInfo& einfo)
// vertex split to reset the initial connectivity and embeddings // vertex split to reset the initial connectivity and embeddings
m.insertTrianglePair(d, d2, dd2) ; m.insertTrianglePair(d, d2, dd2) ;
m.embedOrbit(VERTEX, d, v1) ; m.embedOrbit<VERTEX>(d, v1) ;
m.embedOrbit(VERTEX, dd, v2) ; m.embedOrbit<VERTEX>(dd, v2) ;
REAL err = 0 ; REAL err = 0 ;
......
...@@ -211,7 +211,7 @@ void Approximator_MidEdge<PFP>::approximate(Dart d) ...@@ -211,7 +211,7 @@ void Approximator_MidEdge<PFP>::approximate(Dart d)
// temporary edge collapse // temporary edge collapse
m.extractTrianglePair(d) ; m.extractTrianglePair(d) ;
unsigned int newV = m.embedNewCell(VERTEX, d2) ; unsigned int newV = m.embedNewCell<VERTEX>(d2) ;
this->m_attrV[newV] = this->m_approx[d] ; this->m_attrV[newV] = this->m_approx[d] ;
// compute the detail vector // compute the detail vector
...@@ -220,8 +220,8 @@ void Approximator_MidEdge<PFP>::approximate(Dart d) ...@@ -220,8 +220,8 @@ void Approximator_MidEdge<PFP>::approximate(Dart d)
// vertex split to reset the initial connectivity and embeddings // vertex split to reset the initial connectivity and embeddings
m.insertTrianglePair(d, d2, dd2) ; m.insertTrianglePair(d, d2, dd2) ;
m.embedOrbit(VERTEX, d, m.getEmbedding<VERTEX>(d)) ; m.embedOrbit<VERTEX>(d, m.getEmbedding<VERTEX>(d)) ;
m.embedOrbit(VERTEX, dd, m.getEmbedding<VERTEX>(dd)) ; m.embedOrbit<VERTEX>(dd, m.getEmbedding<VERTEX>(dd)) ;
} }
} }
...@@ -259,7 +259,7 @@ void Approximator_HalfCollapse<PFP>::approximate(Dart d) ...@@ -259,7 +259,7 @@ void Approximator_HalfCollapse<PFP>::approximate(Dart d)
// temporary edge collapse // temporary edge collapse
m.extractTrianglePair(d) ; m.extractTrianglePair(d) ;
unsigned int newV = m.embedNewCell(VERTEX, d2) ; unsigned int newV = m.embedNewCell<VERTEX>(d2) ;
this->m_attrV[newV] = this->m_approx[d] ; this->m_attrV[newV] = this->m_approx[d] ;
// compute the detail vector // compute the detail vector
...@@ -268,8 +268,8 @@ void Approximator_HalfCollapse<PFP>::approximate(Dart d) ...@@ -268,8 +268,8 @@ void Approximator_HalfCollapse<PFP>::approximate(Dart d)
// vertex split to reset the initial connectivity and embeddings // vertex split to reset the initial connectivity and embeddings
m.insertTrianglePair(d, d2, dd2) ; m.insertTrianglePair(d, d2, dd2) ;
m.embedOrbit(VERTEX, d, m.getEmbedding<VERTEX>(d)) ; m.embedOrbit<VERTEX>(d, m.getEmbedding<VERTEX>(d)) ;
m.embedOrbit(VERTEX, dd, m.getEmbedding<VERTEX>(dd)) ; m.embedOrbit<VERTEX>(dd, m.getEmbedding<VERTEX>(dd)) ;
} }
} }
......
...@@ -81,7 +81,7 @@ bool HalfEdgeSelector_QEMml<PFP>::init() ...@@ -81,7 +81,7 @@ bool HalfEdgeSelector_QEMml<PFP>::init()
quadric[d] += q ; // and add the contribution of quadric[d] += q ; // and add the contribution of
quadric[d1] += q ; // this quadric to the ones quadric[d1] += q ; // this quadric to the ones
quadric[d_1] += q ; // of the 3 incident vertices quadric[d_1] += q ; // of the 3 incident vertices
mark.markOrbit(FACE, d) ; mark.markOrbit<FACE>(d) ;
} }
} }
...@@ -339,7 +339,7 @@ bool HalfEdgeSelector_Lightfield<PFP>::init() ...@@ -339,7 +339,7 @@ bool HalfEdgeSelector_Lightfield<PFP>::init()
quadric[d] += q ; // and add the contribution of quadric[d] += q ; // and add the contribution of
quadric[d1] += q ; // this quadric to the ones quadric[d1] += q ; // this quadric to the ones
quadric[d_1] += q ; // of the 3 incident vertices quadric[d_1] += q ; // of the 3 incident vertices
mark.markOrbit(FACE, d) ; mark.markOrbit<FACE>(d) ;
} }
} }
...@@ -617,7 +617,7 @@ bool EdgeSelector_Lightfield<PFP>::init() ...@@ -617,7 +617,7 @@ bool EdgeSelector_Lightfield<PFP>::init()
quadric[d] += q ; // and add the contribution of quadric[d] += q ; // and add the contribution of
quadric[d1] += q ; // this quadric to the ones quadric[d1] += q ; // this quadric to the ones
quadric[d_1] += q ; // of the 3 incident vertices quadric[d_1] += q ; // of the 3 incident vertices
mark.markOrbit(FACE, d) ; mark.markOrbit<FACE>(d) ;
} }
} }
......
...@@ -67,7 +67,7 @@ SimplifTrian<PFP>::SimplifTrian(MAP& the_map, unsigned int idPos, CRIT* cr): ...@@ -67,7 +67,7 @@ SimplifTrian<PFP>::SimplifTrian(MAP& the_map, unsigned int idPos, CRIT* cr):
m_edgeEmb[d] = it; m_edgeEmb[d] = it;
// mark cell for traversal // mark cell for traversal
m.markOrbit(EDGE, d); m.markOrbit<EDGE>(d);
} }
} }
} }
...@@ -101,7 +101,7 @@ void SimplifTrian<PFP>::changeCriteria(CRIT* cr) ...@@ -101,7 +101,7 @@ void SimplifTrian<PFP>::changeCriteria(CRIT* cr)
m_edgeEmb[d] = it; m_edgeEmb[d] = it;
// mark cell for traversal // mark cell for traversal
m.markOrbit(EDGE, d); m.markOrbit<EDGE>(d);
} }
} }
} }
...@@ -175,7 +175,7 @@ void SimplifTrian<PFP>::updateCriterias(Dart d) ...@@ -175,7 +175,7 @@ void SimplifTrian<PFP>::updateCriterias(Dart d)
CRIT_IT it = m_edgeCrit.insert(std::make_pair(key,cr)); CRIT_IT it = m_edgeCrit.insert(std::make_pair(key,cr));
// store iterator on edge // store iterator on edge
unsigned int em = m_map.getEmbedding(d, EDGE); unsigned int em = m_map.getEmbedding(d, EDGE);
m_map.embedOrbit(EDGE, d, em); m_map.embedOrbit<EDGE>(d, em);
m_edgeEmb[em] = it; m_edgeEmb[em] = it;
m_protectMarker.mark(em) ; m_protectMarker.mark(em) ;
...@@ -235,7 +235,7 @@ Dart SimplifTrian<PFP>::edgeCollapse(Dart d, typename PFP::VEC3& newPos) ...@@ -235,7 +235,7 @@ Dart SimplifTrian<PFP>::edgeCollapse(Dart d, typename PFP::VEC3& newPos)
// embed new vertex // embed new vertex
unsigned int emb = m_map.getEmbedding(d2, VERTEX); unsigned int emb = m_map.getEmbedding(d2, VERTEX);
m_map.embedOrbit(VERTEX, d2, emb); m_map.embedOrbit<VERTEX>(d2, emb);
m_positions[d2] = newPos; m_positions[d2] = newPos;
m_valences[d2] = v_d + v_dd - 4; m_valences[d2] = v_d + v_dd - 4;
......
...@@ -47,7 +47,7 @@ void decimate( ...@@ -47,7 +47,7 @@ void decimate(
selector->init(approximator); selector->init(approximator);
//Init nbCell in the mesh //Init nbCell in the mesh
unsigned int nbCell = map.getNbOrbits(VOLUME); unsigned int nbCell = map.getNbOrbits<VOLUME>();
CGoGNout << "nbCell = " << nbCell << CGoGNendl; CGoGNout << "nbCell = " << nbCell << CGoGNendl;
......
...@@ -109,7 +109,7 @@ void export3MeshPlainSmooth(std::ofstream& out, typename PFP::MAP& map, typename ...@@ -109,7 +109,7 @@ void export3MeshPlainSmooth(std::ofstream& out, typename PFP::MAP& map, typename
if(good(d) && !markF.isMarked(d) && map.phi3(d)==d) if(good(d) && !markF.isMarked(d) && map.phi3(d)==d)
{ {
markF.markOrbit(FACE, d) ; markF.markOrbit<FACE>(d) ;
std::vector<unsigned int> fidx ; std::vector<unsigned int> fidx ;
fidx.reserve(4) ; fidx.reserve(4) ;
Dart dd = d ; Dart dd = d ;
......
...@@ -54,7 +54,7 @@ bool isConvex(typename PFP::MAP& map, Dart d, const typename PFP::TVEC3& positio ...@@ -54,7 +54,7 @@ bool isConvex(typename PFP::MAP& map, Dart d, const typename PFP::TVEC3& positio
Dart e = *it; Dart e = *it;
if (!m.isMarked(e)) if (!m.isMarked(e))
{ {
m.markOrbit(EDGE, e) ; m.markOrbit<EDGE>(e) ;
convex = isTetrahedronWellOriented<PFP>(map, e, position, CCW) ; convex = isTetrahedronWellOriented<PFP>(map, e, position, CCW) ;
} }
} }
......
...@@ -122,7 +122,7 @@ typename PFP::VEC3 vertexBorderNormal(typename PFP::MAP& map, Dart d, const type ...@@ -122,7 +122,7 @@ typename PFP::VEC3 vertexBorderNormal(typename PFP::MAP& map, Dart d, const type
VEC3 N(0) ; VEC3 N(0) ;
std::vector<Dart> faces; std::vector<Dart> faces;
CellMarker f(map,FACE); CellMarker<FACE> f(map);
FunctorStore fs(faces); FunctorStore fs(faces);
map.foreach_dart_of_oriented_vertex(d,fs); map.foreach_dart_of_oriented_vertex(d,fs);
......
...@@ -74,7 +74,7 @@ typename PFP::REAL convexPolyhedronVolume(typename PFP::MAP& map, Dart d, const ...@@ -74,7 +74,7 @@ typename PFP::REAL convexPolyhedronVolume(typename PFP::MAP& map, Dart d, const
std::vector<Dart> visitedFaces ; std::vector<Dart> visitedFaces ;
visitedFaces.reserve(100) ; visitedFaces.reserve(100) ;
visitedFaces.push_back(d) ; visitedFaces.push_back(d) ;
mark.markOrbit(FACE, d) ; mark.markOrbit<FACE>(d) ;
for(typename std::vector<Dart>::iterator face = visitedFaces.begin(); face != visitedFaces.end(); ++face) for(typename std::vector<Dart>::iterator face = visitedFaces.begin(); face != visitedFaces.end(); ++face)
{ {
...@@ -104,7 +104,7 @@ typename PFP::REAL convexPolyhedronVolume(typename PFP::MAP& map, Dart d, const ...@@ -104,7 +104,7 @@ typename PFP::REAL convexPolyhedronVolume(typename PFP::MAP& map, Dart d, const
if(!mark.isMarked(ee)) // not already marked if(!mark.isMarked(ee)) // not already marked
{ {
visitedFaces.push_back(ee) ; visitedFaces.push_back(ee) ;
mark.markOrbit(FACE, e) ; mark.markOrbit<FACE>(e) ;
} }
e = map.phi1(e) ; e = map.phi1(e) ;
} while(e != *face) ; } while(e != *face) ;
......
...@@ -36,19 +36,19 @@ namespace Algo ...@@ -36,19 +36,19 @@ namespace Algo
namespace IHM namespace IHM
{ {
template<typename T> class AttributeHandler_IHM ; template<typename T, unsigned int ORBIT> class AttributeHandler_IHM ;
class ImplicitHierarchicalMap : public EmbeddedMap2 class ImplicitHierarchicalMap : public EmbeddedMap2
{ {
template<typename T> friend class AttributeHandler_IHM ; template<typename T, unsigned int ORBIT> friend class AttributeHandler_IHM ;
private: private:
unsigned int m_curLevel ; unsigned int m_curLevel ;
unsigned int m_maxLevel ; unsigned int m_maxLevel ;
unsigned int m_idCount ; unsigned int m_idCount ;
AttributeHandler<unsigned int> m_dartLevel ; AttributeHandler<unsigned int, DART> m_dartLevel ;
AttributeHandler<unsigned int> m_edgeId ; AttributeHandler<unsigned int, DART> m_edgeId ;
AttributeMultiVector<unsigned int>* m_nextLevelCell[NB_ORBITS] ; AttributeMultiVector<unsigned int>* m_nextLevelCell[NB_ORBITS] ;
...@@ -63,11 +63,11 @@ public: ...@@ -63,11 +63,11 @@ public:
* ATTRIBUTES MANAGEMENT * * ATTRIBUTES MANAGEMENT *
***************************************************/ ***************************************************/
template <typename T> template <typename T, unsigned int ORBIT>
AttributeHandler_IHM<T> addAttribute(unsigned int orbit, const std::string& nameAttr) ; AttributeHandler_IHM<T, ORBIT> addAttribute(const std::string& nameAttr) ;
template <typename T> template <typename T, unsigned int ORBIT>
AttributeHandler_IHM<T> getAttribute(unsigned int orbit, const std::string& nameAttr) ; AttributeHandler_IHM<T, ORBIT> getAttribute(const std::string& nameAttr) ;
/*************************************************** /***************************************************
* MAP TRAVERSAL * * MAP TRAVERSAL *
...@@ -201,26 +201,26 @@ public: ...@@ -201,26 +201,26 @@ public:
bool faceIsSubdividedOnce(Dart d) ; bool faceIsSubdividedOnce(Dart d) ;
} ; } ;
template <typename T> template <typename T, unsigned int ORBIT>
class AttributeHandler_IHM : public AttributeHandler<T> class AttributeHandler_IHM : public AttributeHandler<T, ORBIT>
{ {
public: public:
typedef T DATA_TYPE ; typedef T DATA_TYPE ;
AttributeHandler_IHM() : AttributeHandler<T>() AttributeHandler_IHM() : AttributeHandler<T, ORBIT>()
{} {}
AttributeHandler_IHM(GenericMap* m, AttributeMultiVector<T>* amv) : AttributeHandler<T>(m, amv) AttributeHandler_IHM(GenericMap* m, AttributeMultiVector<T>* amv) : AttributeHandler<T, ORBIT>(m, amv)
{} {}
AttributeMultiVector<T>* getDataVector() const AttributeMultiVector<T>* getDataVector() const
{ {
return AttributeHandler<T>::getDataVector() ; return AttributeHandler<T, ORBIT>::getDataVector() ;
} }
bool isValid() const bool isValid() const
{ {
return AttributeHandler<T>::isValid() ; return AttributeHandler<T, ORBIT>::isValid() ;
} }
T& operator[](Dart d) ; T& operator[](Dart d) ;
...@@ -229,12 +229,12 @@ public: ...@@ -229,12 +229,12 @@ public:
T& operator[](unsigned int a) T& operator[](unsigned int a)
{ {
return AttributeHandler<T>::operator[](a) ; return AttributeHandler<T, ORBIT>::operator[](a) ;
} }
const T& operator[](unsigned int a) const const T& operator[](unsigned int a) const
{ {
return AttributeHandler<T>::operator[](a) ; return AttributeHandler<T, ORBIT>::operator[](a) ;
} }
} ; } ;
......
...@@ -35,32 +35,32 @@ namespace IHM ...@@ -35,32 +35,32 @@ namespace IHM
* ATTRIBUTES MANAGEMENT * * ATTRIBUTES MANAGEMENT *
***************************************************/ ***************************************************/
template <typename T> template <typename T, unsigned int ORBIT>
AttributeHandler_IHM<T> ImplicitHierarchicalMap::addAttribute(unsigned int orbit, const std::string& nameAttr) AttributeHandler_IHM<T, ORBIT> ImplicitHierarchicalMap::addAttribute(const std::string& nameAttr)
{ {
bool addNextLevelCell = false ; bool addNextLevelCell = false ;
if(!isOrbitEmbedded(orbit)) if(!isOrbitEmbedded(ORBIT))
addNextLevelCell = true ; addNextLevelCell = true ;
AttributeHandler<T> h = Map2::addAttribute<T>(orbit, nameAttr) ; AttributeHandler<T, ORBIT> h = Map2::addAttribute<T, ORBIT>(nameAttr) ;
if(addNextLevelCell) if(addNextLevelCell)
{ {
AttributeContainer& cellCont = m_attribs[orbit] ; AttributeContainer& cellCont = m_attribs[ORBIT] ;
AttributeMultiVector<unsigned int>* amv = cellCont.addAttribute<unsigned int>("nextLevelCell") ; AttributeMultiVector<unsigned int>* amv = cellCont.addAttribute<unsigned int>("nextLevelCell") ;
m_nextLevelCell[orbit] = amv ; m_nextLevelCell[ORBIT] = amv ;
for(unsigned int i = cellCont.begin(); i < cellCont.end(); cellCont.next(i)) for(unsigned int i = cellCont.begin(); i < cellCont.end(); cellCont.next(i))
amv->operator[](i) = EMBNULL ; amv->operator[](i) = EMBNULL ;
} }
return AttributeHandler_IHM<T>(this, h.getDataVector()) ; return AttributeHandler_IHM<T, ORBIT>(this, h.getDataVector()) ;
} }
template <typename T> template <typename T, unsigned int ORBIT>
AttributeHandler_IHM<T> ImplicitHierarchicalMap::getAttribute(unsigned int orbit, const std::string& nameAttr) AttributeHandler_IHM<T, ORBIT> ImplicitHierarchicalMap::getAttribute(const std::string& nameAttr)
{ {
AttributeHandler<T> h = Map2::getAttribute<T>(orbit, nameAttr) ; AttributeHandler<T, ORBIT> h = Map2::getAttribute<T, ORBIT>(nameAttr) ;
return AttributeHandler_IHM<T>(this, h.getDataVector()) ; return AttributeHandler_IHM<T, ORBIT>(this, h.getDataVector()) ;
} }
/*************************************************** /***************************************************
...@@ -258,8 +258,8 @@ inline void ImplicitHierarchicalMap::splitFace(Dart d, Dart e) ...@@ -258,8 +258,8 @@ inline void ImplicitHierarchicalMap::splitFace(Dart d, Dart e)
{ {
unsigned int cur = m_curLevel ; unsigned int cur = m_curLevel ;
m_curLevel = m_maxLevel ; m_curLevel = m_maxLevel ;
this->embedOrbit(FACE, d, this->getEmbedding(FACE, d)) ; this->embedOrbit<FACE>(d, this->getEmbedding<FACE>(d)) ;
this->embedOrbit(FACE, e, this->getEmbedding(FACE, e)) ; this->embedOrbit<FACE>(e, this->getEmbedding<FACE>(e)) ;
m_curLevel = cur ; m_curLevel = cur ;
} }
} }
...@@ -336,8 +336,8 @@ inline unsigned int ImplicitHierarchicalMap::edgeLevel(Dart d) ...@@ -336,8 +336,8 @@ inline unsigned int ImplicitHierarchicalMap::edgeLevel(Dart d)
* ATTRIBUTE HANDLER * * ATTRIBUTE HANDLER *
***************************************************/ ***************************************************/
template <typename T> template <typename T, unsigned int ORBIT>
T& AttributeHandler_IHM<T>::operator[](Dart d) T& AttributeHandler_IHM<T, ORBIT>::operator[](Dart d)
{ {
ImplicitHierarchicalMap* m = reinterpret_cast<ImplicitHierarchicalMap*>(this->m_map) ; ImplicitHierarchicalMap* m = reinterpret_cast<ImplicitHierarchicalMap*>(this->m_map) ;
assert(m->m_dartLevel[d] <= m->m_curLevel || !"Access to a dart introduced after current level") ; assert(m->m_dartLevel[d] <= m->m_curLevel || !"Access to a dart introduced after current level") ;
...@@ -345,15 +345,15 @@ T& AttributeHandler_IHM<T>::operator[](Dart d) ...@@ -345,15 +345,15 @@ T& AttributeHandler_IHM<T>::operator[](Dart d)
unsigned int orbit = this->getOrbit() ; unsigned int orbit = this->getOrbit() ;
unsigned int nbSteps = m->m_curLevel - m->vertexInsertionLevel(d) ; unsigned int nbSteps = m->m_curLevel - m->vertexInsertionLevel(d) ;
unsigned int index = m->getEmbedding(orbit, d) ; unsigned int index = m->getEmbedding<ORBIT>(d) ;
if(index == EMBNULL) if(index == EMBNULL)
{ {
index = m->embedNewCell(orbit, d) ; index = m->embedNewCell<ORBIT>(d) ;
m->m_nextLevelCell[orbit]->operator[](index) = EMBNULL ; m->m_nextLevelCell[orbit]->operator[](index) = EMBNULL ;
} }
AttributeContainer& cont = m->getAttributeContainer(orbit) ; AttributeContainer& cont = m->getAttributeContainer<ORBIT>() ;
unsigned int step = 0 ; unsigned int step = 0 ;
while(step < nbSteps)