[vtkusers] vtkStringArray with heterogeneous number of components?

David Gobbi david.gobbi at gmail.com
Tue Nov 4 11:39:21 EST 2014


Hi Simon,

You can do this with a vtkVariantArray, because a vtkVariantArray is
an array of "anything" so it allows you to store a vtkStringArray for
each of your points. It wouldn't be very efficient, however.

My recommendation would be to just use a vtkStringArray and then
use some kind of string delimiter like ";" or ",", for example if the string
is "one;two" you would write your own code to interpret that as multiple
values.

 - David


On Tue, Nov 4, 2014 at 9:12 AM, Tanaka Simon <tanakas at gmx.ch> wrote:

> Dear VTK users,
>
> I want to have a vtkStringArray, but the number of components shall NOT be
> the same for all points.
>
> Example (a sample code is attached):
> -> for point 1, the string attribute should be "one"
> -> for point2, the string attributes should be "one" and "two"
> -> etc.
>
> That is like std::vector< std::vector<...> > where the inner vectors may
> have different length.
>
>
> What would be the approach:
> -> heterogeneous number of components?
> -> heterogeneous number of tuples?
> -> not vtkStringArray, but some other vtkXXXArray containing another
> container with variable length?
>
>
> Thanks for any suggestions
> Simon
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20141104/40b07473/attachment.html>


More information about the vtkusers mailing list