Next: Suggestions for future changes/additions
Up: DispCmd
Previous: Nonvirtual member functions
Each class derived from DispCmd should have two constructors:
- A default constructor, with no arguments - this will just initialize all the internal storage to default values.
- A data constructor, which takes arguments with the data necessary for the command. This will copy the arguments into the internal data storage of the object.
If a derived class does not require any arguments (for example, the PUSH command, which just signals to push the top transformation matrix, but does not require any data itself), only the default constructor is used. Otherwise, each derived class should also provide two new functions;
- void putdata(args, Displayable *dobj) - This should copy the data specifed in args, and then call put(dobj). This is used when an instance of this class is created with a default constructor, and the instance is to be used more than once. Each time the instance it used, putdata is called to append new data to the end of dobj's display list.
- void reputdata(args, Displayable *dobj) - Same as putdata, but it should call reput after copying the given data instead of put.
Within the put and reput functions, DispCmd uses several routines in Displayable to start the action of writing a new command to the end of the display list, to copy over the data itself, and to signal the data is copied.
Justin Gullingsrud
Tue Apr 6 09:26:48 CDT 1999