00001 #ifndef _VUVOLUMEBCCUNIMODAL3D1B1VALSHEETSPLAT_H_
00002 #define _VUVOLUMEBCCUNIMODAL3D1B1VALSHEETSPLAT_H_
00003
00004 #include "../intensity.h"
00005 #include <GL/gl.h>
00006 #include <GL/glu.h>
00007 #include "vuSimpleTypes.h"
00008 #include "vuNormalTable.h"
00009 #include "vuVector.h"
00010 #include "vuThread.h"
00011 #include "vuParallelCamera.h"
00012
00013 #include "vuColourRGBa.h"
00014 #include "FrameBuffer.h"
00015 #include "SplatSlicer.h"
00016
00017 class vu1512112;
00018 typedef vu1512112 vuVolumeBccUnimodal3d1B1ValSheetSplat;
00019
00021
00023 class vu1512112 : public vu151211, public vuThread
00024 {
00025 public:
00027 vu1512112();
00029 virtual ~vu1512112();
00030
00032 vu1512112& operator=(const vu1512112& rhs);
00033
00034 public:
00036 void setViewVectors(const vuVector& view,const vuVector& up,const vuVector& right);
00037
00039 void setFootprintSize(float size);
00041 float getFootprintSize() const;
00043 void setSliceWidth(const float size);
00045 float getSliceWidth() const;
00046
00048 void initOpenGL(void);
00050 void render();
00051
00053 virtual bool read();
00054
00056 virtual bool readRaw(void);
00057
00058 vuVector getCenter() {return m_Center;}
00059
00060 bool setImageSize(int width, int height);
00061
00062 void setBGColour(float r, float g, float b);
00063
00067 void doRefresh() { m_Refresh = true; }
00068
00069 private:
00071 void run(int whatsup, void* data);
00072
00074 void preprocess(void);
00075
00077 void initSheets(float dist0, float ddist);
00078
00080 void prepareSheets();
00081
00083 void clearSheets();
00084
00090 void sortByDistance();
00091
00093 void drawSlice(RGBABuffer& sheet, int n);
00094
00095 void drawSlices();
00096
00097 void showHistogram();
00098
00099 private:
00100 float m_SplatRadius;
00101 float m_SliceWidth;
00102 dword m_SpS_2;
00103 float m_SplatCrop;
00104 int m_NSlices;
00105 dword **m_Slices;
00106 float *m_SliceDist;
00107 float *m_SplatPos;
00108 bool m_Exclude[256];
00109
00110 vuVector *m_Normals;
00113 float *m_Shading;
00114 SplatSlicer m_Splat;
00115 int m_FBWidth, m_FBHeight;
00116 RGBABuffer m_FrameBuffer;
00117 RGBABuffer m_SheetBuffer;
00118 vuVector m_Center;
00119 float m_BGColour[4];
00120
00121 vuColourRGBa m_LightSpecular;
00122 float m_LightDiffuse;
00123 float m_LightAmbient;
00124 unsigned int m_LightShininess;
00125 vuVector m_LightDir;
00126
00127 int m_CurrentSheet;
00128 vuMutex m_FBMutex;
00129
00130 bool m_DataPrepared;
00131 bool m_Refresh;
00132 };
00133
00134 #endif