Its not clear if you&#39;re adding multiple points or not...<br><br>Given the code you&#39;ve included, you&#39;re only inserting one point from the line <br>m_Points-&gt;GetPoints()-&gt;InsertNextPoint(m_daPointPosition);<br>
and then deleting the second point (index 1, but you only have index 0), which would cause a null pointer exception?<br><br><br>If you&#39;re adding multiple points in the lines of code that are not included, make sure to include them.<br>
<br><br><br><div class="gmail_quote">On Mon, Nov 2, 2009 at 1:30 AM, Lodron, Gerald <span dir="ltr">&lt;<a href="mailto:Gerald.Lodron@joanneum.at">Gerald.Lodron@joanneum.at</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;">
Hello,<br>
<br>
I stored a point list into the vtkPolyData object using these lines:<br>
<br>
//m_Points ... vtkPolyData Object pointer<br>
//m_daPointPosition ... Three dimensional double array specifying x,y and z coordinate of the point<br>
<br>
m_Points-&gt;GetPoints()-&gt;InsertNextPoint(m_daPointPosition);<br>
m_Points-&gt;GetVerts()-&gt;InsertNextCell(1);<br>
m_Points-&gt;GetVerts()-&gt;InsertCellPoint(m_Points-&gt;GetPoints()-&gt;GetNumberOfPoints()-1);<br>
m_Points-&gt;Update();<br>
<br>
This works fine, I also can visualize it. Now I want to delete a specific point, e.g. the second point which was inserted, but I always get a null pointer exception:<br>
<br>
m_Points-&gt;DeletePoint(1); //Null pointer exception<br>
m_Points-&gt;DeleteCell(1);<br>
<br>
vtkCleanPolyData *Cleaner = vtkCleanPolyData::New();<br>
Cleaner-&gt;SetInput(m_Points);<br>
Cleaner-&gt;Update();<br>
<br>
m_Points = Cleaner-&gt;GetOutput();<br>
m_Points-&gt;Update();<br>
m_Points-&gt;BuildCells();<br>
m_Points-&gt;BuildLinks();<br>
<br>
Cleaner = NULL; //Use smart pointers to delete<br>
<br>
<br>
Have anybody a suggestion what i made false?<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>
</blockquote></div><br>