I'am trying to cluster a point cloud with vtkEuclideanClusterExtraction, like that:
vtkSmartPointer<vtkPolyData> cloudPolyData = vtkSmartPointer < vtkPolyData>::New();
cloudPolyData->SetPoints(_PointCloudInput);
vtkNew<vtkEuclideanClusterExtraction> cluster;
cluster->SetInputData(cloudPolyData);
cluster->SetExtractionModeToAllClusters();
cluster->SetRadius(100);
cluster->Update();
where
_PointCloudInput is a vtkSmartPointer<vtkPoints>
When I did
cluster->GetNumberOfExtractedClusters(), I got 104, so I guess it worked well.
Now, I'd like to know which point belongs to which cluster to create a list of vtkPoints for each cluster, so 104 lists.
How could I do that ?
I tried with cluster->GetOutput()->GetPoints(); but I got all my cloud.