<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>&gt; Date: Mon, 15 Nov 2010 22:11:25 -0800<br>&gt; From: ambarc@gmail.com<br>&gt; To: vtkusers@vtk.org<br>&gt; Subject: [vtkusers] vtkPoints Adding too many points?<br>&gt; <br>&gt; I'm have a set of vtkPoint references, and each reference seems to be<br>&gt; getting the points added to it's predecessor as well as the ones added<br>&gt; to itself. Here's the basic code:<br>&gt; <br>&gt;         vtkPolyData *poly1 = vtkPolyData::New();<br>&gt;         vtkPolyData *poly2 = vtkPolyData::New();<br>&gt;         vtkPolyData *poly3 = vtkPolyData::New();<br>&gt;         vtkPolyData *poly4 = vtkPolyData::New();<br>&gt; <br>&gt;         vtkPoints *points1 = vtkPoints::New();<br>&gt;         vtkPoints *points2 = vtkPoints::New();<br>&gt;         vtkPoints *points3 = vtkPoints::New();<br>&gt;         vtkPoints *points4 = vtkPoints::New();<br>&gt; <br>&gt;         //Inserting points.<br>&gt;         <br>&gt;         points1-&gt;InsertPoint(0, 1, 4, 5);<br>&gt;         points1-&gt;InsertPoint(1, -1, 3, 2);<br>&gt;         points1-&gt;InsertPoint(2, -4, -4, -4);<br>&gt; <br>&gt;         points2-&gt;InsertPoint(3, 2, 8, 9);<br>&gt;         points2-&gt;InsertPoint(4, -2, 2, 3);<br>&gt;         points2-&gt;InsertPoint(5, 4,  5,  5);<br>&gt; <br>&gt;         points3-&gt;InsertPoint(6, -1, 4, -5);<br>&gt;         points3-&gt;InsertPoint(7, -4, -2, -2);<br>&gt;         points3-&gt;InsertPoint(8, -2, -9, 9);<br>&gt; <br>&gt;         points4-&gt;InsertPoint(9, 1, 6, 5);<br>&gt;         points4-&gt;InsertPoint(10, -1, 3, 2);<br>&gt;         points4-&gt;InsertPoint(11, -4, -4, -4);<br>&gt;         cout&lt;&lt;points4-&gt;GetNumberOfPoints()&lt;&lt;"<br>&gt; "&lt;&lt;points3-&gt;GetNumberOfPoints()&lt;&lt;" "&lt;&lt;points2-&gt;GetNumberOfPoints()&lt;&lt;"<br>&gt; "&lt;&lt;points1-&gt;GetNumberOfPoints()&lt;&lt;" "&lt;&lt;endl;<br>&gt;         //Setting the points as the data.<br>&gt; <br>&gt;         poly1-&gt;SetPoints(points1);<br>&gt;         poly2-&gt;SetPoints(points2);<br>&gt;         poly3-&gt;SetPoints(points3);<br>&gt;         poly4-&gt;SetPoints(points4);<br>&gt; <br>&gt;         cout&lt;&lt;poly4-&gt;GetNumberOfPoints()&lt;&lt;" "&lt;&lt;poly3-&gt;GetNumberOfPoints()&lt;&lt;"<br>&gt; "&lt;&lt;poly2-&gt;GetNumberOfPoints()&lt;&lt;" "&lt;&lt;poly1-&gt;GetNumberOfPoints()&lt;&lt;"<br>&gt; "&lt;&lt;endl;<br>&gt; <br>&gt; The output I get is<br>&gt; 12 9 6 3<br>&gt; 12 9 6 3<br>&gt; <br>&gt; Instead of the expected<br>&gt; 3 3 3 3<br>&gt; 3 3 3 3<br>&gt; _______________________________________________<br>&gt; Powered by www.kitware.com<br>&gt; <br>&gt; Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html<br>&gt; <br>&gt; Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ<br>&gt; <br>&gt; Follow this link to subscribe/unsubscribe:<br>&gt; http://www.vtk.org/mailman/listinfo/vtkusers<br>                                               </body>
</html>