[Kalzium] Qt-4-based Molecular Editor

Geoffrey Hutchison geoff at geoffhutchison.net
Sat Aug 19 23:38:05 CEST 2006


Anyone picking up this thread (which started as private e-mail) might  
be confused.

Donald Curtis and I have been hacking away at a Qt-4.2 based  
molecular editor. Obviously it shares some overlap with the Kalzium  
viewer code. This editor has been named "Avogadro" (sorry, no "K"  
name): http://sourceforge.net/projects/avogadro/

The key idea is that the best "editors" (Photoshop, GIMP, Eclipse,  
Emacs, your favorite app here) are extensible, configurable, and  
scriptable. I don't think there's anything in chemistry/biochemistry,  
open source or proprietary which comes close. So a great place for  
open source -- an app which has open APIs for editing, rendering,  
scripting... I've always wanted GIMP plugins for chemistry. ;-)

So let me try to answer a few posts in this thread:
* Benoît, I think the rendering and manipulation code is great. One  
thing about the mouse manipulation -- since we want to add "tools,"  
besides just rotate, translate, and zoom, we're planning on making an  
abstract "mouse tool" class and using QPluginLoader to let users  
switch from an edit tool to select/measure to view or other plugins.  
This also makes it easier to later add a biochem edit tool or  
crystallographic manipulation.

* Same goes for rendering. We're intending to have an abstract Render  
class which can take calls to render an OBMol, OBAtom, OBBond,  
OBResidue, whatever. (For example, some protein views don't show  
atoms or bonds.) I'm assuming that the "helper classes" improve  
framerates as well as memory use?

* The base code for a molecular editor is obviously viewing/ 
rendering, which is basically the Kalzium viewer. So there's clear  
overlap and desire for code reuse, where appropriate.

> Then, I wonder if void MainWindow::open() really has to be that
> complicated... Why not making the dialog modal?

Most editor programs allow use of multiple windows, so that you can  
see multiple molecules side-by-side or copy/paste from one to  
another. This certainly is how I'd prefer to work, and I sent out a  
number of informal surveys which reinforced this idea. A lot of the  
code was just adapted from Qt tutorials, so I don't think a SDI  
interface is that complicated. (MainWindow is 495 lines, not that long.)


In short, I think there's obviously some overlap and it's great to  
share code. I wrote the current SVN revision of Avogadro mostly from  
scratch to get me used to OpenGL and Qt programming. Certainly we  
should grab some of the Kalzium code and I hope you'll take a look at  
the rotate/translate/scale manipulation and anything else (e.g.,  
exporting graphics from the framebuffer).

I also think that the two apps have distinct goals. Which results in  
more good KDE & Qt chemistry programs! :-)

Cheers,
-Geoff


More information about the Kalzium mailing list