<div dir="ltr">Hi Elena,<div><br></div><div>I coud be wrong but I dont think this is correct:</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
vtkSmartPointer<vtkPolyData> polydata = reader->GetOutput();</blockquote><div><br></div><div>reader->GetOutput() returns a regular pointer to a vtkPolydata not a smart pointer.</div><div><br></div><div>Try:</div>
<div><br></div><div>vtkPolyData *polydata = reader->GetOutput();</div><div><br></div><div>instead.</div><div><br></div><div>hth</div><div><br></div><div>Goodwin</div><div><br></div><div><br></div></div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Mon, Apr 7, 2014 at 4:00 PM, elena bresciani <span dir="ltr"><<a href="mailto:elena.bresciani87@gmail.com" target="_blank">elena.bresciani87@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">Hello everybody!<br><br>I need your help with a segmentation fault error.<br>Using gdb I understood where it is generated but I don't know how to modify the code to make it run.<br><br>Here's the portion of the code that I'm talking about:<br>
<br><br><i>vtkSmartPointer<vtkPolyData> polydata = reader->GetOutput();</i><br>(the reader is a vtkXMLPolyDataReader)<br><br><i>vtkFloatArray *PointNormalArray = vtkFloatArray::SafeDownCast( polydata->GetPointData()->GetNormals() ) ; <br>
<br>for(vtkIdType i = 0; i < PointNormalArray->GetNumberOfTuples(); i++) {....}</i><br> <br>everytime I call GetNumberOfTuples I have this error so I think the problem is on PointNormalArray.<br><br>Can somebody help me?<br>
<br>Thanks in advance<span class="HOEnZb"><font color="#888888"><br><br>Elena<br></font></span></div>
<br>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
<br></blockquote></div><br></div>