00001
00002
00004
00005 #ifndef _SPECTRAL_DATGRID_H_
00006 #define _SPECTRAL_DATGRID_H_
00007
00008 #include "Util.h"
00009 #include "DatPnt.h"
00010
00011 namespace ns_vu1112112 {
00012 using namespace ns_vu1112112;
00013
00014 class vuSampleRay;
00015 class vu1112112;
00016
00023 class DatGrid
00024 {
00025 friend class vuSampleRay;
00026 public:
00028 void calculate_gradients();
00031 void shade(vu1112112 &r);
00035 void classify(vu1112112 &r);
00038 bool load_vol(byte* data, vu1112112 &r);
00040 void createSphere();
00042 int init(int maxx, int maxy, int maxz);
00043
00045 DatGrid();
00047 ~DatGrid();
00048
00049 protected:
00051 int get_vol_mem();
00053 int free_vol_mem();
00054
00055 int maxX, maxY, maxZ;
00056 int layXY;
00057 int size;
00058
00059 void distributeIllum(ColourType &il);
00060
00061 DatPnt *vol;
00062
00063 private:
00064 float clipRay(vuSampleRay &r, bool bidirectional, int& m_Side) const;
00065
00066 vuVector m_C0;
00067 vuVector m_C1;
00068 };
00069
00070 }
00071 #endif
00072