[vtk-developers] Proposed changes to vtkSetGet.h and vtkDataR eader.{h,cxx}
Prabhu Ramachandran
prabhu at aero.iitm.ernet.in
Wed Apr 11 10:32:20 EDT 2001
hi,
>>>>> "WEL" == "William E. Lorensen" <lorensen at crd.ge.com> writes:
WEL> Please add or modify a new test that exercises the code you
WEL> are fixing, Bill
Okay, this is going to be a long and boring thread for all of you
experts. :(
I looked at the regression testing for the first time. Problem
is I dont know much Tcl so I really cant understand complex Tcl
scripts. So I cant claim to understand what the
rtImage{Other}Image{Other}Examples.tcl scripts _exactly_ do. I have
a general idea though.
(a) As I understand it they run all the code in all the
examplesTcl dirs except for the files defined in noTest. Is this
correct?
(b) As far as the vtkSetGet.h changes go I can easily modify
imaging/ScalarBar.tcl to demonstrate the current problem. It is
just a single line of code.
# Test the Get/Set Position
eval scalarBar SetPosition [scalarBar GetPosition]
Will this do? I know that it works, so can I commit it?
(c) For the DataReader changes a test will require any VTK
data file which uses some uppercase letters to name the data
attributes. None of the data that I have has this (including the
data in the vtk2.0 CD). So I dont know what to do. I dont have
the entire data directory either so I really cant help here. If
you want I can send in the datafile that actually triggered
the problem. I took it from the VisuSimple examples. I could
also write a small bit of code that will test this. Infact I can
send in a small data file that shows the error also (this is
attached at the bottom of this mail).
Hmmm. While testing I actually found another bug. Consider the
following code.
from vtkpython import *
r = vtkStructuredPointsReader ()
r.SetFileName ("t.vtk")
print r.GetScalarsNameInFile (0)
This should print '<TEst12~!@#$%^&*()_+|-=\/,.\b\n\t>' but it prints
None. This is because this->CharacterizeFile() has to be called
before anything else so I am going to add this too.
Since I am new to this regression testing, and I dont have the
baseline and vtkdata stuff, maybe I can send the regression test code
and data for this part to someone so that they can commit it?
Enclosed are a simple test data file and a smaller test python script.
thanks,
prabhu
--------------- t.vtk data file follows ---------------
# vtk DataFile Version 2.0
Test data for parsing
ASCII
DATASET STRUCTURED_POINTS
DIMENSIONS 1 1 1
ORIGIN 0.0 0.0 0.0
SPACING 1.0 1.0 1.0
POINT_DATA 1
SCALARS <TEst12~!@#$%^&*()_+|-=\/,.\b\n\t> float
LOOKUP_TABLE default
100
----------------- end of data ---------------------------
# t.py to test the DataReader parsing
from vtkpython import *
r = vtkStructuredPointsReader ()
r.SetFileName ("t.vtk")
print r.GetScalarsNameInFile (0)
r.SetScalarsName (r.GetScalarsNameInFile (0))
r.Update ()
print r.GetOutput ().GetScalarRange ()
expected output:
<TEst12~!@#$%^&*()_+|-=\/,.>
(100.0, 100.0)
More information about the vtk-developers
mailing list