[Chimera-users] Center on surface at mouse accelerator
Daniel P Farrell
danpf at uw.edu
Wed Aug 30 18:21:53 PDT 2017
re ctrl-click: yes I was originally using place marker (sorry not sphere)
on surface + ctrl-click + delete marker to emulate this behavior, if that
Anyways, Awesome! Thanks so much, can't wait for the nightly!
On Wed, Aug 30, 2017 at 6:10 PM, Tom Goddard <goddard at sonic.net> wrote:
> Hi Dan,
> Thanks for the code. You know ctrl-click with the right mouse button
> centers on the clicked atoms? It also centers when you click on a surface,
> but it uses the center of the entire surface instead of the point you
> clicked on. It seems like it would be more useful to center on the surface
> point you clicked on so I changed the code to do that — will be in
> tonight’s Chimera builds. I think this is better than using a keyboard
> shortcut since few people enable the keyboard shortcuts.
> > On Aug 30, 2017, at 11:44 AM, Daniel P Farrell wrote:
> > Hello,
> > I found myself constantly needing to re-center on different regions of
> EM density maps, and I was originally just dropping spheres on the surface,
> centering on those, then deleting them. Finally I got sick of that and
> wrote this. It will center the window on the surface of whatever surface
> the mouse is currently overlaying.
> > I found this to be a very helpful addition when looking at large EM
> maps, and was thinking other people might too, after using it for a while I
> feel as though it could be part of trunk since I use it so much.
> > basically it would require the addition of this to
> > ... other accelerators..
> > ('zx', 'Center view on surface where mouse is located',
> > ... zx because it's close to where you rest your hands on the keyboard...
> > def center_on_surface_at_mouse():
> > from chimera import selection, tkgui
> > hits = 
> > w = tkgui.app.graphics
> > x = w.winfo_pointerx() - w.winfo_rootx()
> > y = w.winfo_pointery() - w.winfo_rooty()
> > from Surface import surface_models
> > import VolumePath.tracer as tracer
> > hits.extend(tracer.surface_intercepts(x, y, surface_models()))
> > xyz, model = tracer.closest_hit(hits)
> > print(xyz)
> > if xyz:
> > print('cofr %f,%f,%f' % (xyz,xyz,xyz))
> > chimera.runCommand('cofr %f,%f,%f' % (xyz,xyz,xyz))
> > chimera.viewer.camera.center = xyz
> > cheers!
> > ~Dan
> > _______________________________________________
> > Chimera-users mailing list: Chimera-users at cgl.ucsf.edu
> > Manage subscription: http://plato.cgl.ucsf.edu/
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Chimera-users