[vtkusers] vtkStringArray with heterogeneous number of components?

Tanaka Simon tanakas at gmx.ch
Tue Nov 4 16:03:04 EST 2014


Hi David,

+1 for the vtkVariantArray which is good to know.

As you suggested, i implemented a "\t" tab delimiter approach which 
works fine. however, it kind of kills the idea of using a standard to 
represent data...

thanks for your help
simon


On 04.11.2014 17:39, David Gobbi wrote:
> 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 
> <mailto: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/62945668/attachment.html>


More information about the vtkusers mailing list