Commit 09aaaf4e authored by Sylvain Thery's avatar Sylvain Thery

resolve bug of leaving markers after removing darts

parent 51206dcd
......@@ -378,6 +378,11 @@ public:
*/
void initLine(unsigned int index);
/**
* initialize all markers of a line of the container
*/
void initMarkersOfLine(unsigned int index);
/**
* copy the content of line src in line dst
*/
......
......@@ -338,6 +338,16 @@ inline void AttributeContainer::initLine(unsigned int index)
}
}
inline void AttributeContainer::initMarkersOfLine(unsigned int index)
{
for(unsigned int i = 0; i < m_tableAttribs.size(); ++i)
{
if ((m_tableAttribs[i] != NULL) && (m_tableAttribs[i]->isMarkerBool()))
m_tableAttribs[i]->initElt(index);
}
}
inline void AttributeContainer::copyLine(unsigned int dstIndex, unsigned int srcIndex)
{
for(unsigned int i = 0; i < m_tableAttribs.size(); ++i)
......
......@@ -195,6 +195,8 @@ public:
* @param fs filestream
*/
virtual void dump(unsigned int i) const = 0;
virtual bool isMarkerBool() = 0;
};
......@@ -322,6 +324,8 @@ public:
*/
virtual void dump(unsigned int i) const;
inline bool isMarkerBool();
};
} // namespace CGoGN
......
......@@ -418,6 +418,11 @@ void AttributeMultiVector<T>::dump(unsigned int i) const
CGoGNout << this->operator[](i);
}
template <typename T>
inline bool AttributeMultiVector<T>::isMarkerBool()
{
return false;
}
template <typename T>
inline void AttributeMultiVector<T>::setTypeCode()
......
......@@ -400,6 +400,12 @@ public:
{
CGoGNout << this->operator[](i);
}
inline bool isMarkerBool()
{
return true;
}
};
......
......@@ -142,6 +142,7 @@ inline void GenericMap::releaseUIntBuffer(std::vector<unsigned int>* vui) const
inline Dart GenericMap::newDart()
{
unsigned int di = m_attribs[DART].insertLine(); // insert a new dart line
m_attribs[DART].initMarkersOfLine(di);
for(unsigned int i = 0; i < NB_ORBITS; ++i)
{
if (m_embeddings[i]) // set all its embeddings
......@@ -206,7 +207,11 @@ template <unsigned int ORBIT>
inline unsigned int GenericMap::newCell()
{
assert(isOrbitEmbedded<ORBIT>() || !"Invalid parameter: orbit not embedded");
return m_attribs[ORBIT].insertLine();
unsigned int c = m_attribs[ORBIT].insertLine();
m_attribs[ORBIT].initMarkersOfLine(c);
return c;
// return m_attribs[ORBIT].insertLine();
}
template <unsigned int ORBIT>
......
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