本文整理汇总了C++中ScalarField::link方法的典型用法代码示例。如果您正苦于以下问题:C++ ScalarField::link方法的具体用法?C++ ScalarField::link怎么用?C++ ScalarField::link使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ScalarField
的用法示例。
在下文中一共展示了ScalarField::link方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: addScalarField
int ChunkedPointCloud::addScalarField(const char* uniqueName)
{
//we don't accept two SF with the same name!
if (getScalarFieldIndexByName(uniqueName) >= 0)
return -1;
//create requested scalar field
ScalarField* sf = new ScalarField(uniqueName);
if (!sf || (size() && !sf->resize(size())))
{
//Not enough memory!
if (sf)
sf->release();
return -1;
}
try
{
//we don't want 'm_scalarFields' to grow by 50% each time! (default behavior of std::vector::push_back)
m_scalarFields.resize(m_scalarFields.size()+1);
}
catch (std::bad_alloc) //out of memory
{
sf->release();
return -1;
}
m_scalarFields.back() = sf;
sf->link();
return (int)m_scalarFields.size()-1;
}
示例2: addScalarField
int ChunkedPointCloud::addScalarField(const char* uniqueName, bool isStrictlyPositive)
{
//we don't accept two SF with the same name!
if (getScalarFieldIndexByName(uniqueName)>=0)
return -1;
//create requested scalar field
ScalarField* sf = new ScalarField(uniqueName,isStrictlyPositive);
if (!sf)
return -1;
//we don't want 'm_scalarFields' to grow by 50% each time! (default behavior of std::vector::push_back)
try
{
m_scalarFields.push_back(sf);
}
catch (.../*const std::bad_alloc&*/) //out of memory
{
sf->release();
return -1;
}
sf->link();
return (int)m_scalarFields.size()-1;
}