[chimera-dev] S3D extension

Tom Goddard goddard at sonic.net
Thu Mar 20 16:33:58 PDT 2014


Hi Matt,

  Yes, unfortunately Chimera dialogs often do not track changes to the underlying parameters they are displaying.  So if you want to directly control the Camera dialog settings for screen width, here is the Python code to get the ViewerDialog (which holds the Camera pane, Effects pane, Side View pane, …).

>>> from chimera import dialogs
>>> from chimera.viewing import ViewerDialog
>>> d = dialogs.find(ViewerDialog.name)
<chimera.viewing.ViewerDialog object at 0x10d6ebfd0>
>>> d.screenWidth.get()
35.55118110236221
>>> d.screenWidth.set(45)

  The Tangent Wave looks fun.  In getting work done with Chimera we don't venture beyond keyboard, mouse/trackpad input controls.  But I can see how a specialized task like making videos can benefit from the extra dedicated knobs, trackballs and buttons.  Unfortunately since any input device beyond keyboard, mouse, trackpad is rare, the more exotic devices don't get much support from software developers like us.  That leaves you with the tricky task of trying to hook it up to work with our software.  Sorry about that.

	Tom



On Mar 20, 2014, at 4:15 PM, "Dougherty, Matthew T" wrote:

> Hi Tom,
> 
> I tried ScreenMMWidth last night but it produces anomalous results.
> When I get the value using ScreenMMWidth it matches the gui screen size value.
> 
> When I set the value using getScreenMMWidth, the gui value does not change, but distance to screen gui value changes.
> Afterwards I get the value for screen width, which matches what I set, but does not match the gui value.
> 
> using the hack similar to what you mentioned, I can set the value in the gui correctly.
> But I could not figure out how to get the viewer1 dialog handle.
> That is, I can create a second viewer and do the hack.
> 
> Being able to modify gui values directly as though I used a mouse or keyboard, as a developer outside the chimera tent, this would be preferred.  Conceptually this is easier than learning/fishing for the intricacies of gui callbacks and related functions.  There is going to be latency, but frequently this is not a problem.
> 
> =====
> On a related note, I bought one of these for evaluation:
> http://www.tangentwave.co.uk/products_wave.asp
> 
> I think this maybe the one-stop HID I have been looking for to handle coordinate xforms, volume rendering, S3D, and misc project management issues. <$1500. 
> it can also double duty on a variety of other apps, particularly color and video editing for linux, mac, windows.
> 
> Besides the method of keyboard accelerators (which I may not need), I will be able to directly interact with it through sockets, so I will need some help devising a strategy to manage these realtime events within chimera, registering callbacks for socket events.  With this device I will have three trackballs so using the hack you mention would not be good because of latency.  I should get it next week.  If it looks promising and could be fielded in the lab, I could get another one and send it to CGL for evaluation.
> 
> 
> Matthew Dougherty
> National Center for Macromolecular Imaging
> Baylor College of Medicine
> ________________________________________
> From: Tom Goddard [goddard at sonic.net]
> Sent: Thursday, March 20, 2014 5:42 PM
> To: Dougherty, Matthew T
> Cc: chimera-dev at cgl.ucsf.edu
> Subject: Re: [chimera-dev] S3D extension
> 
> Hi Matt,
> 
>        from chimera import tkgui
>        tkgui.setScreenMMWidth(w)
>        w = tkgui.getScreenMMWidth()
> 
> Here MM stands for millimeters.
> 
> In general you don't want your Python code to find graphical user interface controls (entry fields, sliders, …) and modify their values.  Instead you modify the parameter values and the graphical user interface should detect the change and update themselves.  The case of the Icosahedron tool is just a hack where only the graphical user has access to the radius parameter.
> 
>        Tom
> 
> 
> On Mar 19, 2014, at 11:13 PM, "Dougherty, Matthew T"  wrote:
> 
>> Now that I am working on a similar problem it may have a similar solution to the previous email.
>> 
>> Specifically I am trying to add an extension to control eye seperation in animations.
>> 
>> using the icosahedron extension as a reference, I figure I need to make a similar gui call in def set_s3d(es), and change the gui to the camera tab.
>> 
>> # -----------------------------------------------------------------------------
>> #
>> def change_s3d(start, last, step):
>>   range = (start, last, step)
>>   import Transition
>>   Transition.show_transition(set_s3d, range)
>> 
>> # -----------------------------------------------------------------------------
>> #
>> def set_s3d(es):
>>   import Transition
>>   Transition.show_label('eye separation', 'r = %.0f' % es)
>>   import Icosahedron.gui
>>   d = Icosahedron.gui.icosahedron_dialog()
>>   if d:
>>       d.radius.set_value(es)
>> 
>> # -----------------------------------------------------------------------------
>> #
>> import Transition
>> arg_specs = (('es1', float),
>>                   ('es2', float),
>>                   ('frames', int))
>> 
>> add_transition_command('s3d',
>>                                    change_s3d,
>>                                    arg_specs,
>>                                    None, None)
>> 
>> # -----------------------------------------------------------------------------
>> # -----------------------------------------------------------------------------
>> 
>> 
>> 
>> 
>> 
>> 
>> Matthew Dougherty
>> National Center for Macromolecular Imaging
>> Baylor College of Medicine
>> ________________________________________
>> From: Dougherty, Matthew T
>> Sent: Thursday, March 20, 2014 12:20 AM
>> To: chimera-dev at cgl.ucsf.edu
>> Subject: screen width
>> 
>> I would like to set and get the parameter screen width.  can you advise on the proper way?
>> 
>> thx
>> 
>> 
>> Matthew Dougherty
>> National Center for Macromolecular Imaging
>> Baylor College of Medicine
>> 
>> _______________________________________________
>> Chimera-dev mailing list
>> Chimera-dev at cgl.ucsf.edu
>> http://www.rbvi.ucsf.edu/mailman/listinfo/chimera-dev
>> 
> 
> 





More information about the Chimera-dev mailing list