[vtk-developers] CMake and vtkWrapPythonInit

David Gobbi dgobbi at irus.rri.ca
Thu Dec 6 16:53:10 EST 2001


I have a niggly little request for CMake.  Currently, abstract
classes aren't included in the vtkXXPythonInit.cxx files.  It
would be nice if they were included, just for the sake of
completeness.  There is no harm in having them there, because
if a user tries to instantiate them they get the following error:
"TypeError: this is an abstract class and cannot be instantiated"

One reason for including them is for the sake of the internal
documentation features of python. For example, I often do things
like

  dir(vtkImageToImageFilter)

to get a listing of the class methods, or get class docs with

  print vtkImageToImageFilter.__doc__

rather than use the doxygen web pages.  I also know that
Prabhu's code makes extensive use of the documentation that is
built into the python wrappers.

The fix can be done by removing line 154 of Source/cmVTKWrapPythonCommand.cxx:
diff -r1.17 cmVTKWrapPythonCommand.cxx
154d153
<     if (!m_WrapClasses[classNum].IsAnAbstractClass())

 - David

--
  David Gobbi, MSc                       dgobbi at irus.rri.ca
  Advanced Imaging Research Group
  Robarts Research Institute, University of Western Ontario




More information about the vtk-developers mailing list