[vtkusers] vtkIdTypeArray: segmentation fault when extracting vtkOriginalPointIds

Miguel Sotaquira msotaquira at gmail.com
Wed May 23 23:50:13 EDT 2012


Hi everyone,

I have a polydata that results from using vtkThresholdPoints on another
mesh. I want to retrieve the "vtkOriginalPointIds" from this resulting
polydata, here's the code snippet:

vtkIdTypeArray* origIds
= vtkIdTypeArray::SafeDownCast(polydataThresholded->GetPointData()->GetArray("vtkOriginalPointIds"));

so far so good. However, when I try to access the "origIds" array I get a
segmentation fault. When printing origIds I find that it is a NULL pointer.
For example, the snippet:

std::cout << origIds << std::endl;
std::cout << origIds->GetNumberOfTuples() << std::endl;

gives me:

0
Segmentation fault

Is there something wrong with my code? How to retrieve the original point
ids array from a polydata?

Thanks,
Miguel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120524/253fc941/attachment.htm>


More information about the vtkusers mailing list