/**********************************************************************
   File:     CGWorld.h
   Author:   Dr. Dalton R. Hunkins    
   Date:     February 2009     
**********************************************************************/

#ifndef _CGWORLD_H
#define _CGWORLD_H

#include 
#include 
#include 

class CGWorld { 
  public:

    CGWorld();
  
    void createSubWindow(int parentHandle,
                    int parentWidth, int parentHeight,
                    int startX,      int startY,
                    int width,        int height);

   void init(float clearColor[]); 
   
   void display();
   
   void setAlpha(float value);
   
   int getWindowHandle();
   
   int getCornerX();
   int getCornerY();
   int getWidth();
   int getHeight();
   
private:
    static const int numberOfSquares = 18;
    static const float sizeOfSquare  = 0.2;
        
    int windowHandle;
    int cornerX;
    int cornerY;
    int width;
    int height;
    
    float lightColor[3];
    float geometryColor[4];
    HSV hsvSquare[3];
	
    Coordinates coordinates[8];
    
    void setLighting();
    
    void xzSquare(int which);
    void xzRow(int first, int second);
    
    void drawBoard();
    void drawSurfaceOfRevolution();
    void getPointOnCurve(double U, double pointOnCurve[3]);
    int  combinations(int n, int i);    
};
#endif