[vtk-developers] Bug in vtkDataReader.cxx

Prabhu Ramachandran prabhu at aero.iitm.ernet.in
Wed Apr 11 01:47:11 EDT 2001


hi,

While reading data if you use any of the DataReaders and then do
something like 

reader.GetScalarsNameInFile(1)

the name returned is case insensitive.  So if you do something like
this

name = reader.GetScalarsNameInFile(1)
reader.SetScalarsNameInFile(name)

It wont work.  This is because a this->LowerCase(line) is used at the
start of the CheckFor function.  

The fix for this can be made by making the following changes.

Change the LowerCase(char *str) function to take a default argument of
the max length we want to convert to LowerCase.  The default value
will be 256 characters.  So none of the existing code will change.
And then change the CheckFor code to change only the first
strnlen(name) chars to lowercase.  This will fix this particular bug.
Can I go ahead and add this code to the CVS tree?  Or does someone
else want to do this?

I also found that if you have all the scalar point_data in a single
line then if one does a GetNumberOfScalarsInFile() then it hits an
infinite loop.  So my question is it illegal to put all the data
attributes in one single line (without an 'endl')?

I think this happens because there is some kind of assumption that the
line is no longer than 256 chars (in ReadLine).  Am I correct?

thanks,
prabhu




More information about the vtk-developers mailing list