From 464b5025620967bd3cab9ebc3c4bd9cc92eb49c0 Mon Sep 17 00:00:00 2001 From: Thomas Date: Wed, 9 Nov 2011 10:55:39 +0100 Subject: [PATCH] embeddedgmap3 : gestion volumes dans les sewfaces unsewfaces --- include/Algo/Render/GL1/topo_render.hpp | 8 +++--- include/Topology/gmap/embeddedGMap3.h | 28 ++++++++++++------- src/Topology/gmap/embeddedGMap3.cpp | 36 +++++++++++++++++++++++++ 3 files changed, 59 insertions(+), 13 deletions(-) diff --git a/include/Algo/Render/GL1/topo_render.hpp b/include/Algo/Render/GL1/topo_render.hpp index ab7dda3c..6c72d79d 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 bc20aa8d..71714b0e 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 81e7df54..b0f4c8f0 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) -- GitLab