next up previous contents
Next: External library descriptions Up: Program Structure Previous: Tracker objects   Contents


Main VMD execution loop

After the program starts up and initializes all global objects as well as processing any startup data files, an execution loop is entered which continues until the user requests to quit VMD. This loop is mainly contained in the routine VMDupdate (in the file Global.C), which is called continuously by the main routine of VMD. The algorithm for this loop is:

  1. The VMDupdate routine requests each UIObject to check for any events such as mouse button presses or GUI button/slider/browser/whatever presses. These events are entered into the CommandQueue objects queue as Command object instances.
  2. All commands in the CommandQueue are processed until the queue is empty. Typically, the processing of an event will result in one or more new Command object being created and placed at the end of the CommandQueue. The CommandQueue will just continue processing each command until the queue is complete empty, which will deal with all the events found in the previous step, as well as any other commands generated while processing the events.
  3. Each UIObject is told to do any update that needs to be done each cycle through the execution loop. This accomplishes such things as updating the current frame in the form used for molecule trajectory animation.
  4. The current Scene is rendered to the current DisplayDevice.


next up previous contents
Next: External library descriptions Up: Program Structure Previous: Tracker objects   Contents
vmd@ks.uiuc.edu