[vtkusers] vtkPointSet::GetPoint bug?

Francois Bertel francois.bertel at kitware.com
Tue Aug 11 19:05:05 EDT 2009


Hello,

This is just a very error-prone interface. Ironically, I ran into the
same issue than you today.
It actually returns the pointer of an internal temporary tuple.

Just don't use it.

I just added some comment right now to this crapy method (rev 1.67 of
VTK/Common/vtkPoints.h).

http://public.kitware.com/cgi-bin/viewcvs.cgi/Common/vtkPoints.h?r1=1.66&r2=1.67

Regards.

On Tue, Aug 11, 2009 at 6:25 PM, David Doria<daviddoria+vtk at gmail.com> wrote:
> One of the functions for getting a point from a PolyData (actually the
> PointSet) doesn't seem to work (or I am doing something wrong)
>
> This one works fine:
> 1) void GetPoint (vtkIdType ptId, double x[3])
>
>     double p0[3];
>     TriPoints->GetPoint(0, p0);
>
> This one seems to give the same values for GetPoint(0), GetPoint(1),
> GetPoint(2).
> 2) double * GetPoint (vtkIdType ptId)
>
> double* p0;
> p0 = TriPoints->GetPoint(0);
>
> Here is a compilable example:
> http://www.rpi.edu/~doriad/VTK_List/GetPoint/GetPointTest.cpp
>
> This seems like a pretty basic function, so maybe I am just calling it
> wrong?
>
> Thanks,
>
> David
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>



-- 
François Bertel, PhD  | Kitware Inc. Suite 204
1 (518) 371 3971 x113 | 28 Corporate Drive
                      | Clifton Park NY 12065, USA



More information about the vtkusers mailing list