<br><div class="gmail_quote">On Thu, Apr 23, 2009 at 12:58 PM, Berk Geveci <span dir="ltr"><<a href="mailto:berk.geveci@kitware.com">berk.geveci@kitware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Maybe the polydata pointer is invalid? Or maybe there is some issues<br>
with using smart pointers. Try this:<br>
<br>
vtkFieldData* FieldData = polydata->GetFieldData();<br>
<br>
where polydata is not a smart pointer.<br>
<br>
-berk<br>
</blockquote></div><br>Berk,<br><br>It still crashed without using the smartpointer.<br><br>
However, it stops crashing if I comment the following code (immediately before the FieldData call):<br>
<br> vtkSmartPointer<vtkPolyDataNormals> normalGenerator = vtkSmartPointer<vtkPolyDataNormals>::New();<br>
normalGenerator->SetInput(polydata);<br>
normalGenerator->SetComputePointNormals(1);<br>
normalGenerator->SetComputeCellNormals(0);<br>
normalGenerator->SetSplitting(0);<br>
normalGenerator->Update();<br>
polydata = normalGenerator->GetOutput();<br>
<br>
I tried it in a simplified example and the field data seemed to be
intact after this normal extraction, but in my "real" code the
FieldData call is causing a segmentation fault.<br>
<br>
I put this<br>
cerr << "Number of points after normal extraction: " << polydata->GetNumberOfPoints() << endl;<br>
<br>
after the normalGenerator->GetOutput() and it shows the correct
number of points, so it seems like the polydata pointer is still valid.<br>
<br clear="all">Thanks,<br><br>David<br>