空间八叉树---vt..官方解释:octree-based spatial(空间的) search object to quickly locate(位于) cellsvtkCellLocator is a spatial
vtkSmartPointer<vtkCellLocator> cellLocator = vtkSmartPointer<vtkCellLocator>::New(); cellLocator->SetDataSet(pointSource->GetOutput()); cellLocator->BuildLocator(); //需要查询的点的坐标 double queryPoint[3] = {1.0, 2.0, 3.0}; //查询最近的点的索引 ...
接下来,我们需要将待定位的数据集传递给cell locator,并调用其BuildLocator()方法来初始化locator对象。 第三部分:vtk cell locator的使用方法(约800字) 完成初始化后,我们可以使用cell locator来进行定位和查询操作。首先,我们可以通过调用cell locator的FindCell()方法来根据某个点的坐标查找最近的单元格。这个方法...
vtkCellLocator IntersectWithLine 有一个重载函数(下面),返回不是最近的交点,因为到交点的距离没有比较,就直接覆盖了。不知道原本是否就是这样。可以用其他重载代替。 intIntersectWithLine(constdoublep1[3],constdoublep2[3],doubletol,double& t,doublex[3],doublepcoords[3],int& subId, vtkIdType& cellId,...
=vtk.vtkRenderer()27renWin =vtk.vtkRenderWindow()28renWin.AddRenderer( ren )2930iren =vtk.vtkRenderWindowInteractor()31iren.SetRenderWindow(renWin)3233#Create pipeline. Two spheres: one is the target to34#be intersected against, and is placed inside a static35#cell locator. The second bounds...