class C_Color { public: float r; float g; float b; C_Color() {} C_Color(float r0,float g0,float b0) {r=r0;g=g0;b=b0;} ~C_Color() {} void set(void) {glColor3f(r, g, b);} }; class C_Point { public: float x; float y; float t; C_Color color; C_Point() {t=1.;} C_Point(float x0,float y0) {x=x0;y=y0;t=1.;} C_Point(float x0,float y0,C_Color col) {x=x0;y=y0;t=1.;color=col;} ~C_Point() {} void draw(); }; typedef C_Point C_Vector; class C_Line { public: C_Point p,q; C_Color color; C_Line() {} C_Line(C_Point p0,C_Point q0,C_Color col) {p=p0;q=q0;color=col;} C_Line(float x1,float y1,float x2,float y2,C_Color col); ~C_Line() {} void draw(); }; class C_Polyline { public: C_Point *p; int numberPoints; C_Color color; C_Polyline() {numberPoints=0;} C_Polyline(C_Point *p0,int numberPoints0); C_Polyline(C_Point *p0,int numberPoints0,C_Color color0); C_Polyline(C_Polyline &pl); ~C_Polyline(); void setColor(C_Color color0) {color=color0;} C_Polyline operator =(const C_Polyline &pl); void draw(); }; class C_Polygon { public: C_Point *p; int numberPoints; C_Color color; C_Color *colorarray; C_Polygon() {numberPoints=0;colorarray=NULL;} C_Polygon(C_Point *p0,int numberPoints0); C_Polygon(C_Point *p0,int numberPoints0,C_Color color0); C_Polygon(C_Point *p0,C_Color *colorarray0,int numberPoints0); C_Polygon(C_Polygon &pg); ~C_Polygon(); C_Polygon operator =(const C_Polygon &pg); void setColor(C_Color color0) {color=color0;} void draw(); void fill(); void gradate(); }; class C_Matrix { public: float m[3][3]; C_Matrix(); C_Matrix(const C_Matrix &mx); C_Matrix(const float m0[3][3]); ~C_Matrix() {} C_Matrix operator =(const C_Matrix &mx); void createidentity(); void setTranslation(C_Vector v); void setTranslation(float dx,float dy); void setRotation(float theta); void setScale(float fx,float fy); }; C_Matrix operator * (const C_Matrix &a, const C_Matrix &b); C_Point operator * (const C_Matrix &a, const C_Point &b); C_Line operator * (const C_Matrix &a, const C_Line &b); C_Polyline operator * (const C_Matrix &a, const C_Polyline &b); C_Polygon operator * (const C_Matrix &a, const C_Polygon &b);