I’m using VTK 9.3 for my C++ application.
I use vtkInteractorStyleRubberBandPick and vtkExtractPolyDataGeometry to select a vtkPolyData subset of a full vtkPolyData object. How can I find each selected subset point in the full data? Each point in the subset has point ID starting from 0. How do I find the point ID of each subset point in the full data? Claude.ai claims that “vtkExtractPolyDataGeometry` automatically creates point and cell data arrays that store the original IDs” and suggests I retrieve them as follows:
// Enable pass-through of original pointIDs
extractor->SetPassThroughPointIds(true);
// Get the original point IDs
vtkIdTypeArray* originalPointIds = vtkIdTypeArray::SafeDownCast(
extractedData->GetPointData()->GetArray("vtkOriginalPointIds"));
However the compiler says that vtkExtractPolyDataGeometry has no member named ‘SetPassThroughPointIds’. If I remove that line and run the code, originalPointIds returned by GetArray(“vtkOriginalPointIds”) is null.
What is the proper way to access the original point IDs?
Thanks!