Its not clear if you're adding multiple points or not...<br><br>Given the code you've included, you're only inserting one point from the line <br>m_Points->GetPoints()->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'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"><<a href="mailto:Gerald.Lodron@joanneum.at">Gerald.Lodron@joanneum.at</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;">
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->GetPoints()->InsertNextPoint(m_daPointPosition);<br>
m_Points->GetVerts()->InsertNextCell(1);<br>
m_Points->GetVerts()->InsertCellPoint(m_Points->GetPoints()->GetNumberOfPoints()-1);<br>
m_Points->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->DeletePoint(1); //Null pointer exception<br>
m_Points->DeleteCell(1);<br>
<br>
vtkCleanPolyData *Cleaner = vtkCleanPolyData::New();<br>
Cleaner->SetInput(m_Points);<br>
Cleaner->Update();<br>
<br>
m_Points = Cleaner->GetOutput();<br>
m_Points->Update();<br>
m_Points->BuildCells();<br>
m_Points->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>