nextuppreviouscontents
Next:Entry pointsUp:POLKA Animation Designer's PackagePrevious:POLKA Animation Designer's PackageContents




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.

Animator level

At the top level is the Animator class. Each program or algorithm animation should have one corresponding Animator object (actually a subclass of Animator will be created). The Animator receives the animation events from the program being viewed. It stores the event name and parameters in protected variables, and then calls a Controller virtual function. What you need to do is to derive a subclass of Animator and design your own controller function. The controller function needs to check what event just occurred and then call the appropriate animation view scenes.

Here is the Animator class:

const int MAXPARAMS = 16;

class Animator {
  protected:
    char    AlgoEvtName[32];
    int     AnimInts[MAXPARAMS];
    double  AnimDoubles[MAXPARAMS];
    char   *AnimStrings[MAXPARAMS];
    virtual int Controller() = 0;
  public:
    Animator();
    void RegisterAlgoEvtconst (char *,const  char *);
    int SendAlgoEvt(const char * ...);
    void RegisterView(View *);
    void RemoveView(View *);
    int Animate(int, int);
};



Subsections

Ha Hoai Phuong

2002-11-11