[vtkusers] what about a vtkStringArray format ?

David Duke D.Duke at bath.ac.uk
Mon Feb 24 11:33:35 EST 2003


Sebastien,

Sebastien MARAUX wrote:
> thanks for your answer.

(I'll Cc this reply to the list; if you want to go into low-level 
details it may be better to continue off-list).

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

Probably a mistake, a left-over from when I extended vtkVoidArray.  As I 
said, work in progress ....  Off-hand, I'm not sure that the TupleSize 
is used in the subclass; when allocating array-space I essentially 
hard-wired in an assumption that the tuple size was 1.  This makes sense 
for the string/object arrays.  One of the issues in extending VTK in 
this way is that sometimes the inherited mechanisms (such as the ability 
to have multi-component arrays) are more general than you really want.

> 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 ?

If I remember correctly, I needed to modify CopyTuple so that the 
CopyData operation on Point, Cell and Field data would do the right 
thing with the strings.  I had to override CopyTuple, as it uses a 
switch statement and I needed to add a case for strings.  There are 
other functions in vtkDataSetAttributes that switch on the kind of data 
in the array (for example CopyAllocate), if you use any of those you 
would also have to override their implementation.  But if not, I believe 
you could manage without recompiling DataSetAttributes, although I don't 
have time at present to go through the code to confirm or test it!

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

Not to hand.  I stopped using the approach I described when I felt it 
was too complicated.  Thus the work on vtkObjectArray etc.  If you 
really need the DLLs I could regenerate them, but it would take some 
time (they were also done on an earlier release).

> 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.

The VTK repository is for code that is (a) well developed, (b) found to 
be generally useful to the VTK community, and (c) adheres to the VTK 
coding standards.  At the moment neither of the things I pointed you to 
satisfy these :-/.  In time I'll meet (a) and (c) --- (b) might then follow.

regards,
David





More information about the vtkusers mailing list