[vtkusers] How to access sequentially pointers of vtkPoints data (coordinates) ?
Michael Jackson
mike.jackson at bluequartz.net
Sat Jan 17 09:19:22 EST 2009
You might want to try:
double* data = (double*)(points->GetData()->GetVoidPointer(0));
This will give you the raw pointer to the start of the array. It is up
to you to now create a proper index into that array in order to work
with the data.
_________________________________________________________
Mike Jackson mike.jackson at bluequartz.net
BlueQuartz Software www.bluequartz.net
Principal Software Engineer Dayton, Ohio
On Jan 17, 2009, at 7:54 AM, pof wrote:
> Hello,
>
> I need to access (for further use outside of vtk frame) the pointers
> that hold the points data of of vtkPoints set.
> So I try using vtkPoints::GetPoint(int id) that is supposed to
> return the pointer I am looking for.
>
> The problem is that I got something wrong at execution :
> - if I call GetPoint(Id0) only once for a given Id, this is ok
> - but then if I call GetPoint(Id1) a second time (or more) for
> another Id, all the stored pointers are the same and point to coord
> vector of the last accessed point.
> Here below is a small code that reproduce the problem.
>
> I'm obviously missing something but can't figure out what!
> Does anybody has got an idea on the mistake I'm doing?
>
> Thanks
> JD
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
More information about the vtkusers
mailing list