Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

Displayable.C File Reference

Base class for all objects which are drawn in the DisplayDevice. More...

#include <string.h>
#include "Displayable.h"
#include "DispCmds.h"
#include "PickList.h"
#include "utilities.h"
#include "VMDApp.h"
#include "DisplayDevice.h"

Go to the source code of this file.


Detailed Description

Base class for all objects which are drawn in the DisplayDevice.

Each Displayable is also a linked list of other Displayables, which act as 'children' to the parent, i.e. they get the parent's tranformation as well as their own.

Notes about how displayables work --------------------------------- 1. Each Displayable contains an array of drawing/display commands. This array actually has some character-sized flags at the beginning, and then a sequential list of commands. The format for the cmdList is: Integer: On (T) or Off (F) Integer: Fixed (T) or Free (F) Push Matrix command Multiply Matrix (with this objs trans matrix) command ... all commands for this object Pop Matrix command

2. Each command has the form (as set up in DispCmds.h): command code (integer) data for command (0 or more bytes)

3. A Displayable 'registers' with one or more Scene objects; this means it gives the display command list pointer to the Scene, which then uses that to draw the object. Before drawing, the Scene calls the 'prepare' routine for each Displayable. When deleted, the Displayable 'unregisters' with all Scene objs it has previously registered with. If a Scene is deleted, it unregisters the Displayables in it's possession.

4. A Displayable is either a 'parent' one or a 'child' one. The difference is that parent Displayables register with the scene, and have only one transformation; children do NOT register with the scene, and have not only their main transformation (which is the same as the parent) but also a second one which multiplies the first. Note that children can have children of their own, but are not 'parents', i.e. child Displayables do not register with a scene even if they have children of their own.

5. Children do register their DISPLAY LISTS, just not themselves (thus, they are not prepared, etc.; just rendered.)

6. Children are created as normal, but with the parent Displayable specified instead of the Scene. As part of the creation, the child will be added to the parent's list via the 'add child' routine.

Definition in file Displayable.C.


Generated on Sat Apr 20 02:44:08 2024 for VMD (current) by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002