Next: Virtual member functions
Up: Displayable
Previous: Enumerationslists or character
- Displayable *parent - each Displayable has a parent, which
may be null. The parent is in charge of collecting children and
displaying them as a single entity with separate display lists. Operations
which are applied to the parent are also applied ot the children, such as
rotations, commands to turn the item on or off, etc. Note that the reverse
is NOT true: operations applied to children are not applied to their parent.
Thus, if you rotate a parent, all the children will rotate in the same way,
but it is possible to rotate each child separately.
- ResizeArray<Displayable *> children - the list of children for
this object. This is quite often empty. But other Displayable's have
many children, for example MoleculeList has as its children all the
Molecule objects.
- void *cmdListBeg - the start of the display list for this object
- void *cmdListPos - the location in the display list where the
next drawing command should be placed
- Scene *origScene - each Displayable must register itself
with a Scene object, and this item stores a pointer to that Scene
- ResizeArray<Scene *> sceneList - if the Displayable is
registered with more than one Scene, they are stored here
- Matrix4 tm - the current transformation matrix. This is a
public variable so it may be accessed quickly. The transformation matrix is
actually just four different matrices multiplied together; these matrices are
centm, rotm, globm, and scalem. The order of multiplication is as follows:
tm = globm * rotm * scalem * centm
When a vector is multiplied by tm, the operations these matrices represent
are:
- centm - a centering translation. When tm multiplies a vector,
this centering translation is applied first.
- scalem - scales the vector. This is done after the centering
translation, so the 'units' for the centering are in the same units as
used for the `world' coordinates.
- rotm - rotates the vector. This follows the scaling operation
(although the two may be done in either order).
- globm - a 'global' translation, which is the last operation done
to the vector. Since this is done after the scaling, the units are
in post-scaled world coordinates.
Displayable contains many routines which add to or set the values of
these matrices.
- char *name - the name of the object
- TransMethod transMethod - the method for use of the
transmforamtion matrix. At the beginning of each display list is placed
commands to either multiply the current DisplayDevice's trans matrix,
or to replace it, or to not modify it at all. This variable indicates how
this should be done. In almost all cases it should be MULT
- doCent, doRot, doGlob, doScale - flags indicating whether this
object should obey commands to modify the respective transformation
components. Routines exist to toggle them on or off
- int *displayObj, *isFixed, *Dim - flags indicating whether to
draw the object, whether to keep it fixed (so that it does not respond
to any transformation commands), and of what dimension it is (2 or 3). These
values are actually stored at the beginning of the display list, and these
pointers reference those locations
Next: Virtual member functions
Up: Displayable
Previous: Enumerationslists or character
Justin Gullingsrud
Tue Apr 6 09:26:48 CDT 1999