next up previous contents
Next: Suggestions for future changes/additions Up: Displayable Previous: Virtual member functions

Method of use

A Displayable must either be registered with a parent (i.e. be a child of some parent), or it must be registered with a Scene (in which case it cannot be the child of any other Displayable). To create a new class derived from Displayable, you need to provide two constructors, one taking a Scene pointer, one a Displayable pointer.

Once created, then in the derived-class-provided prepare routine, the display list of for the Displayable must be set up. If this display list will never change during the program, it can be done just once in the constructor and no prepare is necessary. The display list is created by using DispCmd objects.

The display list for each Displayble must be given to a Scene, regardless of whether it is child or parent or both. It is these display lists which are given to the DisplayDevice to be rendered. The Scene keeps a list of registered Displayable's as well so that it can prepare them for drawing. When a parent is prepared for drawing, it also prepares all its children, so only top-level parents need to be registered with the Scene.

Since this class is derived from Pickable and ColorUser, there are several virtual functions which may need to be supplied in order for the derived Displayable to be picked by the pointers, or to have access to the color database. See the descriptions of these objects for more info.

One note about the display lists: the reason they are done in the current scheme is that the CAVE requires the use of shared memory to hold the information for the rendering processes to draw, while a separate update process keeps track of updating the information in shared memory. Since the shared memory cannot have pointers to non-shared memory locations, the display lists are designed to ONLY hold integer and floating-point data. When drawing in the CAVE, a special CaveScene supplies shared memory blocks for the Displayable's to use for their display lists.


next up previous contents
Next: Suggestions for future changes/additions Up: Displayable Previous: Virtual member functions

Justin Gullingsrud
Tue Apr 6 09:26:48 CDT 1999