[vtkusers] stack-like push function for vtkIdList()

David Gobbi david.gobbi at gmail.com
Wed Jun 30 15:23:55 EDT 2010

I think that Luca is asking if there is a proper "insert" method, and
there is not.  The InsertId() method for vtkIdList is actually a
version of SetId() that does memory allocation if you try to set an Id
that is past the end of the array.  It's hard to explain because this
is a weird feature that I have never seen anywhere except VTK.

There is no insert_item or delete_item functionality for the VTK
arrays.  You can only add elements at the end of the array.


On Wed, Jun 30, 2010 at 12:50 PM, David Doria <daviddoria+vtk at gmail.com> wrote:
> On Wed, Jun 30, 2010 at 2:38 PM, Luca Penasa <luca.penasa at email.it> wrote:
>> hi everybody,
>>        is there an efficent way to implement a stack-like push on vtkIdlist
>> objects (put an id at element 0 of list)??
>> Thank you
> Are you looking for the InsertNextId function?
> http://www.vtk.org/doc/nightly/html/classvtkIdList.html#a3adaec64d2ff8e657013d864a9ca63c8
> 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

More information about the vtkusers mailing list