0
這是我目前:如何將vtkPolyData傳遞給vtkDijkstraGraphGeodesicPath?
vtkSmartPointer<vtkPolyData> polydata = vtkSmartPointer<vtkPolyData>::New();
polydata->SetPoints(path);
polydata->Modified();
vtkSmartPointer<vtkDijkstraGraphGeodesicPath> dijkstra =
vtkSmartPointer<vtkDijkstraGraphGeodesicPath>::New();
dijkstra->SetInputData(polydata);
dijkstra->SetStartVertex(0);
dijkstra->SetEndVertex(1);
dijkstra->Update();
不過,每次它執行Update()
,則返回vector subscript out of range
。我怎樣才能解決這個問題?