From: John Stone (johns_at_ks.uiuc.edu)
Date: Thu Oct 30 2003 - 10:42:15 CST

Lars,
  Interesting. From what you describe, it sounds like VMD and VTK
may be fighting over the active OpenGL context when you run VTK inside
of VMD. Do you get any interesting graphics corruption in the VTK window
when this occurs? In any case, I'm almost certain that its an issue
with VTK and VMD fighting over control of OpenGL. If you want to try
a test of this theory, I could send you a hacked version of VMD that
manages OpenGL slightly differently to see if it has any effect on things.

Thanks,
  John Stone
  vmd_at_ks.uiuc.edu

On Thu, Oct 30, 2003 at 03:21:43PM +0100, Lars Bruno Hansen wrote:
>
> dear VMD users,
>
> I have a question about running VMD and VTK (Visual Tool Kit) together,
> using VMD's python interpreter. VTK can be called directly from python.
>
> I have a set of localized orbitals, and have a representation of these
> as spheres, which I can visualize in VMD, possible together with the
> molecule itself.
> I would then like to pick an orbital in VMD and have this orbital
> shown as a 3D plot in VTK. The VTK graphics runs in a Tk window.
>
> The VTK window opens fine from within the VMD python interpreter,
> you can rotate the view in the VTK window and you still have the
> the VMD python window active, also the VMD Main menu works fine,
> however VMD's openGl window is not redrawn.
> Trying to close the VTK window and delete the VTK objects from
> the python session does not help, also the VMD command 'reset view',
> does not restore control to VMD's openGL window.
>
> I do not know if one in general can have these two graphics loop
> running together in the same process, or if you will have to
> start VMD and VTK as independent processes and then communicate
> via a pipe or similar?
>
> Any help on this is greatly appreciated.
>
> I am running vmd 1.8.1 openGL version on linux redhat 9.0.
>
> with best regards
> Lars
>
> --
> Lars Bruno Hansen,
> CAMP, Dept. of Physics, Building 307, DTU, DK-2800 Lyngby, Denmark
> Phone: +45 45 25 32 16 Fax: +45 45 93 23 99
> E-mail: lhansen_at_fysik.dtu.dk
>

-- 
NIH Resource for Macromolecular Modeling and Bioinformatics
Beckman Institute for Advanced Science and Technology
University of Illinois, 405 N. Mathews Ave, Urbana, IL 61801
Email: johns_at_ks.uiuc.edu                 Phone: 217-244-3349              
  WWW: http://www.ks.uiuc.edu/~johns/      Fax: 217-244-6078