nextuppreviouscontents
Next:Objects in an AnimationUp:Animation ViewsPrevious: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.

Example Definition

Below is a correctly defined subclass of a View class.
class View1 : public View {
   public:
      View1() { max=min=0;};
      int Init();
      int Input(int,int);
      int ExScene(int);
   private:
      int values[250],max,min;
      Rectangle *blocks[250];
      Loc *spots[100];
};
In the public section we have created the individual animation scenes making up the animation. In the private section, we have ``global'' variables that will be manipulated in the animation scenes.

An example View animation scene might look like

int
View1::ExScene(int i)
{
   Action a("MOVE", CLOCKWISE);
   int len = blocks[i]->Program(time, &a);
   time = Animate(time, len);
   return(1);
}
Note how the function manipulates the member variable time
 


Ha Hoai Phuong

2002-11-11