本文整理汇总了C++中cclib::ReferenceCloud::add方法的典型用法代码示例。如果您正苦于以下问题:C++ ReferenceCloud::add方法的具体用法?C++ ReferenceCloud::add怎么用?C++ ReferenceCloud::add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cclib::ReferenceCloud
的用法示例。
在下文中一共展示了ReferenceCloud::add方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FuseCells
//.........这里部分代码省略.........
//if the leaf orientation is too different
if (fabs(CCVector3(it->leaf->planeEq).dot(currentNormal)) < c_minCosNormAngle)
{
it = candidates.erase(it);
//++it;
//++skipCount;
continue;
}
//compute the minimum distance between the candidate centroid and the 'currentPointSet'
PointCoordinateType minDistToMainSet = 0.0;
{
for (unsigned j=0; j<currentPointSet->size(); ++j)
{
const CCVector3* P = currentPointSet->getPoint(j);
PointCoordinateType d2 = (*P-it->centroid).norm2();
if (d2 < minDistToMainSet || j == 0)
minDistToMainSet = d2;
}
minDistToMainSet = sqrt(minDistToMainSet);
}
//if the leaf is too far
if (it->radius < minDistToMainSet / overlapCoef)
{
++it;
++skipCount;
continue;
}
//fuse the main set with the current candidate
CCLib::ReferenceCloud* fused = new CCLib::ReferenceCloud(*currentPointSet);
if (!fused->add(*(it->leaf->points)))
{
//not enough memory!
ccLog::Warning("[ccKdTreeForFacetExtraction] Not enough memory!");
delete fused;
if (currentPointSet != currentCell->points)
delete currentPointSet;
return false;
}
//fit a plane and estimate the resulting error
double error = -1.0;
const PointCoordinateType* planeEquation = CCLib::Neighbourhood(fused).getLSPlane();
if (planeEquation)
error = CCLib::DistanceComputationTools::ComputeCloud2PlaneDistance(fused, planeEquation, errorMeasure);
if (error < 0.0 || error > maxError)
{
//candidate is rejected
it = candidates.erase(it);
}
else
{
//otherwise we keep track of the best one!
if (bestError < 0.0 || error < bestError)
{
bestIt = it;
bestError = error;
if (bestFused)
delete bestFused;
bestFused = fused;
bestNormal = CCVector3(planeEquation);
fused = 0;