[vtk-developers] vtkChemistry status and python bindings

David Lonie loniedavid at gmail.com
Tue Feb 14 18:02:48 EST 2012


Hi Stefano,

I've cc'd the developer's list on this. My reply is inline below.

On Tue, Feb 14, 2012 at 5:53 PM, Borini, Stefano
<s.borini at jacobs-university.de> wrote:
> I did some experiment and finally got a working runtime.
> I found one thing that I think it's worth communicating to you. I am trying to solve it myself, but it's not of immediate solution (at least at 23.44). I am working with your branch 98267882d5

The vtkChemistry code was just merged into the master branch a little
while ago, with the exception of the electronic structure rendering
classes. There were several bugfixes that have gone in as well, so
it's probably worthwhile to switch back to the main vtk source tree at
this point.

If you switch, be aware that the vtkMolecule::AddAtom methods are now
named vtkMolecule::AppendAtom because, well, Microsoft's compilers are
weird.

> The vtkMolecule in python does not have and AddAtom method. It does have other methods, though.
> I checked out how the python bindings are created, and apparently the extraction is automated with code in Wrapping/Python. There's a document in there, README_WRAP.txt , stating
>
> Unavailable methods
>
> A method is not wrapped if
> 1) its parameter list contains a pointer that isn't a vtkObject
>   pointer, char pointer, or void pointer -- though the vtkDataArray
>   "Tuple" methods are an exception, they are wrapped
> 2) it returns a pointer that is not a vtkObject pointer, char pointer,
>   or void pointer, unless the method has an entry in the wrapping
>   hints file -- again, vtkDataArray methods are an exception
> 3) its parameter list contains a named enum constant
> 4) it is an operator method (though many exceptions exist)
>
>
> Unavailable classes
>
> Some classes are meant to be used only by other VTK classes and are
> not wrapped.  These are labelled as WRAP_EXCLUDE in the CMakeLists.txt
> files.
>
> It is my opinion that something is going wrong with the AddAtom method, so that it is skipped by the wrapper generator. I also observed that the class vtkAtom is not available at the python level. The vtkAtomPython.cxx is basically empty.

This makes sense, the vtkAtom classes do not inherit vtkObject. Thanks
for pointing this out!

Marcus -- could we add a special case to the wrapping code, or is
there another way to correct this?

Dave



More information about the vtk-developers mailing list