Commit 996669d5 authored by Sylvain Thery's avatar Sylvain Thery

add warning when clean remove markers

parent 9f90b980
......@@ -223,6 +223,11 @@ public:
*/
inline bool used(unsigned int index) const;
/**
* @brief check if container contain marker attribute
*/
bool hasMarkerAttribute() const;
/**************************************
* CONTAINER TRAVERSAL *
**************************************/
......
......@@ -103,6 +103,10 @@ public:
m_map.template releaseMarkVector<CELL>(m_markVector,m_thread);
}
/**
* @brief update: realloc the marker in map
* @warning call only after map cleaning
*/
void update()
{
if(!m_map.template isOrbitEmbedded<CELL>())
......
......@@ -96,6 +96,10 @@ public:
}
/**
* @brief update: realloc the marker in map
* @warning call only after map cleaning
*/
inline void update()
{
m_markVector = m_map.template askMarkVector<DART>(m_thread);
......
......@@ -211,6 +211,21 @@ void AttributeContainer::clear(bool removeAttrib)
}
}
bool AttributeContainer::hasMarkerAttribute() const
{
for (auto it = m_tableAttribs.begin(); it != m_tableAttribs.end(); ++it)
{
if ((*it) != NULL)
{
std::string strMarker = (*it)->getName().substr(0,6);
if (strMarker=="marker")
return true;
}
}
return false;
}
void AttributeContainer::compact(std::vector<unsigned int>& mapOldNew)
{
mapOldNew.clear();
......
......@@ -231,7 +231,14 @@ void GenericMap::init(bool addBoundaryMarkers)
void GenericMap::clear(bool removeAttrib)
{
if (removeAttrib)
{
#ifndef NDEBUG
for(unsigned int i = 0; i < NB_ORBITS; ++i)
if (m_attribs[i].hasMarkerAttribute())
CGoGNout << "Warning removing marker attribute on orbit, need update ? "<<orbitName(i)<< CGoGNendl;
#endif
init();
}
else
{
for(unsigned int i = 0; i < NB_ORBITS; ++i)
......
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