I&#39;m not sure what you mean.  The vector is a C++ &quot;vector&quot; object,<div>so you can iterate over it just like you can with any STL container.</div><div><br></div><div>  David<br><br><div class="gmail_quote">On Fri, Nov 26, 2010 at 3:20 PM, Ambar C <span dir="ltr">&lt;<a href="mailto:ambarc@gmail.com">ambarc@gmail.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Thanks David.<br>
<br>
How does the iteration for the vector work? Does it happen in the same<br>
order as the insertion did?<br>
<br>
Best,<br>
<font color="#888888">Ambar<br>
</font><div><div></div><div class="h5"><br>
On Fri, Nov 26, 2010 at 1:09 PM, David Gobbi &lt;<a href="mailto:david.gobbi@gmail.com">david.gobbi@gmail.com</a>&gt; wrote:<br>
&gt; Hi Ambar,<br>
&gt; There is a VTK class called vtkCollection that can hold an array of<br>
&gt; vtkObjects, but it has a poor user interface so I can&#39;t really recommend it.<br>
&gt; Most people use a vector of smart pointers, like this:<br>
&gt; vtkstd::vector&lt;vtkSmartPointer&lt;vtkPoints&gt; &gt; pointVector;<br>
&gt; You can add to the vector like this:<br>
&gt; points = vtkPoints::New();<br>
&gt; // add all points<br>
&gt; pointVector.push_back(points);<br>
&gt; points-&gt;Delete();<br>
&gt; The &quot;Delete()&quot; is bookkeeping for the garbage collector.  After you push the<br>
&gt; points onto pointsVector, the pointsVector owns the reference so you have to<br>
&gt; delete the local reference.<br>
&gt;   David<br>
&gt;<br>
&gt; On Fri, Nov 26, 2010 at 1:27 PM, Ambar C &lt;<a href="mailto:ambarc@gmail.com">ambarc@gmail.com</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; Hello,<br>
&gt;&gt;<br>
&gt;&gt; I&#39;m currently coding a project that needs me to keep creating vtkPoint<br>
&gt;&gt; objects in a loop as I get data. I don&#39;t know how much data I&#39;m going<br>
&gt;&gt; to get so I need a way to keep track of all of my different point<br>
&gt;&gt; groups. Is there some kind of stack or array in vtk that will allow me<br>
&gt;&gt; to keep adding on my points (while creating vtkPoint inside the loop)<br>
&gt;&gt; and still having them in scope after the loop? Please feel free to ask<br>
&gt;&gt; questions.<br>
&gt;&gt;<br>
&gt;&gt; Cheers.<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
&gt;&gt;<br>
&gt;&gt; Visit other Kitware open-source projects at<br>
&gt;&gt; <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
&gt;&gt;<br>
&gt;&gt; Please keep messages on-topic and check the VTK FAQ at:<br>
&gt;&gt; <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
&gt;&gt;<br>
&gt;&gt; Follow this link to subscribe/unsubscribe:<br>
&gt;&gt; <a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
&gt;<br>
&gt;<br>
</div></div></blockquote></div><br></div>