本文整理汇总了C++中cclib::ReferenceCloud::getAssociatedCloud方法的典型用法代码示例。如果您正苦于以下问题:C++ ReferenceCloud::getAssociatedCloud方法的具体用法?C++ ReferenceCloud::getAssociatedCloud怎么用?C++ ReferenceCloud::getAssociatedCloud使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cclib::ReferenceCloud
的用法示例。
在下文中一共展示了ReferenceCloud::getAssociatedCloud方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FuseCells
//.........这里部分代码省略.........
catch (const std::bad_alloc&)
{
//not enough memory!
ccLog::Warning("[ccKdTreeForFacetExtraction] Not enough memory!");
return false;
}
}
}
}
//is there remaining candidates?
if (!candidates.empty())
{
//update the set of candidates
if (closestFirst && candidates.size() > 1)
{
for (std::list<Candidate>::iterator it = candidates.begin(); it !=candidates.end(); ++it)
it->dist = (it->centroid-currentCentroid).norm2();
//sort candidates by their distance
candidates.sort(CandidateDistAscendingComparison);
}
//we will keep track of the best fused 'couple' at each pass
std::list<Candidate>::iterator bestIt = candidates.end();
CCLib::ReferenceCloud* bestFused = 0;
CCVector3 bestNormal(0,0,0);
double bestError = -1.0;
unsigned skipCount = 0;
for (std::list<Candidate>::iterator it = candidates.begin(); it != candidates.end(); /*++it*/)
{
assert(it->leaf && it->leaf->points);
assert(currentPointSet->getAssociatedCloud() == it->leaf->points->getAssociatedCloud());
//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