<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>> Date: Fri, 11 Sep 2009 10:20:36 -0400<br>> Subject: Re: [vtkusers] vtkPoints array management<br>> From: bill.lorensen@gmail.com<br>> To: stan1313@hotmail.fr<br>> CC: vtkusers@vtk.org<br>> <br>> Avoid using GetPoint(id). It calls this->GetData->GetTuple(id). The<br>> comments for GetTuple say it all...<br>> // Description:<br>> // Get the data tuple at ith location. Return it as a pointer to an array.<br>> // Note: this method is not thread-safe, and the pointer is only valid<br>> // as long as another method invocation to a vtk object is not performed.<br>> virtual double *GetTuple(vtkIdType i) = 0;<br>> <br>> Use<br>> double pts0[3];<br>> points->GetPoint(0, pts0);<br>> <br>> double ptsn[3];<br>> points->GetPoint(1, ptsn);<br>> <br>> Bill<br>> <br>> On Fri, Sep 11, 2009 at 8:52 AM, Fred Fred <stan1313@hotmail.fr> wrote:<br>> > Look at this men:<br>> ><br>> > vtkPoints *points = vtkPoints::New();<br>> > [...some point adding steps...]<br>> > int numPts = points->GetNumberOfPoints();<br>> > printf("numPts=%d\n", numPts);<br>> > double *pts0 = points->GetPoint(0);<br>> > double *ptsn = points->GetPoint(1);<br>> > printf("%p %p\n", pts0, ptsn);<br>> ><br>> > which leads:<br>> ><br>> > numPts=11<br>> > 0x19982c40 0x19982c40<br>> ><br>> > Whatever the possibility I Made some mistake anywhere, I can not understand<br>> > how this is possible!<br>> > GetPoint(0) returns the same address as GetPoint(1) while there are 11<br>> > points in the array!!!<br>> ><br>> ><br>> > ________________________________<br>> > Messenger débarque dans Hotmail ! Essayez-le !<br>> > _______________________________________________<br>> > Powered by www.kitware.com<br>> ><br>> > Visit other Kitware open-source projects at<br>> > http://www.kitware.com/opensource/opensource.html<br>> ><br>> > Please keep messages on-topic and check the VTK FAQ at:<br>> > http://www.vtk.org/Wiki/VTK_FAQ<br>> ><br>> > Follow this link to subscribe/unsubscribe:<br>> > http://www.vtk.org/mailman/listinfo/vtkusers<br>> ><br>> ><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>