Commit 464b5025 authored by Thomas's avatar Thomas

embeddedgmap3 : gestion volumes dans les sewfaces unsewfaces

parent 68944bbf
...@@ -436,16 +436,16 @@ void renderTopoGMD3(typename PFP::MAP& map, const typename PFP::TVEC3& positions ...@@ -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 vecVolCenters.reserve(vecDartFaces.size()/4); // = nb of volumes for a tetra mesh
DartMarker mark(map); // marker for darts DartMarker mark(map); // marker for darts
// CellMarker mVol(map, VOLUME); CellMarker mVol(map, VOLUME);
DartMarker mVol(map); // DartMarker mVol(map);
//compute barycenter and get a dart by face //compute barycenter and get a dart by face
for (Dart d = map.begin(); d != map.end(); map.next(d)) for (Dart d = map.begin(); d != map.end(); map.next(d))
{ {
if(!mVol.isMarked(d)) if(!mVol.isMarked(d))
{ {
// mVol.mark(d); mVol.mark(d);
mVol.markOrbit(VOLUME,d); // mVol.markOrbit(VOLUME,d);
CellMarkerStore markVert(map, VERTEX); //marker for vertices CellMarkerStore markVert(map, VERTEX); //marker for vertices
VEC3 center(0); VEC3 center(0);
......
...@@ -39,21 +39,31 @@ class EmbeddedGMap3 : public GMap3 ...@@ -39,21 +39,31 @@ class EmbeddedGMap3 : public GMap3
public: public:
typedef GMap3 TOPO_MAP; 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); 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); 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); virtual void unsewVolumes(Dart d);
......
...@@ -30,6 +30,33 @@ ...@@ -30,6 +30,33 @@
namespace CGoGN 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) void EmbeddedGMap3::unsewFaces(Dart d)
{ {
Dart e = beta2(d); Dart e = beta2(d);
...@@ -58,6 +85,15 @@ void EmbeddedGMap3::unsewFaces(Dart d) ...@@ -58,6 +85,15 @@ void EmbeddedGMap3::unsewFaces(Dart d)
embedNewCell(EDGE, e); embedNewCell(EDGE, e);
copyCell(EDGE, e, d); 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) void EmbeddedGMap3::sewVolumes(Dart d, Dart 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