本文整理汇总了C++中cclib::ScalarField::reserve方法的典型用法代码示例。如果您正苦于以下问题:C++ ScalarField::reserve方法的具体用法?C++ ScalarField::reserve怎么用?C++ ScalarField::reserve使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cclib::ScalarField
的用法示例。
在下文中一共展示了ScalarField::reserve方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: loadFile
//.........这里部分代码省略.........
{
ccLog::Warning("[PLY] Bad/uncompatible assignation of point properties!");
delete cloud;
ply_close(ply);
return CC_FERR_BAD_ENTITY_TYPE;
}
}
else numberOfPoints = pointElements[pp.elemIndex].elementInstances;
}
//POINTS (Z)
if (zIndex > 0)
{
long flags = ELEM_POS_2; //Z coordinate
if (zIndex > xIndex && zIndex > yIndex)
flags |= ELEM_EOL;
plyProperty& pp = stdProperties[zIndex-1];
ply_set_read_cb(ply, pointElements[pp.elemIndex].elementName, pp.propName, vertex_cb, cloud, flags);
if (numberOfPoints > 0)
{
if ((long)numberOfPoints != pointElements[pp.elemIndex].elementInstances)
{
ccLog::Warning("[PLY] Bad/uncompatible assignation of point properties!");
delete cloud;
ply_close(ply);
return CC_FERR_BAD_ENTITY_TYPE;
}
}
else numberOfPoints = pointElements[pp.elemIndex].elementInstances;
}
if (numberOfPoints == 0 || !cloud->reserveThePointsTable(numberOfPoints))
{
delete cloud;
ply_close(ply);
return CC_FERR_NOT_ENOUGH_MEMORY;
}
/* NORMALS (X,Y,Z) */
unsigned numberOfNormals=0;
assert(nxIndex == 0 || (nxIndex != nyIndex && nxIndex != nzIndex));
assert(nyIndex == 0 || (nyIndex != nxIndex && nyIndex != nzIndex));
assert(nzIndex == 0 || (nzIndex != nxIndex && nzIndex != nyIndex));
//NORMALS (X)
if (nxIndex > 0)
{
long flags = ELEM_POS_0; //Nx
if (nxIndex > nyIndex && nxIndex > nzIndex)
flags |= ELEM_EOL;
plyProperty& pp = stdProperties[nxIndex-1];
ply_set_read_cb(ply, pointElements[pp.elemIndex].elementName, pp.propName, normal_cb, cloud, flags);
numberOfNormals = pointElements[pp.elemIndex].elementInstances;
}
//NORMALS (Y)
if (nyIndex > 0)
{
long flags = ELEM_POS_1; //Ny
if (nyIndex > nxIndex && nyIndex > nzIndex)