Exemple #1
0
void GenericMap::garbageMarkVectors()
{
	unsigned int maxId=0;

	for (unsigned int orbit=0; orbit<NB_ORBITS;++orbit)
	{
		std::vector<AttributeMultiVector<MarkerBool>*>& amvv = m_attribs[orbit].getMarkerAttributes();

		for (auto it = amvv.begin(); it != amvv.end(); ++it )
		{
			AttributeMultiVector<MarkerBool>* amv = *it;
			const std::string& name = amv->getName();
			if (name.substr(0,7) == "marker_")
			{
				// store tne next free index for unique numbering
				std::string num = name.substr(name.length()-3,3);
				unsigned int id = 100*(num[0]-'0')+10*(num[1]-'0')+(num[2]-'0');
				if (id > maxId)
					maxId = id;

				amv->allFalse();
				m_markVectors_free[orbit][0].push_back(amv);
			}
		}
	}
	m_nextMarkerId = maxId+1;
}