<meta http-equiv="content-type" content="text/html; charset=utf-8"><span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 15px; border-collapse: collapse; "><div><span class="Apple-style-span" style="border-collapse: separate; font-family: arial; font-size: small; ">On Fri, Mar 12, 2010 at 8:48 AM, Bill Chivas <span dir="ltr"><<a href="mailto:noo134@googlemail.com">noo134@googlemail.com</a>></span> wrote:</span></div>
</span><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div>Thank you for your replies.</div>
<div> </div>
<div>To everyone:</div>
<div>I did some tests and i think there is a bug.</div>
<div>Let's say i have the following:</div>
<div> </div>
<div>
<div><font color="#000000"><font color="#000000"><font color="#000000">vtkPoints *points = vtkPoints::New();</font></font></font></div>
<div><font color="#000000"><font color="#000000"><font color="#000000">points->InsertPoint(609836, x, y, z);</font></font></font></div>
<div><font color="#000000"><font color="#000000"><font color="#000000">points->InsertPoint(609837, x, y, z);</font></font></font></div>
<div><font color="#000000"><font color="#000000"><font color="#000000">points->InsertPoint(609839, x, y, z);</font></font></font></div>
<div><font color="#000000"><font color="#000000"><font color="#000000">points->InsertPoint(609838, x, y, z);</font></font></font></div>
<div> </div>
<div>The points->GetNumberOfPoints() gives 609840.</div>
<div>So it supposes that the ids are starting from 0 and it returns (the max_id of all points plus 1) ?</div>
<div> </div><div><br></div></div></blockquote><span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 15px; border-collapse: collapse; "><div><font color="#000000"><font color="#000000"><font color="#000000"><br>
</font></font></font></div><div><font color="#000000"><font color="#000000"><font color="#000000">I believe the problem is that you are not calling SetNumberOfPoints before you start inserting points.</font></font></font></div>
<div><font color="#000000"><font color="#000000"><font color="#000000"><br>This code works for me:</font></font></font></div><div><font color="#000000"><font color="#000000"><font color="#000000"><br></font></font></font></div>
<div><font color="#000000"><font color="#000000"><font color="#000000"><div>#include <vtkSmartPointer.h></div><div>#include <vtkPoints.h></div><div><br></div><div>int main(int argc, char *argv[]) </div><div>{</div>
<div> vtkSmartPointer<vtkPoints> points = </div><div> vtkSmartPointer<vtkPoints>::New();</div><div> points->SetNumberOfPoints(610000);</div><div> points->InsertPoint(609836, 1, 2, 3);</div><div> points->InsertPoint(609837, 4, 5, 6);</div>
<div> </div><div> return EXIT_SUCCESS;</div><div>}</div><div><br></div><div>On a separate note, I strongly recommend using SmartPointer's instead of regular points (I used it in the example above).</div><div><br></div>
</font></font></font></div></span>Thanks,<br><br>David</div>