[vtkusers] vtkMolecule and vtkAtom

Marcus D. Hanwell marcus.hanwell at kitware.com
Fri Sep 4 14:50:29 EDT 2015


On Fri, Sep 4, 2015 at 11:24 AM, Marcus D. Hanwell
<marcus.hanwell at kitware.com> wrote:
> On Thu, Sep 3, 2015 at 12:39 PM, David Gobbi <david.gobbi at gmail.com> wrote:
>> On Thu, Sep 3, 2015 at 9:36 AM, Marcus D. Hanwell
>> <marcus.hanwell at kitware.com> wrote:
>>>
>>> On Thu, Sep 3, 2015 at 11:22 AM, Favre  Jean <jfavre at cscs.ch> wrote:
>>> >
>>> > I have a C++ code building a molecule, Appending atoms, etc. No problem
>>> > there.
>>> >
>>> > Using Python, I cannot do the same. Why aren't the AppendAtom() methods
>>> > not
>>> > available to a vtkMolecule object? How should one build a molecule with
>>> > vtkpython?
>>>
>>> I don't think they are wrapped due to limitations in the Python
>>> wrapping, and the pattern we wanted to use for scalable storage of
>>> molecular data. I think we could get them wrapped, or add some simpler
>>> API for the Python/wrapped languages.
>>>
>>> I don't think this is something we tested, or looked at very deeply.
>>> Much of the code was developed in quite a short period as part of a
>>> Google Summer of Code project, it would be nice to extend it to better
>>> support Python.
>>
>>
>> Marcus, don't be so pessimistic about the Python wrappers.  Jean, just tell
>> cmake to wrap vtkAtom, and the AppendAtom method should work just fine.
>> Change the following lines in Common/DataModel/CMakeLists.txt:
>>
>>   set_source_files_properties(
>>     ...
>>     vtkAtom.h
>>     PROPERTIES WRAP_SPECIAL 1
>>     )
>>
>> The problem is that WRAP_EXCLUDE includes all of the classes that Java
>> and Tcl cannot wrap, and as a result, many classes are excluded from the
>> Python wrapping even though Python is perfectly capable of using them.
>> I should do a sweep through the cmake files to make the wrapping more
>> inclusive.
>>
> This worked great, I was able to run the folllowing locally in vtkpython:
>
> I pushed https://gitlab.kitware.com/mhanwell/vtk/commits/molecules-in-python
> for anyone that wants to test it out. I will try to add a test before
> making a merge request.
>
So it worked great, I added a test, made a merge request, but Java is
tripping up on the vtkAtom class now,

https://gitlab.kitware.com/vtk/vtk/merge_requests/629
https://open.cdash.org/viewBuildError.php?buildid=3993935

Merge request, and an example failure that looks like my fault. We
will have to fix that before it can be merged. This worked great in
Python 2 and 3 on Linux for me, so I was really pleased to see that.

Best,

Marcus


More information about the vtkusers mailing list