00001 #ifndef HISTOGRAM_DRAW_H 00002 #define HISTOGRAM_DRAW_H 00003 00004 #include <vector> 00005 00006 class Volume; 00007 00008 enum HistogramDrawType 00009 { 00010 HISTOGRAM_DRAW_NONE, 00011 HISTOGRAM_DRAW_LINEAR, 00012 HISTOGRAM_DRAW_LOG 00013 }; 00021 class HistogramDraw 00022 { 00023 public: 00024 static HistogramDraw* getInstance(); 00025 00026 void refreshHistogramDrawData(Volume& volume); 00027 00028 void calculateLogarithmicHistogramData(); 00029 void rescaleHistogramDataToHighestValue( std::vector<double> &normalizedHistogramData ); 00030 void draw(); 00031 void setDrawType(HistogramDrawType drawType); 00032 00033 00034 private: 00035 HistogramDraw(); 00036 ~HistogramDraw(); 00037 HistogramDraw(const HistogramDraw &); 00038 HistogramDraw & operator=(const HistogramDraw &); 00039 00040 00041 00042 static HistogramDraw* _instance; 00043 static bool initialized; 00044 00045 00046 HistogramDrawType m_HistogramDrawType; 00047 float* m_HistogramData; 00048 float* m_HistogramDataLogarithmic; 00049 int m_HistogramDataSize; 00050 }; 00051 00052 00053 00054 #endif