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

-> 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) ;
......
......@@ -28,82 +28,38 @@
namespace CGoGN
{
template <typename MAP2>
void EmbeddedMap2<MAP2>::deleteFace(Dart d)
{
if (MAP2::isOrbitEmbedded(VERTEX_ORBIT))
{
Dart dd = d ;
do
{
unsigned int vEmb = MAP2::getDartEmbedding(VERTEX_ORBIT, dd) ;
if(vEmb != EMBNULL)
MAP2::setDartEmbedding(VERTEX_ORBIT, MAP2::alpha1(d), vEmb) ;
dd = MAP2::phi1(dd) ;
} while(dd != d) ;
}
if (MAP2::isOrbitEmbedded(EDGE_ORBIT))
{
Dart dd = d ;
do
{
unsigned int eEmb = MAP2::getDartEmbedding(EDGE_ORBIT, dd) ;
if(eEmb != EMBNULL)
MAP2::setDartEmbedding(EDGE_ORBIT, MAP2::phi2(d), eEmb) ;
dd = MAP2::phi1(dd) ;
} while(dd != d) ;
}
MAP2::deleteFace(d) ;
}
template <typename MAP2>
void EmbeddedMap2<MAP2>::splitVertex(Dart d, Dart e)
{
unsigned int vEmb = EMBNULL ;
if (MAP2::isOrbitEmbedded(VERTEX_ORBIT))
{
vEmb = MAP2::getEmbedding(d, VERTEX_ORBIT) ;
}
Dart dd = MAP2::phi2(d) ;
Dart ee = MAP2::phi2(e) ;
MAP2::splitVertex(d, e) ;
if (MAP2::isOrbitEmbedded(VERTEX_ORBIT))
{
MAP2::setDartEmbedding(VERTEX_ORBIT, d, vEmb) ;
MAP2::copyDartEmbedding(VERTEX_ORBIT, MAP2::phi1(dd), d) ;
MAP2::copyDartEmbedding(VERTEX_ORBIT, MAP2::phi1(ee), e) ;
MAP2::embedNewCell(VERTEX_ORBIT, e) ;
MAP2::copyCell(VERTEX_ORBIT, e, d) ;
}
if(MAP2::isOrbitEmbedded(FACE_ORBIT))
{
MAP2::copyDartEmbedding(FACE_ORBIT, MAP2::phi1(dd), dd) ;
MAP2::copyDartEmbedding(FACE_ORBIT, MAP2::phi1(ee), ee) ;
}
}
template <typename MAP2>
bool EmbeddedMap2<MAP2>::deleteVertex(Dart d)
{
if(MAP2::isOrbitEmbedded(VERTEX_ORBIT))
{
Dart vit = d ;
do
{
unsigned int vEmb = MAP2::getDartEmbedding(VERTEX_ORBIT, MAP2::phi2(vit)) ;
if(vEmb != EMBNULL)
MAP2::setDartEmbedding(VERTEX_ORBIT, MAP2::phi1(vit), vEmb) ;
vit = MAP2::alpha1(vit) ;
} while(vit != d) ;
}
Dart f = MAP2::phi1(d) ;
unsigned int fEmb = EMBNULL ;
if (MAP2::isOrbitEmbedded(FACE_ORBIT))
{
fEmb = MAP2::getEmbedding(d, FACE_ORBIT) ;
}
if(MAP2::deleteVertex(d))
{
if (MAP2::isOrbitEmbedded(FACE_ORBIT))
{
MAP2::embedOrbit(FACE_ORBIT, f, fEmb) ;
MAP2::embedOrbit(FACE_ORBIT, f, MAP2::getEmbedding(FACE_ORBIT, f)) ;
}
return true ;
}
......@@ -113,20 +69,21 @@ bool EmbeddedMap2<MAP2>::deleteVertex(Dart d)
template <typename MAP2>
void EmbeddedMap2<MAP2>::cutEdge(Dart d)
{
unsigned int eEmb = EMBNULL ;
if (MAP2::isOrbitEmbedded(EDGE_ORBIT))
{
eEmb = MAP2::getEmbedding(d, EDGE_ORBIT) ;
}
MAP2::cutEdge(d) ;
Dart nd = MAP2::phi1(d) ;
if (MAP2::isOrbitEmbedded(EDGE_ORBIT))
{
Dart e = MAP2::phi1(d) ;
MAP2::setDartEmbedding(EDGE_ORBIT, d, eEmb) ;
MAP2::embedNewCell(EDGE_ORBIT, e) ;
MAP2::copyCell(EDGE_ORBIT, e, d) ;
MAP2::embedNewCell(EDGE_ORBIT, nd) ;
MAP2::copyCell(EDGE_ORBIT, nd, d) ;
}
if(MAP2::isOrbitEmbedded(FACE_ORBIT))
{
MAP2::copyDartEmbedding(FACE_ORBIT, MAP2::phi1(d), d) ;
Dart e = MAP2::phi2(nd) ;
if(e != nd)
MAP2::copyDartEmbedding(FACE_ORBIT, MAP2::phi1(e), e) ;
}
}
......@@ -165,7 +122,7 @@ bool EmbeddedMap2<MAP2>::edgeCanCollapse(Dart d)
Dart end = MAP2::phi1(dd) ;
do
{
unsigned int ve = MAP2::getEmbedding(MAP2::phi2(vit1), VERTEX_ORBIT) ;
unsigned int ve = MAP2::getEmbedding(VERTEX_ORBIT, MAP2::phi2(vit1)) ;
vu1.push_back(ve) ;
vit1 = MAP2::alpha1(vit1) ;
} while(vit1 != end) ;
......@@ -173,7 +130,7 @@ bool EmbeddedMap2<MAP2>::edgeCanCollapse(Dart d)
Dart vit2 = MAP2::alpha1(MAP2::alpha1(dd)) ;
do
{
unsigned int ve = MAP2::getEmbedding(MAP2::phi2(vit2), VERTEX_ORBIT) ;
unsigned int ve = MAP2::getEmbedding(VERTEX_ORBIT, MAP2::phi2(vit2)) ;
std::vector<unsigned int>::iterator it = std::find(vu1.begin(), vu1.end(), ve) ;
if(it != vu1.end())
return false ;
......@@ -189,7 +146,7 @@ Dart EmbeddedMap2<MAP2>::collapseEdge(Dart d, bool delDegenerateFaces)
unsigned int vEmb = EMBNULL ;
if (MAP2::isOrbitEmbedded(VERTEX_ORBIT))
{
vEmb = MAP2::getEmbedding(d, VERTEX_ORBIT) ;
vEmb = MAP2::getEmbedding(VERTEX_ORBIT, d) ;
}
Dart dV = MAP2::collapseEdge(d, delDegenerateFaces);
......@@ -211,27 +168,13 @@ bool EmbeddedMap2<MAP2>::flipEdge(Dart d)
if (MAP2::isOrbitEmbedded(VERTEX_ORBIT))
{
unsigned int dVEmb = MAP2::getDartEmbedding(VERTEX_ORBIT, d) ;
if(dVEmb != EMBNULL)
MAP2::setDartEmbedding(VERTEX_ORBIT, MAP2::phi_1(d), dVEmb) ;
MAP2::setDartEmbedding(VERTEX_ORBIT, d, EMBNULL) ;
unsigned int eVEmb = MAP2::getDartEmbedding(VERTEX_ORBIT, e) ;
if(eVEmb != EMBNULL)
MAP2::setDartEmbedding(VERTEX_ORBIT, MAP2::phi_1(e), eVEmb) ;
MAP2::setDartEmbedding(VERTEX_ORBIT, e, EMBNULL) ;
MAP2::setDartEmbedding(VERTEX_ORBIT, d, MAP2::getEmbedding(VERTEX_ORBIT, MAP2::phi1(e))) ;
MAP2::setDartEmbedding(VERTEX_ORBIT, e, MAP2::getEmbedding(VERTEX_ORBIT, MAP2::phi1(d))) ;
}
if (MAP2::isOrbitEmbedded(FACE_ORBIT))
{
unsigned int dFEmb = MAP2::getDartEmbedding(FACE_ORBIT, MAP2::phi_1(e)) ;
if(dFEmb != EMBNULL)
MAP2::setDartEmbedding(FACE_ORBIT, d, dFEmb) ;
MAP2::setDartEmbedding(FACE_ORBIT, MAP2::phi_1(e), EMBNULL) ;
unsigned int eFEmb = MAP2::getDartEmbedding(FACE_ORBIT, MAP2::phi_1(d)) ;
if(eFEmb != EMBNULL)
MAP2::setDartEmbedding(FACE_ORBIT, e, eFEmb) ;
MAP2::setDartEmbedding(FACE_ORBIT, MAP2::phi_1(d), EMBNULL) ;
MAP2::setDartEmbedding(FACE_ORBIT, MAP2::phi_1(d), MAP2::getEmbedding(FACE_ORBIT, d)) ;
MAP2::setDartEmbedding(FACE_ORBIT, MAP2::phi_1(e), MAP2::getEmbedding(FACE_ORBIT, e)) ;
}
return true ;
}
......@@ -247,28 +190,13 @@ bool EmbeddedMap2<MAP2>::flipBackEdge(Dart d)
if (MAP2::isOrbitEmbedded(VERTEX_ORBIT))
{
unsigned int dVEmb = MAP2::getDartEmbedding(VERTEX_ORBIT, d) ;