Commit a08ce280 authored by untereiner's avatar untereiner

embeddedMap3 almost over !

parent d1687ca2
......@@ -152,6 +152,14 @@ public:
{}
};
template <typename MAP>
class TraversorOF : public TraversorCell<MAP>
{
public:
TraversorOF(MAP& m, const FunctorSelect& good = allDarts, unsigned int thread = 0) : TraversorCell<MAP>(m, ORIENTED_FACE, good, thread)
{}
};
template <typename MAP>
class TraversorF : public TraversorCell<MAP>
{
......
......@@ -62,7 +62,7 @@ public:
/*!
*
*/
virtual void sewVolumes(Dart d, Dart e);
virtual void sewVolumes(Dart d, Dart e, bool withBoundary = true);
/*!
*
......
......@@ -364,6 +364,11 @@ public:
* Should be executed after import
*/
virtual bool check();
/**
* Check if a serie of darts is an oriented simple close path
*/
virtual bool checkSimpleOrientedPath(std::vector<Dart>& vd);
//@}
/*! @name Cell Functors
......
......@@ -259,24 +259,15 @@ bool EmbeddedMap2::flipBackEdge(Dart d)
void EmbeddedMap2::sewFaces(Dart d, Dart e, bool withBoundary)
{
// for fixed point construction (import & primitives)
if (!withBoundary)
return Map2::sewFaces(d, e, false) ;
// if (!withBoundary)
// return Map2::sewFaces(d, e, false) ;
unsigned int vEmb1 = EMBNULL ;
unsigned int vEmb2 = EMBNULL ;
if (isOrbitEmbedded(VERTEX))
{
vEmb1 = getEmbedding(VERTEX, d) ;
vEmb2 = getEmbedding(VERTEX, phi1(d)) ;
}
Map2::sewFaces(d, e, true) ;
Map2::sewFaces(d, e, withBoundary) ;
if (isOrbitEmbedded(VERTEX))
{
embedOrbit(VERTEX, d, vEmb1) ;
embedOrbit(VERTEX, e, vEmb2) ;
embedOrbit(VERTEX, d, getEmbedding(VERTEX, d)) ;
embedOrbit(VERTEX, e, getEmbedding(VERTEX, phi1(d))) ;
}
if (isOrbitEmbedded(EDGE))
......@@ -343,6 +334,7 @@ void EmbeddedMap2::splitFace(Dart d, Dart e)
}
if (isOrbitEmbedded(FACE))
{
copyDartEmbedding(FACE, phi_1(d), d) ;
embedNewCell(FACE, e) ;
copyCell(FACE, e, d) ;
}
......@@ -367,7 +359,9 @@ bool EmbeddedMap2::mergeVolumes(Dart d, Dart e)
{
std::vector<Dart> darts ;
std::vector<unsigned int> vEmb ;
vEmb.reserve(32) ;
std::vector<unsigned int> eEmb ;
eEmb.reserve(32) ;
Dart fit = d ;
do
{
......@@ -452,6 +446,15 @@ bool EmbeddedMap2::check()
}
}
if (isOrbitEmbedded(ORIENTED_FACE))
{
if (getEmbedding(ORIENTED_FACE, d) != getEmbedding(ORIENTED_FACE, phi1(d)))
{
CGoGNout << "Check: different embeddings on oriented face" << CGoGNendl ;
return false ;
}
}
if (isOrbitEmbedded(FACE))
{
if (getEmbedding(FACE, d) != getEmbedding(FACE, phi1(d)))
......
This diff is collapsed.
......@@ -474,7 +474,7 @@ bool Map2::mergeVolumes(Dart d, Dart e)
{
assert(!isBoundaryMarked(d) && !isBoundaryMarked(e)) ;
if (isBoundaryFace(d) || isBoundaryFace(e))
if (Map2::isBoundaryFace(d) || Map2::isBoundaryFace(e))
return false;
// First traversal of both faces to check the face sizes
......@@ -707,6 +707,21 @@ bool Map2::check()
return true;
}
bool Map2::checkSimpleOrientedPath(std::vector<Dart>& vd)
{
for(std::vector<Dart>::iterator it = vd.begin() ; it != vd.end() ; ++it)
{
std::vector<Dart>::iterator prev ;
if(it == vd.begin())
prev = vd.end() - 1 ;
else
prev = it - 1 ;
if(!sameVertex(*it, phi1(*prev)))
return false ;
}
return true ;
}
/*! @name Cell Functors
* Apply functors to all darts of a cell
*************************************************************************/
......
......@@ -175,11 +175,11 @@ bool Map3::uncutEdge(Dart d)
void Map3::splitFace(Dart d, Dart e)
{
assert(d != e && sameOrientedFace(d, e)) ;
Map2::splitFace(d, e);
Dart dd = phi1(phi3(d));
Dart ee = phi1(phi3(e));
Map2::splitFace(d, e);
Map2::splitFace(dd, ee);
phi3sew(phi_1(d), phi_1(ee));
......@@ -276,10 +276,9 @@ void Map3::unsewVolumes(Dart d)
bool Map3::mergeVolumes(Dart d)
{
if(!isBoundaryFace(d))
if(!Map3::isBoundaryFace(d))
{
Dart e = phi3(d);
Map2::mergeVolumes(d, e); // merge the two volumes along common face
Map2::mergeVolumes(d, phi3(d)); // merge the two volumes along common face
return true ;
}
return false ;
......@@ -287,6 +286,8 @@ bool Map3::mergeVolumes(Dart d)
void Map3::splitVolume(std::vector<Dart>& vd)
{
assert(checkSimpleOrientedPath(vd)) ;
Dart e = vd.front();
Dart e2 = phi2(e);
......
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