nextuppreviouscontents
Next:Individual SubclassesUp:Objects in an AnimationPrevious:Entry PointsContents




This section is a copy of [1] , which is available at:
http://www.cc.gatech.edu/gvu/softviz/parviz/polkastuff/polkadoc-lite.ps.
The POLKA document is copyrighted by John T. Stasko, College of Computing, Georgia Institute of Technology, Atlanta, GA 30332-0280, and is available for noncommercial use.

AnimObjects

An AnimObject is a type of graphical object that's visible in an animation window. By manipulating these objects, changing their positions, sizes, colors, visibilities, etc. a programmer builds an animation. Actually, AnimObject is the super class of all the different object types, so an AnimObject itself is never created, only the individual subclasses. AnimObject provides a few important methods which are used for all the different derived types, plus it provides a number of virtual functions which must be written for each specific subclass. Below is the class definition AnimObject.
class AnimObject {
   public:
      AnimObject(const AnimObject&);
      void Originate(int);
      void Delete(int);
      int Program(int, Action*);
      virtual Loc *Where(PART);
};
All AnimObjects (except the special Set object) have four fields in common: an associated View, their visibility, and x and y locations. These are the four parameters to the AnimObject constructor. Each subclass constructor must call this superclass constructor. All AnimObjects have their own ``copy'' constructors and destructors too. Note that when an AnimObject is constructed, it does not appear in an animation View automatically. The user must call the Originate routine to have the AnimObject appear. The parameter to Originate will specify at which animation frame number the object will appear. To remove an AnimObject from a View permanently, call the Delete routine and specify at which frame it should be removed. It is also possible to change the appearance of an object, from say a Line to a Rectangle, with the Change function. All AnimObjects are programmed to perform an Action (see below) through the superclass function Program. Objects retain their programming across Change calls. The Where operation returns the current location of a part of the object.

AnimObjects are designed (actually ``will eventually be designed'') to be user-extensible. That is, an animation designer should be able to add her/his own new subclass. For convenience, we provide a large collection of subclasses types. Each constructor allocates a graphical image and returns a handle to it.


nextuppreviouscontents
Next:Individual SubclassesUp:Objects in an AnimationPrevious:Entry PointsContents
Ha Hoai Phuong

2002-11-11