<br><div class="gmail_quote">On Thu, Apr 23, 2009 at 12:58 PM, Berk Geveci <span dir="ltr">&lt;<a href="mailto:berk.geveci@kitware.com">berk.geveci@kitware.com</a>&gt;</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-&gt;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&lt;vtkPolyDataNormals&gt; normalGenerator = vtkSmartPointer&lt;vtkPolyDataNormals&gt;::New();<br>
        normalGenerator-&gt;SetInput(polydata);<br>
        normalGenerator-&gt;SetComputePointNormals(1);<br>
        normalGenerator-&gt;SetComputeCellNormals(0);<br>
        normalGenerator-&gt;SetSplitting(0);<br>
        normalGenerator-&gt;Update();<br>
        polydata = normalGenerator-&gt;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 &quot;real&quot; code the
FieldData call is causing a segmentation fault.<br>
<br>
I put this<br>
cerr &lt;&lt; &quot;Number of points after normal extraction: &quot; &lt;&lt; polydata-&gt;GetNumberOfPoints() &lt;&lt; endl;<br>
<br>
after the normalGenerator-&gt;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>