Feb
21
2013
0

Molecular Lego

I’ve been re-writing the graphical version of AMMP to use the Qt API.  Qt is a powerful, multiplatform framework for interface designs, which uses C++ and other vaguely modern ideas in software engineering.  AMMP is a virtual machine simulator for calculations about molecules, written in C but using an object-based design.

The original time I wrote a graphical interface, it was tightly bound to windows. This was good, as windows is a popular family of OS’es, and bad as the framework was not highly portable.  Windows also tends to be notionally compliant with POSIX, which means I had to reverse engineer the occasional POSIX API call or Clib call (toupper, read, tmpfile, strcmp just to name a few).

I’ve tried a few other API interface libraries – Gtk, FLTK, and motif.  There were always headaches involved in having an animated process in the background (to handle molecular dynamics or watching energy minimization).  I’d found solutions, but they were, to put it gently, fragile.  (there is a gtk/linux version on asterix, but it is not easy to compile or run).  Qt seems to fit the bill.

Screenshot of the new interface

Screenshot of the new interface

A screenshot of the new interface shows what can be done.  There is now a command editor – with a menu that suggests scripts for various common things.  The display window is under development, but the picture shows what it will look like (mostly).  It uses openGL and gives decent, robust performance on modern machines.

I spent part of today putting in the Povray output methods.  Since Povray is a scripting language it is both fun to write programs that write programs, and to play with alternative styles.  One that is sort of fun is to make the atoms smallish, while increasing the size of the bonds (0.3, 1.2 times vdw radii).

Mellitin (2mlt), lego style

Mellitin (2mlt), lego style

Sort of looks like I’ve snapped it together with lego, doesn’t it?

Written by Rob in: engineering,science |

Powered by WordPress | Aeros Theme | TheBuckmaker.com WordPress Themes