[vtk-developers] vtkTable related problem
John Biddiscombe
biddisco at cscs.ch
Fri Nov 7 14:44:42 EST 2008
I'm guessing Tim or Brian is most likely to know the answer to this...
I'm making use of vtkDelimitedTextReader to load a bunch of ascii data
into a table.
On some occasions, rows of data have fewer/missing entries, so
vtkVariant values are generated and inserted into the table during the
read process which are 'invalid'. As the data is being read, I can track
the valid flag and see that it is preserved as '0'.
When I get the output of the filter as a table object and fetch the
rows, one by one, I iterate over the values and I find that the values
are always valid. even when the rows were half empty in the ascii file.
I was hoping to check the 'valid' state so that I could skip certain
values and do something special with these rows, but instead, I see a
vtkStringArray being created for each column - as I query the row data,
the string array returns empty strings with the valid flag set to true
for the empty cells.
In short, I can test strings to see if they are empty, but I was hoping
I could test the valid flag and tell the difference between an empty
string and an actually absent value.
Can this be done? It seems like the class is protecting itself by
replacing invalid data, but at the expense of some potentially useful
information
specifically
vtkVariantArray *row = table->GetRow(i);
vtkVariant entry = row->GetValue(n);
entry.isValid() is always true - even when it didn't exist.
Is there another way of getting gthe row/column without the null string
creation?
thanks
JB
--
John Biddiscombe, email:biddisco @ cscs.ch
http://www.cscs.ch/
CSCS, Swiss National Supercomputing Centre | Tel: +41 (91) 610.82.07
Via Cantonale, 6928 Manno, Switzerland | Fax: +41 (91) 610.82.82
More information about the vtk-developers
mailing list