////////////////////////////////////////////////////////////////
//
// graphics.h 
// Copyright (c) 2002 by Wesley H. Huang.  All rights reserved.
// 
////////////////////////////////////////////////////////////////
#ifndef GRAPHICS_H
#define GRAPHICS_H

#include <GL/glut.h>
#include <list>
#include "drawable.h"

namespace Graphics {
  void init(int *argc, char* argv[], 
	    double minX = 0.0, double maxX = 10.0, 
	    double minY = 0.0, double maxY = 10.0,
	    char* name=0, 
	    int winWidth = 750, int winHeight = 0, 
	    int winPositionX = 100, int winPositionY = 100);
  
  void runEventLoop();

  void setKeyboardHandler(void (*kb)(unsigned char key));
  void addColor(const char* name, float red, float green, float blue);

  // adds black, red, green, blue, yellow, magenta, cyan, and white
  void addBasicColors();

  // list of lists of objects that are to be drawn on the screen
  extern list< list<drawableObject*> * > objectLists;
  // false by default; true to turn on printing during display()
  extern bool verbose;
}


class Ellipse : public drawableObject {

public:
  double xc, yc;
  double orientation;
  double majorRadius;
  double aspectRatio;

  Ellipse(double X, double Y, double aspect, double majRad, double angle);

  int numPoints() const { return 1;}
  void getPoint(int i, double *x, double *y) const {
    *x = xc; *y = yc;
  }

  // angle from x axis to major axis
  double ellipseOrientation() const { return orientation;}
  // length of minor divided by major axis
  double ellipseAspectRatio() const { return aspectRatio;}
  // length of radius on major axis
  double ellipseMajorRadius() const { return majorRadius;}
};

#endif
