Commit d16dca6c authored by Pierre Kraemer's avatar Pierre Kraemer

no_boundary branch rebased..

parent a50888b0
...@@ -32,7 +32,6 @@ ...@@ -32,7 +32,6 @@
namespace CGoGN namespace CGoGN
{ {
/** /**
* generic class that allows the marking of darts * generic class that allows the marking of darts
* \warning no default constructor * \warning no default constructor
...@@ -51,25 +50,22 @@ public: ...@@ -51,25 +50,22 @@ public:
*/ */
DartMarkerGen(GenericMap& map): m_map(map), m_thread(0) DartMarkerGen(GenericMap& map): m_map(map), m_thread(0)
{ {
// m_mark = m_map.m_marksets[DART][m_thread].getNewMark() ; m_mark = m_map.getMarkerSet(DART, m_thread).getNewMark() ;
m_mark = m_map.getMarkerSet(DART,m_thread).getNewMark() ;
} }
DartMarkerGen(GenericMap& map, unsigned int thread): m_map(map), m_thread(thread) DartMarkerGen(GenericMap& map, unsigned int thread): m_map(map), m_thread(thread)
{ {
// m_mark = m_map.m_marksets[DART][m_thread].getNewMark() ; m_mark = m_map.getMarkerSet(DART, m_thread).getNewMark() ;
m_mark = m_map.getMarkerSet(DART,m_thread).getNewMark() ;
} }
virtual ~DartMarkerGen() virtual ~DartMarkerGen()
{ {
// m_map.m_marksets[DART][m_thread].releaseMark(m_mark) ; m_map.getMarkerSet(DART, m_thread).releaseMark(m_mark) ;
m_map.getMarkerSet(DART,m_thread).releaseMark(m_mark) ;
} }
protected: protected:
// protected copy constructor to forbid its usage // protected copy constructor to forbid its usage
DartMarkerGen(const DartMarkerGen& dm) : m_map(dm.m_map), m_thread(0), m_mark(NIL) DartMarkerGen(const DartMarkerGen& dm) : m_map(dm.m_map), m_thread(0), m_mark(0)
{} {}
public: public:
...@@ -78,7 +74,7 @@ public: ...@@ -78,7 +74,7 @@ public:
*/ */
virtual void mark(Dart d) virtual void mark(Dart d)
{ {
assert(m_map.getMarkerSet(DART,m_thread).testMark(m_mark)); assert(m_map.getMarkerSet(DART, m_thread).testMark(m_mark));
m_map.getMarkVector(DART, m_thread)->operator[](d.index).setMark(m_mark); m_map.getMarkVector(DART, m_thread)->operator[](d.index).setMark(m_mark);
} }
...@@ -87,7 +83,7 @@ public: ...@@ -87,7 +83,7 @@ public:
*/ */
virtual void unmark(Dart d) virtual void unmark(Dart d)
{ {
assert(m_map.getMarkerSet(DART,m_thread).testMark(m_mark)); assert(m_map.getMarkerSet(DART, m_thread).testMark(m_mark));
m_map.getMarkVector(DART, m_thread)->operator[](d.index).unsetMark(m_mark); m_map.getMarkVector(DART, m_thread)->operator[](d.index).unsetMark(m_mark);
} }
...@@ -96,7 +92,7 @@ public: ...@@ -96,7 +92,7 @@ public:
*/ */
virtual bool isMarked(Dart d) virtual bool isMarked(Dart d)
{ {
assert(m_map.getMarkerSet(DART,m_thread).testMark(m_mark)); assert(m_map.getMarkerSet(DART, m_thread).testMark(m_mark));
return m_map.getMarkVector(DART, m_thread)->operator[](d.index).testMark(m_mark); return m_map.getMarkVector(DART, m_thread)->operator[](d.index).testMark(m_mark);
} }
......
...@@ -65,7 +65,7 @@ public: ...@@ -65,7 +65,7 @@ public:
/** /**
* The attributes attached to the edge of d are kept on the resulting edge * The attributes attached to the edge of d are kept on the resulting edge
*/ */
virtual void uncutEdge(Dart d) ; virtual bool uncutEdge(Dart d) ;
/** /**
* Check if the edge of d can be collapsed or not based on some topological conditions * Check if the edge of d can be collapsed or not based on some topological conditions
......
...@@ -279,25 +279,6 @@ public: ...@@ -279,25 +279,6 @@ public:
* @return true if the merge has been executed, false otherwise * @return true if the merge has been executed, false otherwise
*/ */
virtual bool mergeVolumes(Dart d, Dart e); virtual bool mergeVolumes(Dart d, Dart e);
//! Close a topological hole (a sequence of connected fixed point of phi2).
/*! \pre dart d MUST be fixed point of phi2 relation
* Add a face to the map that closes the hole.
* The darts of this face are marked with holeMarker.
* @param d a dart of the hole (with phi2(d)==d)
* @return the degree of the created face
*/
virtual unsigned int closeHole(Dart d);
//TODO a mettre en algo
//! Close the map removing topological holes.
/*! Add faces to the map that close every existing hole.
* These faces are marked.
* \warning The embeddings of vertices are not updated
* @param marker
*/
void closeMap(DartMarker& marker);
//@} //@}
/*! @name Topological Queries /*! @name Topological Queries
...@@ -420,11 +401,10 @@ public: ...@@ -420,11 +401,10 @@ public:
* Apply a functor on the all darts in the set of the link from orbit * Apply a functor on the all darts in the set of the link from orbit
*/ */
bool foreach_dart_of_link(Dart d, unsigned int orbit, FunctorType& f, unsigned int thread=0); bool foreach_dart_of_link(Dart d, unsigned int orbit, FunctorType& f, unsigned int thread=0);
//@} //@}
//@{ //@{
//! Close a topological hole (a sequence of connected fixed point of phi2). DO NO USE, only for import algorithm //! Close a topological hole (a sequence of connected fixed point of phi2). DO NOT USE, only for import algorithm
/*! \pre dart d MUST be fixed point of phi2 relation /*! \pre dart d MUST be fixed point of phi2 relation
* Add a face to the map that closes the hole. * Add a face to the map that closes the hole.
* The darts of this face are marked with holeMarker. * The darts of this face are marked with holeMarker.
...@@ -433,17 +413,15 @@ public: ...@@ -433,17 +413,15 @@ public:
*/ */
virtual unsigned int closeHole(Dart d); virtual unsigned int closeHole(Dart d);
//! Close the map removing topological holes: DO NOT USE, only for import algorithm
//! Close the map removing topological holes: DO NO USE, only for import algorithm
/*! Add faces to the map that close every existing hole. /*! Add faces to the map that close every existing hole.
* These faces are marked. * These faces are marked.
* \warning The embeddings of vertices are not updated * \warning The embeddings of vertices are not updated
*/ */
void closeMap(); void closeMap();
// void closeMap(DartMarker& marker);
/** /**
* sew oriented face, DO NO USE, only for import algorithm * sew oriented face, DO NOT USE, only for import algorithm
*/ */
void sewOrientedFaces(Dart d, Dart e); void sewOrientedFaces(Dart d, Dart e);
//@} //@}
......
...@@ -105,17 +105,15 @@ void EmbeddedMap2::cutEdge(Dart d) ...@@ -105,17 +105,15 @@ void EmbeddedMap2::cutEdge(Dart d)
} }
} }
void EmbeddedMap2::uncutEdge(Dart d) bool EmbeddedMap2::uncutEdge(Dart d)
{ {
bool doSomethg = (d != phi2(d)) ; if(Map2::uncutEdge(d))
Map2::uncutEdge(d) ;
if(doSomethg)
{ {
if(isOrbitEmbedded(EDGE)) if(isOrbitEmbedded(EDGE))
copyDartEmbedding(EDGE, phi2(d), d) ; copyDartEmbedding(EDGE, phi2(d), d) ;
return true ;
} }
return false ;
} }
bool EmbeddedMap2::edgeCanCollapse(Dart d) bool EmbeddedMap2::edgeCanCollapse(Dart d)
......
...@@ -77,7 +77,7 @@ void Map2::mergeFacewithBoundary(Dart d) ...@@ -77,7 +77,7 @@ void Map2::mergeFacewithBoundary(Dart d)
} }
Dart g = phi2(f); Dart g = phi2(f);
if (isBoundaryMarked(g)) // check if connextion by a face if (isBoundaryMarked(g)) // check if connexion by a face
{ {
storeForLinkFace.push_back(f); storeForLinkFace.push_back(f);
storeForLinkFace.push_back(g); storeForLinkFace.push_back(g);
...@@ -88,15 +88,19 @@ void Map2::mergeFacewithBoundary(Dart d) ...@@ -88,15 +88,19 @@ void Map2::mergeFacewithBoundary(Dart d)
// merge by vertices // merge by vertices
while (!storeForLinkVertex.empty()) while (!storeForLinkVertex.empty())
{ {
Dart a = storeForLinkVertex.pop_back(); Dart a = storeForLinkVertex.back() ;
Dart b = storeForLinkVertex.pop_back(); storeForLinkVertex.pop_back() ;
Dart b = storeForLinkVertex.back() ;
storeForLinkVertex.pop_back() ;
phi1sew(a,b); phi1sew(a,b);
} }
//merge by faces //merge by faces
while (!storeForLinkFace.empty()) while (!storeForLinkFace.empty())
{ {
Dart a = storeForLinkFace.pop_back(); Dart a = storeForLinkVertex.back() ;
Dart b = storeForLinkFace.pop_back(); storeForLinkVertex.pop_back() ;
Dart b = storeForLinkVertex.back() ;
storeForLinkVertex.pop_back() ;
mergeBoundaryFaces(a,b); mergeBoundaryFaces(a,b);
} }
} }
......
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