00001 #ifndef _TX_POINT_
00002 #define _TX_POINT_
00003
00004 #include <gl/glut.h>
00005
00006 #define TX_POINT_RADIUS 5
00007 #define TX_POINT_BOUNDING_RADIUS 64 // HISTOGRAM_VGRID_SIZE / 2
00008
00009 using namespace std;
00010
00016 class TxPoint {
00017 private:
00020 int bounds[2];
00021
00022 public:
00024 GLfloat rgba[4];
00025
00028 GLfloat position[2];
00029
00032 bool mouseOver;
00033
00037 bool operator<(const TxPoint &t) {
00038 return position[0] < t.position[0];
00039 }
00040
00041
00043 TxPoint(GLfloat x, GLfloat y, GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
00044
00046 void computeBounds();
00047
00054 bool hit(GLfloat x, GLfloat y);
00055
00056
00058 void onMouseOver();
00059
00061 void onMouseOut();
00062
00067 void moveTo(GLfloat x, GLfloat y);
00068
00070 void render();
00071
00073 bool equals(TxPoint *p);
00074 };
00075
00076 #endif