diff --git a/Apps/Tuto/tuto1.cpp b/Apps/Tuto/tuto1.cpp index f106de0027301f888065983dc4df6df182e18846..03e7cf660a7de8d1ae6b2ea25e0eeb647ecaf0c7 100644 --- a/Apps/Tuto/tuto1.cpp +++ b/Apps/Tuto/tuto1.cpp @@ -46,6 +46,10 @@ int main(int argc, char **argv) void MyQT::createMap() { + // creation of a new attribute on vertices of type 3D vector for position. + // a handler to this attribute is returned + position = myMap.addAttribute("position"); + // creation of 2 new faces: 1 triangle and 1 square Dart d1 = myMap.newFace(3); Dart d2 = myMap.newFace(4); @@ -53,10 +57,6 @@ void MyQT::createMap() // sew these faces along one of their edge myMap.sewFaces(d1, d2); - // creation of a new attribute on vertices of type 3D vector for position. - // a handler to this attribute is returned - position = myMap.addAttribute("position"); - // affect position by moving in the map position[d1] = VEC3(0, 0, 0); position[PHI1(d1)] = VEC3(2, 0, 0); diff --git a/include/Topology/map/embeddedMap2.h b/include/Topology/map/embeddedMap2.h index d72ff1e26dddf385fe17876ee2ae63c8def479f6..71806c0e531768407e2485a47028bee5fb6ddf56 100644 --- a/include/Topology/map/embeddedMap2.h +++ b/include/Topology/map/embeddedMap2.h @@ -39,6 +39,11 @@ class EmbeddedMap2 : public Map2 public: typedef Map2 TOPO_MAP; + /* + * + */ + virtual Dart newFace(unsigned int nbEdges, bool withBoundary = true) ; + /** * The attributes attached to the old vertex are duplicated on both resulting vertices */ diff --git a/src/Topology/map/embeddedMap2.cpp b/src/Topology/map/embeddedMap2.cpp index 04fbeed43a96a011a830a3d45e00cd930463b14c..daea8040035d5a3beda0d3602fc1cb1444d8b573 100644 --- a/src/Topology/map/embeddedMap2.cpp +++ b/src/Topology/map/embeddedMap2.cpp @@ -30,6 +30,35 @@ namespace CGoGN { +Dart EmbeddedMap2::newFace(unsigned int nbEdges, bool withBoundary) +{ + Dart d = Map2::newFace(nbEdges, withBoundary); + + if(withBoundary) + { + if (isOrbitEmbedded()) + { + Traversor2FV t(*this, d); + for(Dart it = t.begin(); it != t.end(); it = t.next()) + initOrbitEmbeddingNewCell(it) ; + } + + if(isOrbitEmbedded()) + { + Traversor2FE t(*this, d); + for(Dart it = t.begin(); it != t.end(); it = t.next()) + initOrbitEmbeddingNewCell(it) ; + } + + if(isOrbitEmbedded()) + { + initOrbitEmbeddingNewCell(d) ; + initOrbitEmbeddingNewCell(phi2(d)) ; + } + } + return d ; +} + void EmbeddedMap2::splitVertex(Dart d, Dart e) { Dart dd = phi2(d) ;