<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</style>
</head>
<body class='hmmessage'>
Ok thank you for the tip but this involves a copy of the points, I would have appreciated a way of traversing the list of points while avoiding copies.<br><br>&gt; Date: Fri, 11 Sep 2009 10:20:36 -0400<br>&gt; Subject: Re: [vtkusers] vtkPoints array management<br>&gt; From: bill.lorensen@gmail.com<br>&gt; To: stan1313@hotmail.fr<br>&gt; CC: vtkusers@vtk.org<br>&gt; <br>&gt; Avoid using GetPoint(id). It calls this-&gt;GetData-&gt;GetTuple(id). The<br>&gt; comments for GetTuple say it all...<br>&gt;   // Description:<br>&gt;   // Get the data tuple at ith location. Return it as a pointer to an array.<br>&gt;   // Note: this method is not thread-safe, and the pointer is only valid<br>&gt;   // as long as another method invocation to a vtk object is not performed.<br>&gt;   virtual double *GetTuple(vtkIdType i) = 0;<br>&gt; <br>&gt; Use<br>&gt; double pts0[3];<br>&gt; points-&gt;GetPoint(0, pts0);<br>&gt; <br>&gt; double ptsn[3];<br>&gt; points-&gt;GetPoint(1, ptsn);<br>&gt; <br>&gt; Bill<br>&gt; <br>&gt; On Fri, Sep 11, 2009 at 8:52 AM, Fred Fred &lt;stan1313@hotmail.fr&gt; wrote:<br>&gt; &gt; Look at this men:<br>&gt; &gt;<br>&gt; &gt; &nbsp; vtkPoints *points = vtkPoints::New();<br>&gt; &gt; &nbsp; [...some point adding steps...]<br>&gt; &gt; &nbsp; int numPts = points-&gt;GetNumberOfPoints();<br>&gt; &gt; &nbsp; printf("numPts=%d\n", numPts);<br>&gt; &gt; &nbsp; double *pts0 = points-&gt;GetPoint(0);<br>&gt; &gt; &nbsp; double *ptsn = points-&gt;GetPoint(1);<br>&gt; &gt; &nbsp; printf("%p %p\n", pts0, ptsn);<br>&gt; &gt;<br>&gt; &gt; which leads:<br>&gt; &gt;<br>&gt; &gt; numPts=11<br>&gt; &gt; 0x19982c40 0x19982c40<br>&gt; &gt;<br>&gt; &gt; Whatever the possibility I Made some mistake anywhere, I can not understand<br>&gt; &gt; how this is possible!<br>&gt; &gt; GetPoint(0) returns the same address as GetPoint(1) while there are 11<br>&gt; &gt; points in the array!!!<br>&gt; &gt;<br>&gt; &gt;<br>&gt; &gt; ________________________________<br>&gt; &gt; Messenger débarque dans Hotmail ! Essayez-le !<br>&gt; &gt; _______________________________________________<br>&gt; &gt; Powered by www.kitware.com<br>&gt; &gt;<br>&gt; &gt; Visit other Kitware open-source projects at<br>&gt; &gt; http://www.kitware.com/opensource/opensource.html<br>&gt; &gt;<br>&gt; &gt; Please keep messages on-topic and check the VTK FAQ at:<br>&gt; &gt; http://www.vtk.org/Wiki/VTK_FAQ<br>&gt; &gt;<br>&gt; &gt; Follow this link to subscribe/unsubscribe:<br>&gt; &gt; http://www.vtk.org/mailman/listinfo/vtkusers<br>&gt; &gt;<br>&gt; &gt;<br><br /><hr />Vous cherchez l'intégrale des clips de Michael Jackson ? <a href='http://www.bing.com/videos/search?q=Michael+Jackson&FORM=MVDE6' target='_new'>Bing ! Trouvez !</a></body>
</html>