Commit 0003689c authored by Pierre Kraemer's avatar Pierre Kraemer

-> stop lazy embedding

parent 3dc1a1ed
......@@ -877,8 +877,8 @@ void EdgeSelector_Curvature<PFP>::computeEdgeInfo(Dart d, EdgeInfo& einfo)
MAP& m = this->m_map ;
Dart dd = m.phi2(d) ;
unsigned int v1 = m.getEmbedding(d, VERTEX_ORBIT) ;
unsigned int v2 = m.getEmbedding(dd, VERTEX_ORBIT) ;
unsigned int v1 = m.getEmbedding(VERTEX_ORBIT, d) ;
unsigned int v2 = m.getEmbedding(VERTEX_ORBIT, dd) ;
m_positionApproximator->approximate(d) ;
......
......@@ -220,8 +220,8 @@ void Approximator_MidEdge<PFP>::approximate(Dart d)
// vertex split to reset the initial connectivity and embeddings
m.insertTrianglePair(d, d2, dd2) ;
m.embedOrbit(VERTEX_ORBIT, d, m.getEmbedding(d, VERTEX_ORBIT)) ;
m.embedOrbit(VERTEX_ORBIT, dd, m.getEmbedding(dd, VERTEX_ORBIT)) ;
m.embedOrbit(VERTEX_ORBIT, d, m.getEmbedding(VERTEX_ORBIT, d)) ;
m.embedOrbit(VERTEX_ORBIT, dd, m.getEmbedding(VERTEX_ORBIT, dd)) ;
}
}
......@@ -268,8 +268,8 @@ void Approximator_HalfCollapse<PFP>::approximate(Dart d)
// vertex split to reset the initial connectivity and embeddings
m.insertTrianglePair(d, d2, dd2) ;
m.embedOrbit(VERTEX_ORBIT, d, m.getEmbedding(d, VERTEX_ORBIT)) ;
m.embedOrbit(VERTEX_ORBIT, dd, m.getEmbedding(dd, VERTEX_ORBIT)) ;
m.embedOrbit(VERTEX_ORBIT, d, m.getEmbedding(VERTEX_ORBIT, d)) ;
m.embedOrbit(VERTEX_ORBIT, dd, m.getEmbedding(VERTEX_ORBIT, dd)) ;
}
}
......
......@@ -71,7 +71,7 @@ bool exportPLY(typename PFP::MAP& map, const typename PFP::TVEC3& position, cons
Dart dd = d ;
do
{
unsigned int vNum = map.getEmbedding(dd, VERTEX_ORBIT) ;
unsigned int vNum = map.getEmbedding(VERTEX_ORBIT, dd) ;
if(!markV.isMarked(dd))
{
markV.mark(dd) ;
......@@ -149,7 +149,7 @@ bool exportOFF(typename PFP::MAP& map, const typename PFP::TVEC3& position, cons
Dart dd = d ;
do
{
unsigned int vNum = map.getEmbedding(dd, VERTEX_ORBIT) ;
unsigned int vNum = map.getEmbedding(VERTEX_ORBIT, dd) ;
if(!markV.isMarked(dd))
{
markV.mark(dd) ;
......@@ -286,7 +286,7 @@ bool exportPLYPTM(typename PFP::MAP& map, const char* filename, const typename P
{
if (!markV.isMarked(e))
{
vertices.push_back(map.getEmbedding(e, VERTEX_ORBIT));
vertices.push_back(map.getEmbedding(VERTEX_ORBIT, e));
tableVertLab[e] = lab++;
markV.mark(e);
......@@ -434,7 +434,7 @@ bool exportPLYPTM(typename PFP::MAP& map, const char* filename, const typename P
{
if (!markV.isMarked(e))
{
vertices.push_back(map.getEmbedding(e, VERTEX_ORBIT));
vertices.push_back(map.getEmbedding(VERTEX_ORBIT, e));
tableVertLab[e] = lab++;
markV.mark(e);
......
......@@ -258,8 +258,8 @@ inline void ImplicitHierarchicalMap::splitFace(Dart d, Dart e)
{
unsigned int cur = m_curLevel ;
m_curLevel = m_maxLevel ;
this->embedOrbit(FACE_ORBIT, d, this->getDartEmbedding(FACE_ORBIT, d)) ;
this->embedOrbit(FACE_ORBIT, e, this->getDartEmbedding(FACE_ORBIT, e)) ;
this->embedOrbit(FACE_ORBIT, d, this->getEmbedding(FACE_ORBIT, d)) ;
this->embedOrbit(FACE_ORBIT, e, this->getEmbedding(FACE_ORBIT, e)) ;
m_curLevel = cur ;
}
}
......@@ -345,7 +345,7 @@ T& AttributeHandler_IHM<T>::operator[](Dart d)
unsigned int orbit = this->getOrbit() ;
unsigned int nbSteps = m->m_curLevel - m->vertexInsertionLevel(d) ;
unsigned int index = m->getEmbedding(d, orbit) ;
unsigned int index = m->getEmbedding(orbit, d) ;
if(index == EMBNULL)
{
......@@ -381,7 +381,7 @@ const T& AttributeHandler_IHM<T>::operator[](Dart d) const
unsigned int orbit = this->getOrbit() ;
unsigned int nbSteps = m->m_curLevel - m->vertexInsertionLevel(d) ;
unsigned int index = m->getEmbedding(d, orbit) ;
unsigned int index = m->getEmbedding(orbit, d) ;
unsigned int step = 0 ;
while(step < nbSteps)
......
......@@ -628,7 +628,7 @@ T& AttributeHandler_IHM<T>::operator[](Dart d)
unsigned int orbit = this->getOrbit() ;
unsigned int nbSteps = m->m_curLevel - m->vertexInsertionLevel(d) ;
unsigned int index = m->getEmbedding(d, orbit) ;
unsigned int index = m->getEmbedding(orbit, d) ;
if(index == EMBNULL)
{
......@@ -664,7 +664,7 @@ const T& AttributeHandler_IHM<T>::operator[](Dart d) const
unsigned int orbit = this->getOrbit() ;
unsigned int nbSteps = m->m_curLevel - m->vertexInsertionLevel(d) ;
unsigned int index = m->getEmbedding(d, orbit) ;
unsigned int index = m->getEmbedding(orbit, d) ;
unsigned int step = 0 ;
while(step < nbSteps)
......
......@@ -96,11 +96,11 @@ bool importMesh(typename PFP::MAP& map, MeshTablesSurface<PFP>& mts)
// darts incident to end vertex of edge
std::vector<Dart>& vec = vecDartsPerVertex[map.phi1(d)];
unsigned int embd = map.getDartEmbedding(VERTEX_ORBIT, d);
unsigned int embd = map.getEmbedding(VERTEX_ORBIT, d);
Dart good_dart;
for (typename std::vector<Dart>::iterator it = vec.begin(); it != vec.end() && good_dart == Dart::nil(); ++it)
{
if (map.getDartEmbedding(VERTEX_ORBIT, map.phi1(*it)) == embd)
if (map.getEmbedding(VERTEX_ORBIT, map.phi1(*it)) == embd)
good_dart = *it;
}
......@@ -260,14 +260,14 @@ bool importMesh(typename PFP::MAP& map, MeshTablesVolume<PFP>& mtv)
std::vector<Dart>& vec = vecDartsPerVertex[map.phi1(d)];
//Phi3 reconstruction
unsigned int emb1d = map.getDartEmbedding(VERTEX_ORBIT, map.phi_1(d));
unsigned int emb2d = map.getDartEmbedding(VERTEX_ORBIT, map.phi1(map.phi1(d)));
unsigned int emb1d = map.getEmbedding(VERTEX_ORBIT, map.phi_1(d));
unsigned int emb2d = map.getEmbedding(VERTEX_ORBIT, map.phi1(map.phi1(d)));
for (typename std::vector<Dart>::iterator it = vec.begin(); it != vec.end(); ++it)
{
Dart dprim=*it;
unsigned int emb1dprim = map.getDartEmbedding(VERTEX_ORBIT, map.phi1(map.phi1(dprim)));
unsigned int emb2dprim = map.getDartEmbedding(VERTEX_ORBIT, map.phi_1(dprim));
unsigned int emb1dprim = map.getEmbedding(VERTEX_ORBIT, map.phi1(map.phi1(dprim)));
unsigned int emb2dprim = map.getEmbedding(VERTEX_ORBIT, map.phi_1(dprim));
if(emb1d == emb1dprim && emb2d == emb2dprim)
{
......@@ -276,14 +276,14 @@ bool importMesh(typename PFP::MAP& map, MeshTablesVolume<PFP>& mtv)
}
//Phi2 reconstruction
emb1d = map.getDartEmbedding(VERTEX_ORBIT, d);
emb2d = map.getDartEmbedding(VERTEX_ORBIT, map.phi1(d));
emb1d = map.getEmbedding(VERTEX_ORBIT, d);
emb2d = map.getEmbedding(VERTEX_ORBIT, map.phi1(d));
for (typename std::vector<Dart>::iterator it = vec.begin(); it != vec.end(); ++it)
{
Dart dprim=*it;
unsigned int emb1dprim = map.getDartEmbedding(VERTEX_ORBIT, map.phi1(dprim));
unsigned int emb2dprim = map.getDartEmbedding(VERTEX_ORBIT, dprim);
unsigned int emb1dprim = map.getEmbedding(VERTEX_ORBIT, map.phi1(dprim));
unsigned int emb2dprim = map.getEmbedding(VERTEX_ORBIT, dprim);
if(emb1d == emb1dprim && emb2d == emb2dprim)
{
......@@ -295,8 +295,6 @@ bool importMesh(typename PFP::MAP& map, MeshTablesVolume<PFP>& mtv)
}
}
return true ;
//
......@@ -387,7 +385,7 @@ bool importMesh(typename PFP::MAP& map, MeshTablesVolume<PFP>& mtv)
// // darts incident to end vertex of edge
// std::vector<Dart>& vec = vecDartsPerVertex[map.phi1(d)];
//
// unsigned int embd = map.getDartEmbedding(VERTEX_ORBIT, d);
// unsigned int embd = map.getEmbedding(VERTEX_ORBIT, d);
// unsigned int nbf = 0;
// Dart good_dart = d;
//
......@@ -395,7 +393,7 @@ bool importMesh(typename PFP::MAP& map, MeshTablesVolume<PFP>& mtv)
//
// for(typename std::vector<Dart>::iterator it = vec.begin(); it != vec.end(); ++it)
// {
// if (map.getDartEmbedding(VERTEX_ORBIT, map.phi1(*it)) == embd)
// if (map.getEmbedding(VERTEX_ORBIT, map.phi1(*it)) == embd)
// {
// good_dart = *it;
// nbf++;
......@@ -520,12 +518,12 @@ bool importMesh(typename PFP::MAP& map, const std::string& filename, std::vector
// // darts incident to end vertex of edge
// std::vector<Dart>& vec = vecDartsPerVertex[map.phi1(d)];
//
// unsigned int embd = map.getDartEmbedding(VERTEX_ORBIT, d);
// unsigned int embd = map.getEmbedding(VERTEX_ORBIT, d);
// unsigned int nbf=0;
// Dart good_dart;
// for (typename std::vector<Dart>::iterator it = vec.begin(); it != vec.end(); ++it)
// {
// if ( map.getDartEmbedding(VERTEX_ORBIT,map.phi1(*it))==embd)
// if ( map.getEmbedding(VERTEX_ORBIT,map.phi1(*it))==embd)
// {
// good_dart = *it;
// nbf++;
......@@ -566,7 +564,7 @@ bool importMesh(typename PFP::MAP& map, const std::string& filename, std::vector
//// typename std::vector<Dart>::iterator jt = vd.begin();
//// while (!map.isMarkedDart(*jt, m))
//// jt++;
//// unsigned int P = map.getDartEmbedding(VERTEX_ORBIT, *jt);
//// unsigned int P = map.getEmbedding(VERTEX_ORBIT, *jt);
//// // while vertex if a "non manifold point"
//// while (vecEmbNbFp[index] > 1)
//// {
......@@ -576,9 +574,9 @@ bool importMesh(typename PFP::MAP& map, const std::string& filename, std::vector
//// {
//// e = map.phi1(e);
//// // embedding of boundary darts on the fly
//// unsigned int emb = map.getDartEmbedding(VERTEX_ORBIT, map.phi1(map.phi2(e)));
//// unsigned int emb = map.getEmbedding(VERTEX_ORBIT, map.phi1(map.phi2(e)));
//// map.setDartEmbedding(VERTEX_ORBIT, e, emb);
//// } while (map.getDartEmbedding(VERTEX_ORBIT, map.phi2(e)) != P);
//// } while (map.getEmbedding(VERTEX_ORBIT, map.phi2(e)) != P);
//// // separate the face
//// map.phi1sew(map.phi2(*jt), e);
//// vecEmbNbFp[index]--;
......@@ -586,11 +584,11 @@ bool importMesh(typename PFP::MAP& map, const std::string& filename, std::vector
//// // copy embedding of vertex of boundary of last face
//// Dart e = map.phi2(*jt);
//// Dart d = e;
//// if (map.getDartEmbedding(VERTEX_ORBIT, d) == EMBNULL)
//// if (map.getEmbedding(VERTEX_ORBIT, d) == EMBNULL)
//// {
//// do
//// {
//// unsigned int emb = map.getDartEmbedding(VERTEX_ORBIT, map.phi1(map.phi2(d)));
//// unsigned int emb = map.getEmbedding(VERTEX_ORBIT, map.phi1(map.phi2(d)));
//// map.setDartEmbedding(VERTEX_ORBIT, d, emb);
//// d = map.phi1(d);
//// } while (d != e);
......
......@@ -48,9 +48,9 @@ inline void MapRender::addTri(typename PFP::MAP& map, Dart d, std::vector<GLuint
// loop to cut a polygon in triangle on the fly (works only with convex faces)
do
{
tableIndices.push_back(map.getEmbedding(d, VERTEX_ORBIT));
tableIndices.push_back(map.getEmbedding(b, VERTEX_ORBIT));
tableIndices.push_back(map.getEmbedding(c, VERTEX_ORBIT));
tableIndices.push_back(map.getEmbedding(VERTEX_ORBIT, d));
tableIndices.push_back(map.getEmbedding(VERTEX_ORBIT, b));
tableIndices.push_back(map.getEmbedding(VERTEX_ORBIT, c));
b = c;
c = map.phi1(b);
} while (c != d);
......@@ -139,8 +139,8 @@ void MapRender::initLines(typename PFP::MAP& map, const FunctorSelect& good, std
{
if(!m.isMarked(d) && good(d))
{
tableIndices.push_back(map.getEmbedding(d, VERTEX_ORBIT));
tableIndices.push_back(map.getEmbedding(map.phi2(d), VERTEX_ORBIT));
tableIndices.push_back(map.getEmbedding(VERTEX_ORBIT, d));
tableIndices.push_back(map.getEmbedding(VERTEX_ORBIT, map.phi2(d)));
m.markOrbit(EDGE_ORBIT, d);
}
}
......@@ -172,9 +172,9 @@ void MapRender::initLinesOptimized(typename PFP::MAP& map, const FunctorSelect&
if (!m.isMarked(ee))
{
if(good(ee))
tableIndices.push_back(map.getEmbedding(ee, VERTEX_ORBIT));
tableIndices.push_back(map.getEmbedding(VERTEX_ORBIT, ee));
if(good(f))
tableIndices.push_back(map.getEmbedding(map.phi1(ee), VERTEX_ORBIT));
tableIndices.push_back(map.getEmbedding(VERTEX_ORBIT, map.phi1(ee)));
m.markOrbit(EDGE_ORBIT, f);
bound.push_back(f);
......@@ -205,7 +205,7 @@ void MapRender::initPoints(typename PFP::MAP& map, const FunctorSelect& good, st
{
if(!m.isMarked(d) && good(d))
{
tableIndices.push_back(map.getEmbedding(d, VERTEX_ORBIT));
tableIndices.push_back(map.getEmbedding(VERTEX_ORBIT, d));
m.mark(d) ;
}
}
......
......@@ -94,7 +94,7 @@ inline T& AttributeHandler<T>::operator[](Dart d)
{
assert(isValid() || !"Invalid AttributeHandler") ;
unsigned int orbit = m_attrib->getOrbit() ;
unsigned int a = m_map->getEmbedding(d, orbit) ;
unsigned int a = m_map->getEmbedding(orbit, d) ;
if (a == EMBNULL)
a = m_map->embedNewCell(orbit, d);
......@@ -106,7 +106,7 @@ template <typename T>
inline const T& AttributeHandler<T>::operator[](Dart d) const
{
assert(isValid() || !"Invalid AttributeHandler") ;
unsigned int a = m_map->getEmbedding(d, m_attrib->getOrbit()) ;
unsigned int a = m_map->getEmbedding(m_attrib->getOrbit(), d) ;
return m_attrib->operator[](a) ;
}
......
......@@ -88,7 +88,7 @@ public:
virtual void mark(Dart d)
{
unsigned int cell = m_marker.getCell() ;
unsigned int a = m_map.getEmbedding(d, cell);
unsigned int a = m_map.getEmbedding(cell, d);
if (a == EMBNULL)
a = m_map.embedNewCell(cell, d);
......@@ -101,7 +101,7 @@ public:
virtual void unmark(Dart d)
{
unsigned int cell = m_marker.getCell() ;
unsigned int a = m_map.getEmbedding(d, cell);
unsigned int a = m_map.getEmbedding(cell, d);
if (a == EMBNULL)
a = m_map.embedNewCell(cell, d);
......@@ -114,7 +114,7 @@ public:
virtual bool isMarked(Dart d)
{
unsigned int cell = m_marker.getCell() ;
unsigned int a = m_map.getEmbedding(d, cell);
unsigned int a = m_map.getEmbedding(cell, d);
if (a == EMBNULL)
return false;
......@@ -198,7 +198,7 @@ public:
void mark(Dart d)
{
CellMarker::mark(d) ;
m_markedCells.push_back(m_map.getEmbedding(d, m_marker.getCell())) ;
m_markedCells.push_back(m_map.getEmbedding(m_marker.getCell(), d)) ;
}
/**
......
......@@ -38,21 +38,13 @@ template <typename MAP2>
class EmbeddedMap2 : public MAP2
{
public:
/**
*
*/
virtual void deleteFace(Dart d) ;
/**
* The attributes attached to the old vertex are duplicated on both resulting vertices
* No attribute is attached to the new edge
* Nothing has to be done for the faces
*/
virtual void splitVertex(Dart d, Dart e) ;
/**
* Nothing has to be done for the vertices
* Nothing has to be done for the edges
* The attributes attached to the face of d are kept on the resulting face
*/
virtual bool deleteVertex(Dart d) ;
......@@ -60,7 +52,6 @@ public:
/**
* No attribute is attached to the new vertex
* The attributes attached to the old edge are duplicated on both resulting edges
* Nothing has to be done for the faces
*/
virtual void cutEdge(Dart d) ;
......@@ -91,34 +82,27 @@ public:
/**
* The attributes attached to the vertices of the edge of d are kept on the vertices of the resulting edge
* The attributes attached to the edge of d are kept on the resulting edge
* Nothing has to be done for the faces
*/
virtual void sewFaces(Dart d, Dart e) ;
/**
* The attributes attached to the vertices of the old edge of d are duplicated on the vertices of both resulting edges
* The attributes attached to the old edge are duplicated on both resulting edges
* Nothing has to be done for the faces
*/
virtual void unsewFaces(Dart d) ;
/**
* Nothing has to be done for the vertices
* The attributes attached to the edge of d are kept on the resulting edge
* Nothing has to be done for the faces
*/
virtual bool collapseDegeneratedFace(Dart d);
/**
* Nothing has to be done for the vertices
* No attribute is attached to the new edge
* The attributes attached to the old face are duplicated on both resulting faces
*/
virtual void splitFace(Dart d, Dart e) ;
/**
* Nothing has to be done for the vertices
* Nothing has to be done for the edges
* The attributes attached to the face of dart d are kept on the resulting face
*/
virtual bool mergeFaces(Dart d) ;
......@@ -126,7 +110,6 @@ public:
/**
* The attributes attached to the vertices of the face of d are kept on the resulting vertices
* The attributes attached to the edges of the face of d are kept on the resulting edges
* Nothing has to be done for the faces
*/
virtual bool mergeVolumes(Dart d, Dart e) ;
......
This diff is collapsed.
......@@ -86,7 +86,7 @@ void EmbeddedMap3<MAP3>::sewVolumes(Dart d, Dart e)
{
Dart dd = d ;
do {
vEmb1 = MAP3::getEmbedding(d, VERTEX_ORBIT);
vEmb1 = MAP3::getEmbedding(VERTEX_ORBIT, d);
MAP3::embedOrbit(VERTEX_ORBIT, d, vEmb1) ;
dd = MAP3::phi1(dd) ;
} while(dd != d) ;
......@@ -130,7 +130,7 @@ void EmbeddedMap3<MAP3>::unsewVolumes(Dart d)
{
Dart e = MAP3::phi3(dd);
vEmb1 = MAP3::getEmbedding(dd, EDGE_ORBIT);
vEmb1 = MAP3::getEmbedding(EDGE_ORBIT, dd);
MAP3::setDartEmbedding(EDGE_ORBIT, dd, vEmb1) ;
......@@ -158,14 +158,14 @@ bool EmbeddedMap3<MAP3>::mergeVolumes(Dart d)
if (MAP3::isOrbitEmbedded(VOLUME_ORBIT))
{
fEmb = MAP3::getEmbedding(d, VOLUME_ORBIT);
fEmb = MAP3::getEmbedding(VOLUME_ORBIT, d);
if(fEmb != EMBNULL)
MAP3::setDartEmbedding(VOLUME_ORBIT, d2, fEmb) ;
}
if (MAP3::isOrbitEmbedded(EDGE_ORBIT))
{
eEmb = MAP3::getEmbedding(d, EDGE_ORBIT);
eEmb = MAP3::getEmbedding(EDGE_ORBIT, d);
if(eEmb != EMBNULL)
MAP3::setDartEmbedding(EDGE_ORBIT, a2, eEmb);
}
......@@ -257,7 +257,7 @@ int EmbeddedMap3<MAP3>::collapseEdge(Dart d, bool delDegenerateFaces,
unsigned int vEmb = EMBNULL ;
if(MAP3::isOrbitEmbedded(VERTEX_ORBIT))
{
vEmb = MAP3::getEmbedding(d, VERTEX_ORBIT) ;
vEmb = MAP3::getEmbedding(VERTEX_ORBIT, d) ;
MAP3::embedOrbit(VERTEX_ORBIT,d,vEmb);
MAP3::embedOrbit(VERTEX_ORBIT,MAP3::phi2(d),vEmb);
}
......
......@@ -158,12 +158,12 @@ public:
* (can go through the whole orbit due to lazy embedding)
* @return EMBNULL if the orbit of d is not attached to any cell
*/
unsigned int getEmbedding(Dart d, unsigned int orbit);
unsigned int getEmbedding(unsigned int orbit, Dart d);
/**
* Get the cell index of the given dimension associated to dart d
*/
unsigned int getDartEmbedding(unsigned int orbit, Dart d);
// /**
// * Get the cell index of the given dimension associated to dart d
// */
// unsigned int getDartEmbedding(unsigned int orbit, Dart d);
/**
* Set the cell index of the given dimension associated to dart d
......
......@@ -94,68 +94,7 @@ inline unsigned int GenericMap::nbEmbeddings() const
return nb ;
}
inline unsigned int GenericMap::getEmbedding(Dart d, unsigned int orbit)
{
assert(isOrbitEmbedded(orbit) || !"Invalid parameter: orbit not embedded");
if (orbit == DART_ORBIT)
return d.index;
unsigned int emb = (*m_embeddings[orbit])[d.index] ;
if(emb != EMBNULL)
return emb ;
class FunctorGetLazyEmb: public FunctorType
{
protected:
GenericMap& m_map;
unsigned int m_orbit;
AttributeMultiVector<unsigned int>* m_emb;
unsigned int m_val;
std::vector<Dart> m_darts;
public:
FunctorGetLazyEmb(GenericMap& map, unsigned int orbit):
m_map(map), m_orbit(orbit), m_val(EMBNULL)
{
m_emb = m_map.getEmbeddingAttributeVector(orbit) ;
m_darts.reserve(8) ;
}
bool operator()(Dart d)
{
if ((*m_emb)[d.index] != EMBNULL)
{
m_val = (*m_emb)[d.index];
return true;
}
m_darts.push_back(d);
return false;
}
unsigned int getVal()
{
if(m_val != EMBNULL)
{
AttributeContainer& cont = m_map.getAttributeContainer(m_orbit) ;
for(std::vector<Dart>::iterator it = m_darts.begin(); it != m_darts.end(); ++it)
{
(*m_emb)[it->index] = m_val;
cont.refLine(m_val) ;
}
}
return m_val;
}
};
FunctorGetLazyEmb fle(*this, orbit);
foreach_dart_of_orbit(orbit, d, fle);
return fle.getVal();
}
inline unsigned int GenericMap::getDartEmbedding(unsigned int orbit, Dart d)
inline unsigned int GenericMap::getEmbedding(unsigned int orbit, Dart d)
{
assert(isOrbitEmbedded(orbit) || !"Invalid parameter: orbit not embedded");
......@@ -165,10 +104,20 @@ inline unsigned int GenericMap::getDartEmbedding(unsigned int orbit, Dart d)
return (*m_embeddings[orbit])[d.index] ;
}
//inline unsigned int GenericMap::getDartEmbedding(unsigned int orbit, Dart d)
//{
// assert(isOrbitEmbedded(orbit) || !"Invalid parameter: orbit not embedded");
//
// if (orbit == DART_ORBIT)
// return d.index;
//
// return (*m_embeddings[orbit])[d.index] ;
//}
inline void GenericMap::copyDartEmbedding(unsigned int orbit, Dart d, Dart e)
{
assert(isOrbitEmbedded(orbit) || !"Invalid parameter: orbit not embedded");
setDartEmbedding(orbit, d, getDartEmbedding(orbit, e));
setDartEmbedding(orbit, d, getEmbedding(orbit, e));
}
inline unsigned int GenericMap::newCell(unsigned int orbit)
......@@ -188,7 +137,6 @@ inline unsigned int GenericMap::embedNewCell(unsigned int orbit, Dart d)
{
assert(isOrbitEmbedded(orbit) || !"Invalid parameter: orbit not embedded");
unsigned int em = newCell(orbit);
// setDartEmbedding(orbit, d, em) ; // possible ?? utile ??
embedOrbit(orbit, d, em);
return em;
}
......@@ -196,14 +144,12 @@ inline unsigned int GenericMap::embedNewCell(unsigned int orbit, Dart d)
inline void GenericMap::copyCell(unsigned int orbit, Dart d, Dart e)
{
assert(isOrbitEmbedded(orbit) || !"Invalid parameter: orbit not embedded");
unsigned int dE = getEmbedding(d, orbit) ;
unsigned int eE = getEmbedding(e, orbit) ;
unsigned int dE = getEmbedding(orbit, d) ;
unsigned int eE = getEmbedding(orbit, e) ;
if(eE != EMBNULL) // if the source is NULL, nothing to copy
{
if(dE == EMBNULL) // if the dest is NULL, create a new cell
{
dE = embedNewCell(orbit, d) ;
}
m_attribs[orbit].copyLine(dE, eE) ; // copy the data
}
}
......@@ -211,7 +157,7 @@ inline void GenericMap::copyCell(unsigned int orbit, Dart d, Dart e)
inline void GenericMap::copyCell(unsigned int orbit, unsigned int i, unsigned int j)
{
assert(isOrbitEmbedded(orbit) || !"Invalid parameter: orbit not embedded");
m_attribs[orbit].copyLine(i,j) ;
m_attribs[orbit].copyLine(i, j) ;
}
inline void GenericMap::initCell(unsigned int orbit, unsigned int i)
......
......@@ -97,7 +97,7 @@ GenericMap::~GenericMap()
void GenericMap::setDartEmbedding(unsigned int orbit, Dart d, unsigned int emb)
{
assert(isOrbitEmbedded(orbit) || !"Invalid parameter: orbit not embedded");
unsigned int old = getDartEmbedding(orbit, d);
unsigned int old = getEmbedding(orbit, d);
// if same emb nothing to do
if (old == emb)
......@@ -129,7 +129,7 @@ void GenericMap::initOrbitEmbedding(unsigned int orbit, bool realloc)
if(!mark.isMarked(d))
{
mark.markOrbit(orbit, d) ;
if(realloc || getEmbedding(d, orbit) == EMBNULL)
if(realloc || getEmbedding(orbit, d) == EMBNULL)
embedNewCell(orbit, d) ;
}
}
......
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