本文整理汇总了C++中cclib::ScalarField::addElement方法的典型用法代码示例。如果您正苦于以下问题:C++ ScalarField::addElement方法的具体用法?C++ ScalarField::addElement怎么用?C++ ScalarField::addElement使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cclib::ScalarField
的用法示例。
在下文中一共展示了ScalarField::addElement方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: refCloud
//.........这里部分代码省略.........
{
CCLib::ScalarField* sf = exportedSFs[i];
ScalarType sVal = NAN_VALUE;
switch (exportedFields[i])
{
case PER_CELL_HEIGHT:
sVal = static_cast<ScalarType>(aCell->h);
break;
case PER_CELL_COUNT:
sVal = static_cast<ScalarType>(aCell->nbPoints);
break;
case PER_CELL_MIN_HEIGHT:
sVal = static_cast<ScalarType>(aCell->minHeight);
break;
case PER_CELL_MAX_HEIGHT:
sVal = static_cast<ScalarType>(aCell->maxHeight);
break;
case PER_CELL_AVG_HEIGHT:
sVal = static_cast<ScalarType>(aCell->avgHeight);
break;
case PER_CELL_HEIGHT_STD_DEV:
sVal = static_cast<ScalarType>(aCell->stdDevHeight);
break;
case PER_CELL_HEIGHT_RANGE:
sVal = static_cast<ScalarType>(aCell->maxHeight - aCell->minHeight);
break;
default:
assert(false);
break;
}
if (resampleInputCloud)
sf->setValue(nonEmptyCellIndex,sVal);
else
sf->addElement(sVal);
}
++nonEmptyCellIndex;
}
else if (fillEmptyCells) //empty cell
{
//even if we have resampled the original cloud, we must add the point
//corresponding to this empty cell
{
CCVector3 Pf( static_cast<PointCoordinateType>(Px),
static_cast<PointCoordinateType>(Py),
static_cast<PointCoordinateType>(emptyCellsHeight) );
cloudGrid->addPoint(Pf);
}
assert(exportedSFs.size() == exportedFields.size());
for (size_t i=0; i<exportedSFs.size(); ++i)
{
if (!exportedSFs[i])
{
continue;
}
if (exportedFields[i] == PER_CELL_HEIGHT)
{
//we set the point height to the default height
ScalarType s = static_cast<ScalarType>(emptyCellsHeight);
exportedSFs[i]->addElement(s);
}
else
{
exportedSFs[i]->addElement(NAN_VALUE);
}