예제 #1
0
void GenericMap::dumpCSV() const
{
	for (unsigned int orbit = 0; orbit < NB_ORBITS; ++orbit)
	{
		CGoGNout << "Container of "<<orbitName(orbit)<< CGoGNendl;
		m_attribs[orbit].dumpCSV();
	}
	CGoGNout << CGoGNendl;
}
예제 #2
0
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)
			m_attribs[i].clear(false) ;
	}
}
예제 #3
0
void AttributeContainer::dumpByLines() const
{
	CGoGNout << "Container of "<<orbitName(this->getOrbit())<< CGoGNendl;
	for (unsigned int i = 0; i < m_tableAttribs.size(); ++i)
	{
		if (m_tableAttribs[i] != NULL)
		{
			CGoGNout << "Name: "<< m_tableAttribs[i]->getName();
			CGoGNout << " / Type: "<< m_tableAttribs[i]->getTypeName();
			for (unsigned int l=this->begin(); l!= this->end(); this->next(l))
			{
				CGoGNout << l << " ; ";
				m_tableAttribs[i]->dump(l);
				CGoGNout << CGoGNendl;
			}

		}

	}
}
예제 #4
0
AttributeMultiVector<MarkerBool>* GenericMap::askMarkVector()
{
	assert(isOrbitEmbedded<ORBIT>() || !"Invalid parameter: orbit not embedded") ;

	// get current thread index for table of markers
	unsigned int thread = getCurrentThreadIndex();

	if (!m_markVectors_free[ORBIT][thread].empty())
	{
		AttributeMultiVector<MarkerBool>* amv = m_markVectors_free[ORBIT][thread].back();
		m_markVectors_free[ORBIT][thread].pop_back();
		return amv;
	}
	else
	{
		std::lock_guard<std::mutex> lockMV(m_MarkerStorageMutex[ORBIT]);

		unsigned int x = m_nextMarkerId++;
		std::string number("___");
		number[2] = '0'+x%10;
		x = x/10;
		number[1] = '0'+x%10;
		x = x/10;
		number[0] = '0'+x%10;

		AttributeMultiVector<MarkerBool>* amv = m_attribs[ORBIT].addMarkerAttribute("marker_" + orbitName(ORBIT) + number);
		return amv;
	}
}