Commit f73c649f authored by Pierre Kraemer's avatar Pierre Kraemer
Browse files

correction clear markers dart et cell apres suppression

parent 658baf8f
...@@ -290,7 +290,7 @@ public: ...@@ -290,7 +290,7 @@ public:
* Decremente le compteur de reference de la ligne * Decremente le compteur de reference de la ligne
* @param eltIdx iterator sur cette ligne * @param eltIdx iterator sur cette ligne
*/ */
void unrefLine(unsigned int eltIdx); bool unrefLine(unsigned int eltIdx);
void setRefLine(unsigned int eltIdx, unsigned int nb); void setRefLine(unsigned int eltIdx, unsigned int nb);
......
...@@ -222,9 +222,14 @@ inline void AttribContainer::refLine(unsigned int eltIdx) ...@@ -222,9 +222,14 @@ inline void AttribContainer::refLine(unsigned int eltIdx)
m_holesBlocks[eltIdx / _BLOCKSIZE_]->ref(eltIdx % _BLOCKSIZE_); m_holesBlocks[eltIdx / _BLOCKSIZE_]->ref(eltIdx % _BLOCKSIZE_);
} }
inline void AttribContainer::unrefLine(unsigned int eltIdx) inline bool AttribContainer::unrefLine(unsigned int eltIdx)
{ {
if (m_holesBlocks[eltIdx / _BLOCKSIZE_]->unref(eltIdx % _BLOCKSIZE_)) m_size--; if (m_holesBlocks[eltIdx / _BLOCKSIZE_]->unref(eltIdx % _BLOCKSIZE_))
{
m_size--;
return true;
}
return false;
} }
inline void AttribContainer::setRefLine(unsigned int eltIdx, unsigned int nb) inline void AttribContainer::setRefLine(unsigned int eltIdx, unsigned int nb)
......
...@@ -54,6 +54,7 @@ inline void GenericMap::deleteDart(Dart d) ...@@ -54,6 +54,7 @@ inline void GenericMap::deleteDart(Dart d)
if(emb != EMBNULL) if(emb != EMBNULL)
m_attribs[orbit].unrefLine(emb) ; m_attribs[orbit].unrefLine(emb) ;
} }
m_markerTables[DART_ORBIT]->operator[](d.index).clear() ;
} }
} }
......
...@@ -56,7 +56,7 @@ public: ...@@ -56,7 +56,7 @@ public:
//! Constructor //! Constructor
Mark() : m_bits(0) {}; Mark() : m_bits(0) {};
Mark(unsigned a) : m_bits(a) {}; Mark(unsigned int a) : m_bits(a) {};
//! Copy constructor //! Copy constructor
Mark(const Mark& m) : m_bits(m.m_bits) {}; Mark(const Mark& m) : m_bits(m.m_bits) {};
...@@ -71,11 +71,16 @@ public: ...@@ -71,11 +71,16 @@ public:
return n; return n;
} }
inline void clear()
{
m_bits = 0;
}
//! Test if all marks are set to NO (0) //! Test if all marks are set to NO (0)
inline bool isClear() inline bool isClear()
{ {
return (m_bits == 0); return (m_bits == 0);
}; }
//! Set given marks to YES //! Set given marks to YES
/*! @param m the marks to set /*! @param m the marks to set
......
...@@ -100,7 +100,10 @@ void GenericMap::setDartEmbedding(unsigned int orbit, Dart d, unsigned int emb) ...@@ -100,7 +100,10 @@ void GenericMap::setDartEmbedding(unsigned int orbit, Dart d, unsigned int emb)
return; return;
// if different then unref the old emb // if different then unref the old emb
if (old != EMBNULL) if (old != EMBNULL)
m_attribs[orbit].unrefLine(old); {
if(m_attribs[orbit].unrefLine(old))
m_markerTables[orbit]->operator[](old).clear();
}
// ref the new emb // ref the new emb
if (emb != EMBNULL) if (emb != EMBNULL)
m_attribs[orbit].refLine(emb); m_attribs[orbit].refLine(emb);
......
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