コード例 #1
0
ファイル: plane_3d.hpp プロジェクト: mhdsedighi/SOFA
std::string Plane3D<T>::CGoGNnameOfType()
{
	std::stringstream ss ;
	ss << "Geom::Plane3D<" ;
	ss << nameOfType(T()) ;
	ss << ">" ;

	return ss.str() ;
}
コード例 #2
0
ファイル: vector_gen.hpp プロジェクト: Peiffert/CGoGN
std::string Vector<DIM, T>::CGoGNnameOfType()
{
	std::stringstream ss ;
	ss << "Geom::Vector<" ;
	ss << DIM ;
	ss << "," ;
	ss << nameOfType(T()) ;
	ss << ">" ;

	return ss.str() ;
}
コード例 #3
0
AttributeMultiVector<T>* AttributeContainer::addAttribute(const std::string& attribName)
{
	// first check if attribute already exist
	unsigned int index ;
	if (attribName != "")
	{
		index = getAttributeIndex(attribName) ;
		if (index != UNKNOWN)
		{
			std::cout << "attribute " << attribName << " already found.." << std::endl ;
			return NULL ;
		}
	}

	// create the new attribute
	std::string typeName = nameOfType(T()) ;
	AttributeMultiVector<T>* amv = new AttributeMultiVector<T>(attribName, typeName) ;

	if(!m_freeIndices.empty())
	{
		index = m_freeIndices.back() ;
		m_freeIndices.pop_back() ;
		m_tableAttribs[index] = amv ;
	}
	else
	{
		index = uint32(m_tableAttribs.size()) ;
		m_tableAttribs.push_back(amv) ;
	}

	amv->setOrbit(m_orbit) ;
	amv->setIndex(index) ;

	// generate a name for the attribute if no one was given
	if (attribName == "")
	{
		std::stringstream ss ;
		ss << "unknown" << m_nbUnknown++ ;
		amv->setName(ss.str()) ;
	}

	// update the memory cost of a line
	m_lineCost += sizeof(T) ;

	// resize the new attribute so that it has the same size than others
	amv->setNbBlocks(uint32(m_holesBlocks.size())) ;

	m_nbAttributes++ ;

	return amv ;
}
コード例 #4
0
void TParameterDeclaration::buildFullname() {
	m_fullname = nameOfClass(m_class);
	m_fullname += " ";
	m_fullname += nameOfType(m_type);
	if ( m_cardinality > 1 ) {
		char num[64];
		sprintf(num, "%ld", (long)m_cardinality);
		m_fullname += "[";
		m_fullname += num;
		m_fullname += "]";
	}
	m_fullname += " ";
	m_fullname += m_name;
}