25th July, 2002 Developers' Meeting - Molecular Graphics Overview

Outline

The molecular graphics program comprises two windows visible to the user, the GUI and the OpenGL window, connected by several modules.

The "main" program is a Python script which starts up both the GUI and OpenGL windows, each in a separate thread. The main program then listens for input from the two user windows and despatched instructions back to them. The main program also takes care of opening files, calling the right modules to deal with commands, etc.

Some of the program is written in Tcl, some in Python and some in C/C++. The program uses MMDB extensively and Clipper, though not yet very heavily. Communication between Python and C/C++ is achieved through various SWIG interfaces.

General Flow Control

Once the program is up and running, the user opens a coordinate or a mtz file with a GUI directory browser window. The main program then loads the file into MMDB or Clipper. Next some default actions are taken. For a coordinate file, all atoms are selected for viewing and the default colouring scheme is applied. For an mtz map, the user must specified the required columns, but the possible options are presented.

The selected atoms, colouring scheme, display parameters, etc are contained in a single object which is then passed to a module which creates a set of graphical primitives (points, lines, polygons, etc.) from this data.

The object containing primitives is then passed to the OpenGL module which then draw the picture.

User Input and Feedback

The GUI, OpenGL window, and potentially other modules/processes all generate events triggered by the user. These are all placed onto a single job queue handled by the main program. The first part of the message contains a flag which specifies what should happen to this message. Some messages are commands which need execution of a function, generation of object, etc. by the main thread. Some are messages back to the GUI to update on completion of a command. Some deal only with graphical objects and are thus sent to an interface module between the main program and OpenGL.

Main program classes

Graphics classes

Features

Recent developments


Stuart McNicholas
Last modified: Tue Jul 23 12:18:28 GMT 2002