next up previous contents
Next: Molecule objects Up: Display objects Previous: Matrix4   Contents

Subsections


Scene

Files: Scene.h, Scene.C
Derived from: \bf PickList
Global instance (if any): scene
Used in optional component: Part of main VMD code

Description

The Scene maintains and organizes a database with all the Displayable objects which are to be drawn by a DisplayDevice. It contains routines to add new Displayable's to its database, and to draw them to the screen or to a file. It is derived from PickList, and so maintains the information about what diffent picking modes are available, as well routines to pick an item with a pointer.

There are two different sets of lists stored by the Scene, with each list kept for both the 2D case and the 3D case. The lists are:

This object also contains routines to apply a constant rotation to all Displayable's each time they are drawn, as well as to apply general transformations to all the items in the scene. The most important function of Scene is, however, to draw the scene to a display or to a file.

Constructors

Internal data structures

Virtual member functions

Method of use

A Scene is created at the start of the program, and all Displayable objects should be added to that scene (or to another Displayable as a child). It is used in the primary event loop to prepare and draw all the Displayable's. It is also used to pick items with a pointer. The global routine VMDupdate contains an example of using a Scene object.

There are two derived classes from Scene:

Suggestions for future changes/additions

As mentioned for Displayable, the prepare routine could be modified to return a flag indicating whether anything has changed in the Displayable objects which would require a redraw. If nothing changed, then a redraw could be avoided.


next up previous contents
Next: Molecule objects Up: Display objects Previous: Matrix4   Contents
vmd@ks.uiuc.edu