[vtkusers] PrintSelf?
Prabhu Ramachandran
prabhu at aero.iitm.ernet.in
Thu Aug 31 14:44:38 EDT 2000
hi,
Do all vtk classes attempt to print all of their class
information via PrintSelf? Is it a bug if some of them do not print
all the relevant info?
While developing the pipeline browser I first used the dir
method in python to obtain the methods of the class. But
unfortunately this did not reveal inherited methods. I then looked at
the vtk 2.0 book and found that the PrintSelf command was supposed to
print all information. Consequently, I changed the configurator to
parse the printed info. Now parsing the printed info is rather easy
with python. Besides thanks to the great consistency of the way the
vtk code is written it was fairly easy. The only major problems were
ones that I reported here on the Swapbuffers in vtk\w*RenderWindow and
the Two-sided Lighting in vtk\w*Renderer and the seg faults when a few
of their methods were called. The advantage of parsing the output of
PrintSelf is obvious - some kind of object persistence can be achieved
with this, relatively easily.
However, I later realised that there were some methods that
never showed up, some of these methods could be obtained thru the dir
command. I then used a combination of dir and repr(vtk_obj). So as
far as the python bindings go I have tried my best to get what ever
methods I could. For instance take the vtkScalarBarActor. The
Get/SetHeight and Width functions are not printed out. I have no idea
of what other classes have similar problems.
So would it be possible for someone to check if the various
PrintSelf functions are actually doing their jobs. Some people may
think that the PrintSelf function is not that useful. Now they know
otherwise. :)
thanks,
prabhu
More information about the vtkusers
mailing list