<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'>
The "GetNumberOfPoints()" method returns the "last_id + 1". It doesn't return the actual number of points. <br>It does that because it supposes the points ids indexing is started from 0 (zero). <br>The only one that returns the actual number of points is the "points1" whose ids indexing is started from zero.<br><br>Major problem for deleting a point (or cell)....you have to re-build grid...look at my problem...<br><br>> Date: Mon, 15 Nov 2010 22:11:25 -0800<br>> From: ambarc@gmail.com<br>> To: vtkusers@vtk.org<br>> Subject: [vtkusers] vtkPoints Adding too many points?<br>> <br>> I'm have a set of vtkPoint references, and each reference seems to be<br>> getting the points added to it's predecessor as well as the ones added<br>> to itself. Here's the basic code:<br>> <br>>         vtkPolyData *poly1 = vtkPolyData::New();<br>>         vtkPolyData *poly2 = vtkPolyData::New();<br>>         vtkPolyData *poly3 = vtkPolyData::New();<br>>         vtkPolyData *poly4 = vtkPolyData::New();<br>> <br>>         vtkPoints *points1 = vtkPoints::New();<br>>         vtkPoints *points2 = vtkPoints::New();<br>>         vtkPoints *points3 = vtkPoints::New();<br>>         vtkPoints *points4 = vtkPoints::New();<br>> <br>>         //Inserting points.<br>>         <br>>         points1->InsertPoint(0, 1, 4, 5);<br>>         points1->InsertPoint(1, -1, 3, 2);<br>>         points1->InsertPoint(2, -4, -4, -4);<br>> <br>>         points2->InsertPoint(3, 2, 8, 9);<br>>         points2->InsertPoint(4, -2, 2, 3);<br>>         points2->InsertPoint(5, 4, 5, 5);<br>> <br>>         points3->InsertPoint(6, -1, 4, -5);<br>>         points3->InsertPoint(7, -4, -2, -2);<br>>         points3->InsertPoint(8, -2, -9, 9);<br>> <br>>         points4->InsertPoint(9, 1, 6, 5);<br>>         points4->InsertPoint(10, -1, 3, 2);<br>>         points4->InsertPoint(11, -4, -4, -4);<br>>         cout<<points4->GetNumberOfPoints()<<"<br>> "<<points3->GetNumberOfPoints()<<" "<<points2->GetNumberOfPoints()<<"<br>> "<<points1->GetNumberOfPoints()<<" "<<endl;<br>>         //Setting the points as the data.<br>> <br>>         poly1->SetPoints(points1);<br>>         poly2->SetPoints(points2);<br>>         poly3->SetPoints(points3);<br>>         poly4->SetPoints(points4);<br>> <br>>         cout<<poly4->GetNumberOfPoints()<<" "<<poly3->GetNumberOfPoints()<<"<br>> "<<poly2->GetNumberOfPoints()<<" "<<poly1->GetNumberOfPoints()<<"<br>> "<<endl;<br>> <br>> The output I get is<br>> 12 9 6 3<br>> 12 9 6 3<br>> <br>> Instead of the expected<br>> 3 3 3 3<br>> 3 3 3 3<br>> _______________________________________________<br>> Powered by www.kitware.com<br>> <br>> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html<br>> <br>> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ<br>> <br>> Follow this link to subscribe/unsubscribe:<br>> http://www.vtk.org/mailman/listinfo/vtkusers<br>                                            </body>
</html>