[vtkusers] what about a vtkStringArray format ?

Sebastien MARAUX maraux at ondim.fr
Mon Feb 24 10:53:03 EST 2003


thanks for your answer.

why is there a default number of tuples=3 in the constructor ?

if vtkDataSetAttributes is not recompiled, is it possible
to use vtkStringArray if I take care not using copyTuple
on strings (only setting, retrieving and deleting it as i-th
attribute of cells, points or field data ) or is it mandatory ?

Would you have some precompiled dll for win32 with
vtkDataSetAttributes modification ?

Will this modification be included in VTK nightly ?
why isn't it included in vtk nightly, even for testing
purposes, as people could be warned of the beta state.

thank you for the code and tips.

regards

Sebastien MARAUX

----- Original Message -----
From: "David Duke" <D.Duke at bath.ac.uk>
To: "Sebastien MARAUX" <maraux at ondim.fr>
Cc: <vtkusers at public.kitware.com>
Sent: Monday, February 24, 2003 4:05 PM
Subject: Re: [vtkusers] what about a vtkStringArray format ?


>
> Sebastien MARAUX wrote:
> > I think a vtkStringArray would be very useful,
> > Is there somebody here who made such a format ?
> >
> > vtkCharArray is not really easy to use with string assigned as a scalar
> > (e.g. naming each cell of a polydata).
> >
> > It would be very convenient to use a vtkStringArray as any
> > vtkDataArray for setting scalars.
>
> Sebastian,
>
> I've also wanted general arrays of strings.  I put together one approach
> as part of some information visualization work; see
> www.cs.bath.ac.uk/~djd/vtk.html (there is a tar archive with the classes
> linked near the bottom).  The implementation isn't tidy, though; at the
> time I found I had to replace the vtk{Point|Cell}Data classes using an
> object factory, so that the CopyTuple function dealt correctly with the
> strings.  See the documentation.
>
> More recently I defined a vtkObjectArray class as a subtype of
> vtkVoidArray.  This holds pointers to vtkObjectBase objects, i.e.
> reference-counted objects.  My own reasons for building this are to
> support multi-valued attributes in a more general data model, e.g.
> support a data array in which each 'value' can be a vector of values.
> But if you define a new subtype of vtkObjectBase to hold a string, you
> could use a vtkObjectArray to store instances of your new type.
> Functions such as SetValue do the right thing with references to
> objects, but if you manipulate the array through the pointer, you would
> have trouble.
>
> You can find the current code for vtkObjectArray from
>
> www.cs.bath.ac.uk/~djd/software/vtkObjectArray.tar
>
> Its part of work in progress and has had minimal testing, lacks full
> comments, and I may again have missed a more obvious solution.
>
> If anyone has a better or simpler way of supporting strings, I too would
> be interested.
>
> David
>
>




More information about the vtkusers mailing list