当前位置: 首页>>代码示例>>C++>>正文


C++ ReferenceCloud::getPoint方法代码示例

本文整理汇总了C++中cclib::ReferenceCloud::getPoint方法的典型用法代码示例。如果您正苦于以下问题:C++ ReferenceCloud::getPoint方法的具体用法?C++ ReferenceCloud::getPoint怎么用?C++ ReferenceCloud::getPoint使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在cclib::ReferenceCloud的用法示例。


在下文中一共展示了ReferenceCloud::getPoint方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: estimateDelta

void ccAlignDlg::estimateDelta()
{
    unsigned i, nb;
    float meanDensity, meanSqrDensity, dev, value;
    ccProgressDialog pDlg(false,this);

    CCLib::ReferenceCloud *sampledData = getSampledData();
    //we have to work on a copy of the cloud in order to prevent the algorithms from modifying the original cloud.
    CCLib::ChunkedPointCloud* cloud = new CCLib::ChunkedPointCloud();
    cloud->reserve(sampledData->size());
    for(i=0; i<sampledData->size(); i++)
        cloud->addPoint(*sampledData->getPoint(i));
    cloud->enableScalarField();

    CCLib::GeometricalAnalysisTools::computeLocalDensity(cloud, &pDlg);
    nb = 0;
    meanDensity = 0.;
    meanSqrDensity = 0.;
    for(i=0; i<cloud->size(); i++)
    {
        value = cloud->getPointScalarValue(i);
        if(value > ZERO_TOLERANCE)
        {
            value = 1/value;
            meanDensity += value;
            meanSqrDensity += value*value;
            nb++;
        }
    }
    meanDensity /= (float)nb;
    meanSqrDensity /= (float)nb;
    dev = meanSqrDensity-(meanDensity*meanDensity);

    delta->setValue(meanDensity+dev);
    delete sampledData;
    delete cloud;
}
开发者ID:lpclqq,项目名称:trunk,代码行数:37,代码来源:ccAlignDlg.cpp

示例2: FuseCells


//.........这里部分代码省略.........
						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
						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);
开发者ID:3660628,项目名称:trunk,代码行数:67,代码来源:kdTreeForFacetExtraction.cpp


注:本文中的cclib::ReferenceCloud::getPoint方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。