[vtk-developers] vtkChemistry status and python bindings

Marcus D. Hanwell marcus.hanwell at kitware.com
Wed Feb 15 11:59:31 EST 2012


On Wed, Feb 15, 2012 at 11:53 AM, David Lonie <loniedavid at gmail.com> wrote:
> On Wed, Feb 15, 2012 at 11:37 AM, David Gobbi <david.gobbi at gmail.com> wrote:
>> I modified vtkMoleculePython.cxx, vtkAtomPython.cxx, and
>> vtkBondPython.cxx by hand to see if I could make them usable...
>> the experiment succeeded.  So I know that if I modify the wrapper
>> code to prefer the copy constructor over the () constructor, then
>> these classes can be wrapped.
>>
>> First, though, I had to modify the CMakeLists.txt to remove the
>> ABSTRACT flag from the vtkAtom and vtkBond classes... Marcus,
>> was it you who added that flag for these classes?  Maybe as part
>> of an experiment to fool the wrappers?
>
> That was me -- I don't recall exactly why, but it had something to do
> with that vtkAtom and vtkBond don't inherit vtkObject. It may be
> unnecessary, though.
>
>> When I call print() on a vtkAtom object from python, it goes into
>> infinite recursion and crashes, but I think that's an unrelated issue.
>
> What method does python call when a print is requested? I can look
> into this if I can reproduce it in c++.
>
The PrintSelf function, although I take it back and am not sure why it
would go into a loop. It is debatable whether vtkMolecule should
really print every atom and bond object (rather than a simple summary
of them). We could add a Dump function similar to vtkTable to do what
PrintSelf is doing there.

Marcus



More information about the vtk-developers mailing list