[vtk-developers] Data structures in VTK

Will Schroeder will.schroeder at kitware.com
Mon Dec 31 14:31:46 EST 2001

Hi Andy-

vtkDataArrays are dynamic arrays. We already have these.


At 11:20 AM 12/31/2001 -0500, Andy Cedilnik wrote:
>I don't think some primitive containers are too difficult to write. I mean 
>the hash
>tables and lists that are scattered around VTK tree were probably written in
>short amount of time anyway. Let us start selectively and add these classes
>to VTK. I suggest we brainstorm the interface that will fulfill 
>everybody's needs.
>So, for example, I need this in a dynamic array:
>Find(x) // finds element x
>Insert(i, x) // inserts element x at position i
>Append(x)  // appends element x
>Prepend(x) // prepend element x
>Remove(i) // remove's element at position i
>Clean() // removes all elements
>Size() // returns number of elements
>RealSize() // returns size of internal array
>The find is tricky, because you need a comparison function.
>All other methods are pretty trivial.
>Some other methods:
>Sort(i,j) // Sorts the range between i and j
>Remove(j,j) // Remove range between i and j
>Reverse(j,j) // Reverse range between i and j
>and so on. You get the picture.
>I vote for developing our own containers. We could potentially use similar 
>interface as STL.
>                                         Andy

More information about the vtk-developers mailing list