<div class="gmail_extra">To be extra clear, you are trying to insert a point into unallocated memory. Before calling SetPoint you need to first specify</div><div class="gmail_extra">the number of points you want stored with the call SetNumberOfPoints.<br>
<br><div class="gmail_quote">On Thu, Apr 26, 2012 at 9:40 AM, David Doria <span dir="ltr"><<a href="mailto:daviddoria@gmail.com" target="_blank">daviddoria@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On Thu, Apr 26, 2012 at 8:46 AM, Wenlong <<a href="mailto:scc.wwl@gmail.com">scc.wwl@gmail.com</a>> wrote:<br>
> Dear all,<br>
><br>
> I'm trying to insert point coordinates into a vtkPoints instance. Here is<br>
> what I do<br>
><br>
> vtkPoints* points = vtkPoints::New();<br>
> float x[3];<br>
> x[0] = 1;<br>
> x[1] = 2;<br>
> x[3] = 3;<br>
> points->InsertPoint(0, x);<br>
><br>
> However, the compiler pops an error says there is acess conflict happens.<br>
> How can I solve this problem?<br>
><br>
> I used above operations on Windows Vista with Visual Studio 2008 before.<br>
> There was no such problem.<br>
><br>
> Now the program is working on Windows 7 with Visual Studion 2008. Could<br>
> there be something related with the operation system?<br>
><br>
> Many thanks in advance.<br>
><br>
> Best regards<br>
> Wenlong<br>
<br>
</div>If you want to insert points sequentially, use<br>
<br>
points->InsertNextPoint(x);<br>
<br>
If you want to set a specific point that already exists, use:<br>
<br>
points->SetPoint(n, x);<br>
<br>
David<br>
<div class="HOEnZb"><div class="h5">_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>Robert Maynard<br>
</div>