Commit 6ed3fb3a authored by Pierre Kraemer's avatar Pierre Kraemer

cutEdge return Dart in GMap + importMesh OK for map and GMap

parent f547dc86
......@@ -76,7 +76,10 @@ bool importMesh(typename PFP::MAP& map, MeshTablesSurface<PFP>& mts)
for (unsigned int j = 0; j < nbe; ++j)
{
unsigned int em = edgesBuffer[j]; // get embedding
map.embedOrbit(VERTEX, d, em) ;
FunctorSetEmb<GenericMap> fsetemb(map, VERTEX, em);
foreach_dart_of_orbit_in_parent<typename PFP::MAP>(&map, VERTEX, d, fsetemb) ;
vecDartsPerVertex[em].push_back(d); // store incident darts for fast adjacency reconstruction
d = map.phi1(d);
}
......
......@@ -54,7 +54,7 @@ public:
* No attribute is attached to the new vertex
* The attributes attached to the old edge are duplicated on both resulting edges
*/
virtual void cutEdge(Dart d) ;
virtual Dart cutEdge(Dart d) ;
/**
* The attributes attached to the edge of d are kept on the resulting edge
......
......@@ -47,7 +47,7 @@ public:
//! Cut the edge of d
/*! @param d a dart of the edge to cut
*/
virtual void cutEdge(Dart d);
virtual Dart cutEdge(Dart d);
/*! The attributes attached to the edge of d are kept on the resulting edge
* @param d a dart of the edge to cut
......
......@@ -110,9 +110,10 @@ public:
//@{
//! Cut an edge inserting a new dart between d and its successor in the face
/*! @param d the edge to cut
* @return a dart of the new vertex
* \image hmtl map1_cutEdge.png
*/
void cutEdge(Dart d);
Dart cutEdge(Dart d);
//! Undo the cut of the edge of d
/*! @param d a dart of the edge to uncut
......
......@@ -147,7 +147,7 @@ inline void GMap1::beta1unsew(Dart d)
* Topological operations on 1-G-maps
*************************************************************************/
inline void GMap1::cutEdge(Dart d)
inline Dart GMap1::cutEdge(Dart d)
{
Dart dd = beta0(d) ;
Dart e = newDart();
......@@ -162,6 +162,8 @@ inline void GMap1::cutEdge(Dart d)
boundaryMark(e);
boundaryMark(f);
}
return f ;
}
inline void GMap1::uncutEdge(Dart d)
......
......@@ -130,8 +130,9 @@ public:
//! Cut the edge of d by inserting a new vertex
/*! @param d a dart of the edge to cut
* @return a dart of the new vertex
*/
virtual void cutEdge(Dart d);
virtual Dart cutEdge(Dart d);
//! Undo the cut of the edge of d
/*! @param d a dart of the edge to uncut
......
......@@ -113,8 +113,9 @@ public:
//! Cut the edge of d (all darts around edge orbit are cut)
/*! @param d a dart of the edge to cut
* @return a dart of the new vertex
*/
virtual void cutEdge(Dart d);
virtual Dart cutEdge(Dart d);
//! Uncut the edge of d (all darts around edge orbit are uncut)
/*! @param d a dart of the edge to uncut
......
......@@ -72,11 +72,9 @@ Dart EmbeddedGMap2::deleteVertex(Dart d)
return f ;
}
void EmbeddedGMap2::cutEdge(Dart d)
Dart EmbeddedGMap2::cutEdge(Dart d)
{
GMap2::cutEdge(d) ;
Dart nd = phi1(d) ;
Dart nd = GMap2::cutEdge(d) ;
if (isOrbitEmbedded(EDGE))
{
......@@ -97,6 +95,8 @@ void EmbeddedGMap2::cutEdge(Dart d)
setDartEmbedding(FACE, phi1(e), f2Emb) ;
setDartEmbedding(FACE, beta0(e), f2Emb) ;
}
return nd ;
}
bool EmbeddedGMap2::uncutEdge(Dart d)
......
......@@ -43,9 +43,9 @@ Dart EmbeddedGMap3::deleteVertex(Dart d)
return v ;
}
void EmbeddedGMap3::cutEdge(Dart d)
Dart EmbeddedGMap3::cutEdge(Dart d)
{
GMap3::cutEdge(d);
Dart nd = GMap3::cutEdge(d);
if(isOrbitEmbedded(EDGE))
{
......@@ -90,6 +90,8 @@ void EmbeddedGMap3::cutEdge(Dart d)
f = alpha2(f);
} while(f != d);
}
return nd ;
}
bool EmbeddedGMap3::uncutEdge(Dart d)
......
......@@ -162,20 +162,20 @@ Dart GMap2::deleteVertex(Dart d)
return res ;
}
void GMap2::cutEdge(Dart d)
Dart GMap2::cutEdge(Dart d)
{
Dart e = phi2(d) ;
beta2unsew(d) ;
beta2unsew(e) ;
GMap1::cutEdge(d) ;
GMap1::cutEdge(e) ;
Dart nd = GMap1::cutEdge(d) ;
Dart ne = GMap1::cutEdge(e) ;
Dart nd = phi1(d) ;
Dart ne = phi1(e) ;
beta2sew(d, beta0(ne)) ;
beta2sew(beta0(d), ne) ;
beta2sew(e, beta0(nd)) ;
beta2sew(beta0(e), nd) ;
return nd ;
}
bool GMap2::uncutEdge(Dart d)
......
......@@ -137,11 +137,11 @@ Dart GMap3::deleteVertex(Dart d)
return NIL ;
}
void GMap3::cutEdge(Dart d)
Dart GMap3::cutEdge(Dart d)
{
Dart prev = d ;
Dart dd = alpha2(d) ;
GMap2::cutEdge(d) ;
Dart nd = GMap2::cutEdge(d) ;
while(dd != d)
{
......@@ -158,6 +158,8 @@ void GMap3::cutEdge(Dart d)
Dart d3 = beta3(d);
beta3sew(beta0(d), beta0(d3));
beta3sew(phi1(d), phi1(d3));
return nd ;
}
bool GMap3::uncutEdge(Dart 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