如何复制KD-Tree CGAL

时间:2016-04-13 11:28:00

标签: c++ pointers copy-constructor cgal kdtree

我是CGAL的新手,我需要根据提供的点云构建一个动态数量的Neighbor_search :: Tree。以下是示例代码:

typedef Neighbor_search::Tree SpatialTree; 

std::vector<SpatialTree> cloudTrees(pointCloudPath.size()); 

for(int i = 0; i < pointCloudPath.size(); i++) 
{ 
        readPLY(pointCloudPath.at(i), pointClouds.at(i));   
        SpatialTree cloudtree(pointClouds.at(i).begin(), pointClouds.at(i).end()); 
        cloudTrees.at(i) = cloud1tree; //error 
} 

我收到错误:'boost :: mutex :: operator =':无法访问类'boost :: mutex'中声明的私有成员

我搜索了这个问题,似乎kd-tree中的复制构造函数受到保护,而且类是不可复制的。我尝试使用它有效的指针,但我的问题是我无法访问功能块中的数据:

std::vector<SpatialTree*> cloudTrees(pointCloudPath.size()); 

for(int i = 0; i < pointCloudPath.size(); i++) 
{ 
        readPLY(pointCloudPath.at(i), pointClouds.at(i));   
        SpatialTree cloud1tree(pointClouds.at(i).begin(), pointClouds.at(i).end()); 
        cloudTrees.at(i) = &cloud1tree; 
}   

 //data in cloudTrees is not accessible 

请帮忙,我怎样才能在矢量中复制树?

0 个答案:

没有答案