Commit 2cb5349c authored by Thery Sylvain's avatar Thery Sylvain

bug missing newFace in GMap2

parent 917a9c5a
...@@ -39,6 +39,11 @@ class EmbeddedGMap2 : public GMap2 ...@@ -39,6 +39,11 @@ class EmbeddedGMap2 : public GMap2
public: public:
typedef GMap2 TOPO_MAP; typedef GMap2 TOPO_MAP;
/**
* create a new face with managed embeddings
*/
virtual Dart newFace(unsigned int nbEdges, bool withBoundary = true) ;
/** /**
* The attributes attached to the old vertex are duplicated on both resulting vertices * The attributes attached to the old vertex are duplicated on both resulting vertices
* No attribute is attached to the new edge * No attribute is attached to the new edge
......
...@@ -50,7 +50,8 @@ inline unsigned int GMap0::dimension() const ...@@ -50,7 +50,8 @@ inline unsigned int GMap0::dimension() const
inline void GMap0::clear(bool removeAttrib) inline void GMap0::clear(bool removeAttrib)
{ {
AttribMap::clear(removeAttrib) ; AttribMap::clear(removeAttrib) ;
init() ; if (removeAttrib)
init() ;
} }
inline void GMap0::update_topo_shortcuts() inline void GMap0::update_topo_shortcuts()
......
...@@ -30,6 +30,49 @@ ...@@ -30,6 +30,49 @@
namespace CGoGN namespace CGoGN
{ {
Dart EmbeddedGMap2::newFace(unsigned int nbEdges, bool withBoundary)
{
Dart d = GMap2::newFace(nbEdges, withBoundary);
if(withBoundary)
{
if (isOrbitEmbedded<VERTEX>())
{
Traversor2FV<EmbeddedGMap2> t(*this, d);
for(Dart it = t.begin(); it != t.end(); it = t.next())
initOrbitEmbeddingNewCell<VERTEX>(it) ;
}
if(isOrbitEmbedded<EDGE>())
{
Traversor2FE<EmbeddedGMap2> t(*this, d);
for(Dart it = t.begin(); it != t.end(); it = t.next())
initOrbitEmbeddingNewCell<EDGE>(it) ;
}
if(isOrbitEmbedded<FACE>())
{
initOrbitEmbeddingNewCell<FACE>(d) ;
initOrbitEmbeddingNewCell<FACE>(phi2(d)) ;
}
}
else
{
if (isOrbitEmbedded<VERTEX>())
{
Traversor2FV<EmbeddedGMap2> t(*this, d);
for(Dart it = t.begin(); it != t.end(); it = t.next())
initOrbitEmbeddingNewCell<VERTEX>(it) ;
}
if(isOrbitEmbedded<FACE>())
initOrbitEmbeddingNewCell<FACE>(d) ;
}
return d ;
}
void EmbeddedGMap2::splitVertex(Dart d, Dart e) void EmbeddedGMap2::splitVertex(Dart d, Dart e)
{ {
Dart dd = phi2(d) ; Dart dd = phi2(d) ;
...@@ -306,6 +349,10 @@ void EmbeddedGMap2::sewFaces(Dart d, Dart e, bool withBoundary) ...@@ -306,6 +349,10 @@ void EmbeddedGMap2::sewFaces(Dart d, Dart e, bool withBoundary)
if (!withBoundary) if (!withBoundary)
{ {
GMap2::sewFaces(d, e, false) ; GMap2::sewFaces(d, e, false) ;
if(isOrbitEmbedded<EDGE>())
{
initOrbitEmbeddingNewCell<EDGE>(d) ;
}
return ; return ;
} }
......
...@@ -319,9 +319,7 @@ void EmbeddedMap2::sewFaces(Dart d, Dart e, bool withBoundary) ...@@ -319,9 +319,7 @@ void EmbeddedMap2::sewFaces(Dart d, Dart e, bool withBoundary)
if(isOrbitEmbedded<EDGE>()) if(isOrbitEmbedded<EDGE>())
{ {
/* /*
Traversor2FE<EmbeddedMap2> t(*this, d); initOrbitEmbeddingNewCell<EDGE>(d) ;
for(Dart it = t.begin(); it != t.end(); it = t.next())
initOrbitEmbeddingNewCell<EDGE>(it) ;
*/ */
unsigned int emb = newCell<EDGE>(); unsigned int emb = newCell<EDGE>();
initDartEmbedding<EDGE>(d,emb); initDartEmbedding<EDGE>(d,emb);
......
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