[vtkusers] About vtkPoints::InsertPoint()
Robert Maynard
robert.maynard at kitware.com
Thu Apr 26 09:42:45 EDT 2012
To be extra clear, you are trying to insert a point into unallocated
memory. Before calling SetPoint you need to first specify
the number of points you want stored with the call SetNumberOfPoints.
On Thu, Apr 26, 2012 at 9:40 AM, David Doria <daviddoria at gmail.com> wrote:
> On Thu, Apr 26, 2012 at 8:46 AM, Wenlong <scc.wwl at gmail.com> wrote:
> > Dear all,
> >
> > I'm trying to insert point coordinates into a vtkPoints instance. Here is
> > what I do
> >
> > vtkPoints* points = vtkPoints::New();
> > float x[3];
> > x[0] = 1;
> > x[1] = 2;
> > x[3] = 3;
> > points->InsertPoint(0, x);
> >
> > However, the compiler pops an error says there is acess conflict happens.
> > How can I solve this problem?
> >
> > I used above operations on Windows Vista with Visual Studio 2008 before.
> > There was no such problem.
> >
> > Now the program is working on Windows 7 with Visual Studion 2008. Could
> > there be something related with the operation system?
> >
> > Many thanks in advance.
> >
> > Best regards
> > Wenlong
>
> If you want to insert points sequentially, use
>
> points->InsertNextPoint(x);
>
> If you want to set a specific point that already exists, use:
>
> points->SetPoint(n, x);
>
> 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
>
--
Robert Maynard
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120426/c8efa327/attachment.htm>
More information about the vtkusers
mailing list