diff --git a/include/Algo/Render/GL1/topo_render.hpp b/include/Algo/Render/GL1/topo_render.hpp index ab7dda3c623784f6a95d4817c17b239fb327ced0..6c72d79db0060de9726a1e33ee73c7cab488795a 100644 --- a/include/Algo/Render/GL1/topo_render.hpp +++ b/include/Algo/Render/GL1/topo_render.hpp @@ -436,16 +436,16 @@ void renderTopoGMD3(typename PFP::MAP& map, const typename PFP::TVEC3& positions vecVolCenters.reserve(vecDartFaces.size()/4); // = nb of volumes for a tetra mesh DartMarker mark(map); // marker for darts -// CellMarker mVol(map, VOLUME); - DartMarker mVol(map); + CellMarker mVol(map, VOLUME); +// DartMarker mVol(map); //compute barycenter and get a dart by face for (Dart d = map.begin(); d != map.end(); map.next(d)) { if(!mVol.isMarked(d)) { -// mVol.mark(d); - mVol.markOrbit(VOLUME,d); + mVol.mark(d); +// mVol.markOrbit(VOLUME,d); CellMarkerStore markVert(map, VERTEX); //marker for vertices VEC3 center(0); diff --git a/include/Topology/gmap/embeddedGMap3.h b/include/Topology/gmap/embeddedGMap3.h index bc20aa8d364f49717f7b1272d262d9d5261c38fa..71714b0e54e8a0c680507758b134a711e9490209 100644 --- a/include/Topology/gmap/embeddedGMap3.h +++ b/include/Topology/gmap/embeddedGMap3.h @@ -39,21 +39,31 @@ class EmbeddedGMap3 : public GMap3 public: typedef GMap3 TOPO_MAP; - //! - /*! - * + /** + * 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 + * The attributes attached to the volume of d are kept on the resulting volume + */ + 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 + * The attributes attached to the old volume are duplicated on both volume if a new one is created */ virtual void unsewFaces(Dart d); - //! - /*! - * + /** + * The attributes attached to the vertices of the vertices of the face of d are kept on the vertices of the resulting face + * The attributes attached to the edges of the face of d are kept on the resulting face + * The attributes attached to the face of d are kept on the resulting face */ virtual void sewVolumes(Dart d, Dart e); - //! - /*! - * + /** + * The attributes attached to the vertices of the old face of d are duplicated on the vertices of both resulting faces + * The attributes attached to the old edges of the old face of d are duplicated on the edges of both resulting faces + * The attributes attached to the old face d are duplicated on both resulting faces */ virtual void unsewVolumes(Dart d); diff --git a/src/Topology/gmap/embeddedGMap3.cpp b/src/Topology/gmap/embeddedGMap3.cpp index 81e7df54b20d1980f14ffd03d25655379cfb98ec..b0f4c8f0d4a46d0af56ef686ccb05ea29c4a441f 100644 --- a/src/Topology/gmap/embeddedGMap3.cpp +++ b/src/Topology/gmap/embeddedGMap3.cpp @@ -30,6 +30,33 @@ namespace CGoGN { +void EmbeddedGMap3::sewFaces(Dart d, Dart e) +{ + GMap3::sewFaces(d,e); + + unsigned int vEmb; + if (isOrbitEmbedded(VERTEX)) + { + vEmb = getEmbedding(VERTEX, d); + embedOrbit(VERTEX, d, vEmb) ; + + vEmb = getEmbedding(VERTEX, beta0(d)); + embedOrbit(VERTEX, beta0(d), vEmb) ; + } + + if (isOrbitEmbedded(EDGE)) + { + vEmb = getEmbedding(EDGE, d); + embedOrbit(EDGE, e, vEmb) ; + } + + if (isOrbitEmbedded(VOLUME)) + { + vEmb = getEmbedding(VOLUME, d); + embedOrbit(VOLUME, e, vEmb) ; + } +} + void EmbeddedGMap3::unsewFaces(Dart d) { Dart e = beta2(d); @@ -58,6 +85,15 @@ void EmbeddedGMap3::unsewFaces(Dart d) embedNewCell(EDGE, e); copyCell(EDGE, e, d); } + + if (isOrbitEmbedded(VOLUME)) + { + if(!sameVolume(d,e)) + { + embedNewCell(VOLUME, e); + copyCell(VOLUME, e, d); + } + } } void EmbeddedGMap3::sewVolumes(Dart d, Dart e)