Hi,<br><br>I have the following code:<br><br>vtkCellArray * p_cells = vtkCellArray::New();<br><br>p_cells-&gt;Allocate( ids.size() );<br><br>for ( vector&lt;vtkIdType&gt;::const_iterator id = ids.begin(), id_end = ids.end(); id != id_end; ++id )<br>
&nbsp;&nbsp; p_cells-&gt;InsertNextCell(1,&amp;*c);<br><br><br>But, I am not sure that my Allocate() call is correct.&nbsp; Should it be:<br>Allocate(ids.size()*2);<br><br>... the reason I ask is that I wanted to try and use p_cells-&gt;WritePointer() to do the copying with a memcpy, but it looks like the format of a CellArray is something like:<br>
<br>[cellid, pointid, cellid, pointid, cellid, pointid]<br><br>if i had 2 points per cell it would be<br>[cellid, point1, point2, cellid, point1, point2, etc]<br><br>if this is so, then in order to create a cellarray of 20 points, each in their own cells, i&#39;d need to alloc room for 40.<br>
<br><br>Am I reading the code correctly?<br>Does anyone do efficient copies, or does everyone use InsertNextEtc() methods?<br><br>thanks,<br>Paul<br><br>