00001 #ifndef __PBC_BAR__ 00002 #define __PBC_BAR__ 00003 00004 #include <pixelplace.h> 00005 #include <qgl.h> 00006 #include <datachannel.h> 00007 00008 using namespace std; 00009 00010 00011 00012 class Bar { 00013 00014 public: 00015 Bar(int iTimeStep); // each bar draws one timestep 00016 ~Bar(); 00017 void Draw(); 00018 void SetNumData(int iNum); 00019 00020 void SetOxData(DataChannel* pOxChannel); 00021 void SetOyData(DataChannel* pOxChannel); 00022 void SetColorData(DataChannel* pOxChannel); 00023 void SetBrush(float* pBrush); 00024 void EnableBrushing(bool bEnableBrushing); 00025 00026 void PlacePixels(); 00027 int GetIdAt(int iX, int iY); 00028 00029 int GetWidth(); 00030 int GetHeight(); 00031 00032 private: 00033 DataChannel* m_pOxChannel; 00034 DataChannel* m_pOyChannel; 00035 DataChannel* m_pColorChannel; 00036 00037 float* m_pBrush; 00038 bool m_bEnableBrushing; 00039 00040 GLubyte* m_pBarBuffer; 00041 int* m_pIds; 00042 00043 int m_iNumData; // number of data items to display 00044 int m_iTimeStep; 00045 00046 bool m_bDataChanged; 00047 bool m_bColorChanged; 00048 bool m_bInit; 00049 00050 int m_iWidth; 00051 int m_iHeight; 00052 int m_iTextureWidth; 00053 int m_iTextureHeight; 00054 }; 00055 00056 #endif // __PBC_BAR__