[CC]获取ScalarField的值
//根据字段滤波
void MainWindow::doActionFilterByValue()
1 ReferenceCloud* ManualSegmentationTools::segment(GenericIndexedCloudPersist* aCloud, ScalarType minDist, ScalarType maxDist) 2 { 3 if (!aCloud) 4 { 5 assert(false); 6 return 0; 7 } 8 9 ReferenceCloud* Y = new ReferenceCloud(aCloud); 10 11 //for each point 12 for (unsigned i=0; i<aCloud->size(); ++i) 13 { 14 const ScalarType dist = aCloud->getPointScalarValue(i); 15 //we test if its assocaited scalar value falls inside the specified intervale 16 if (dist >= minDist && dist <= maxDist) 17 { 18 if (!Y->addPointIndex(i)) 19 { 20 //not engouh memory 21 delete Y; 22 Y=0; 23 break; 24 } 25 } 26 } 27 28 return Y; 29 }
作者:太一吾鱼水
文章未经说明均属原创,学习笔记可能有大段的引用,一般会注明参考文献。
欢迎大家留言交流,转载请注明出处。