//
// 3-D gear wheels.  This program is in the public domain.
//
//
// Original: Brian Paul
// Conversion to GLUT by Mark J. Kilgard 
//

// Modified for use in cs4731 by Mark R. Stevens (February 12, 2000)
// contact: stevensm@cs.wpi.edu with comments / concerns

#ifndef GEARS
#define GEARS

// the base class
#include "cs4731app.h"

// The main class definition
class gears : public cs4731app {

 public:

  // initialize
  virtual void init(minigl &mgl, miniglut &mglut);

  // draws a all of the gears
  virtual void draw(minigl &mgl, miniglut &mglut);

  // change the window size 
  virtual void reshape(minigl &mgl, miniglut &mglut, int width, int height);

  // outputs the usage to the screen to show what the keys do
  virtual void usage();

  // receive keyboard events
  virtual void key    (minigl &mgl, miniglut &mglut, unsigned char k, int x, int y);

  // receive mouse events
  virtual void mouse (minigl &mgl, miniglut &mglut, int button, int state, int x, int y);

  // receive special keyboard events (arrow keys, etc.)
  virtual void special(minigl &mgl, miniglut &mglut, int k, int x, int y);

 protected:

  // draws a single gear
  void drawSingleGear(minigl &mgl,
		      float inner_radius, 
		      float outer_radius, 
		      float width, 
		      int   teeth, 
		      float tooth_depth);    
 private:
  
  // the angle of rotation for the different gears.
  float angle;

  // rotate the view
  float view_rotx;
  float view_roty;
  float view_rotz;   

};

#endif
