00001
00002
00003
00004
00005
00006
00007 #include "QColor.h"
00008 #include <GL/glut.h>
00009 #include <iostream>
00010 using namespace std;
00011
00012
00013
00014
00015 void QColor::setAsCurrent()
00016 {
00017 glColor4f(R,G,B,A);
00018 }
00019
00020
00021 const void QColor::set( float r , float g , float b , float a )
00022 {
00023 R = r;
00024 G = g;
00025 B = b;
00026 A = a;
00027 }
00028
00029
00030 float QColor::getR()
00031 {
00032 return R;
00033 }
00034
00035
00036 void QColor::setR( float newValue )
00037 {
00038 R = newValue;
00039 }
00040
00041
00042 float QColor::getG()
00043 {
00044 return G;
00045 }
00046
00047
00048 void QColor::setG( float newValue )
00049 {
00050 G = newValue;
00051 }
00052
00053
00054 float QColor::getB()
00055 {
00056 return B;
00057 }
00058
00059
00060 void QColor::setB( float newValue )
00061 {
00062 B = newValue;
00063 }
00064
00065
00066 float QColor::getA()
00067 {
00068 return A;
00069 }
00070
00071
00072 void QColor::setA( float newValue )
00073 {
00074 A = newValue;
00075 }
00076
00077
00078
00079
00080 void QColor::copyFrom( QColor* from )
00081 {
00082 setR(from->getR());
00083 setG(from->getG());
00084 setB(from->getB());
00085 setA(from->getA());
00086 }
00087
00088
00089
00090
00091 void QColor::print()
00092 {
00093 cout << "Class : QColor" << endl;
00094 cout << "R = " << R << endl;
00095 cout << "G = " << G << endl;
00096 cout << "B = " << B << endl;
00097 cout << "A = " << A << endl;
00098 }
00099
00100
00101
00102
00103 QColor::QColor( )
00104 {
00105 R = 1;
00106 G = 1;
00107 B = 1;
00108 A = 1;
00109 }
00110
00111
00112
00113
00114 QColor::~QColor()
00115 {
00116 }
00117
00118
00119
00120