[Paraview-developers] components in vtkStringArray

David Lonie david.lonie at kitware.com
Fri Dec 16 16:26:13 EST 2016


The familiar API does seem to be missing on that class, but you can still
use multicomponent string arrays with Get/SetValue methods.

They use a 'valueIdx', which is an array-of-structs ordered index, e.g.

valueIdx = tupleIdx * numComps + compIdx

You can use these to access arbitrary elements in the array.

HTH,
Dave

On Fri, Dec 16, 2016 at 10:16 AM, Cornelis Bockemühl <
cornelis.bockemuehl at gmail.com> wrote:

> Hello all,
>
> This is about the vtkStringArray class.
>
> With vtkDoubleArray it is possible to store a set of 3d coordinates as 3
> "components" within one and the same array; no need to create 3 "parallel
> arrays" for this purpose.
>
> Trying to do the same thing with vtkStringArray I am hitting the walls!
>
> 1) It is obviously possible to call SetNumberOfComponents() on a
> vtkStringArray. Conclusion: components seem to be supported.
>
> 2) There are no functions like SetTuple3 or the like, but there is some
> SetTuple function. But the strange thing is that it allows me only to copy
> a tuple from another vtkStringArray with the same structure. Which only
> pushes the problem back to that second array...
>
> The problem being: How can I set and read the components in a
> vtkStringArray - either one by one or as a tuple?
>
> Looks like I missed something basic here...
>
> Regards and thanks for helpful hints!
> Cornelis
>
> --
> Cornelis Bockemühl
> Basel, Schweiz
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/
> opensource/opensource.html
>
> Search the list archives at: http://markmail.org/search/?q=
> Paraview-developers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/paraview-developers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview-developers/attachments/20161216/a9259d85/attachment.html>


More information about the Paraview-developers mailing list