00001 #ifndef _VU_VOLUME_LIGHTFIELD_UNIMODAL_SPHERIC_H_
00002 #define _VU_VOLUME_LIGHTFIELD_UNIMODAL_SPHERIC_H_
00003
00004 #include "../unimodal.h"
00005 #include "vuLightfield/vuSphericView.h"
00006 #include "vuLinAlg/vuSpherical.h"
00007 #include "vuLinAlg/vuMatrix.h"
00008 #include <math.h>
00009
00014 class vu1611_ST : public vu161
00015 {
00016 public:
00017 virtual dword getNumberOfViews(void) const = 0;
00018 virtual vuSphericView_ST *getView(dword i) = 0;
00019 };
00020
00021 template <int SIZE, class TYPE>
00022 class vu1611 : public vu1611_ST
00023 {
00024 public:
00026 vu1611();
00027
00028
00030 vu1611(const vu1611& inst);
00031
00033 vu1611& operator=(const vu1611& rhs);
00034
00035 ~vu1611();
00036
00038 dword getWidth(void) const;
00039
00041 dword getHeight(void) const;
00042
00044 dword getNumberOfViews(void) const;
00045
00047 vuSphericView<SIZE,TYPE> *getView(dword i);
00048
00049 int getIndexOfView(vuSphericView<SIZE,TYPE> * view);
00050
00052 vuSphericView<SIZE,TYPE>* &getViews();
00053
00054 const char *_typeName();
00055
00057 void setViewVectors(const vuVector&,const vuVector&,const vuVector&);
00058
00059 protected:
00070 virtual bool read(FILE *file);
00071
00073
00075 virtual bool write(FILE *file);
00076
00077 virtual void glResize(dword width, dword height);
00078
00079 private:
00080
00081 void _initViews();
00082
00083
00084 bool _isDataSizeValid(dword dataSize);
00085
00086 void _syncViewsToBuffer();
00087
00088 public:
00089
00091 virtual vuVector getCenter() const;
00092
00093 public:
00095
00101 virtual bool read(void);
00102
00104
00107 virtual bool write(void);
00108
00109 bool write(const vuString &fileName);
00110
00111 protected:
00113 dword m_width;
00115 dword m_height;
00117 dword m_numberOfViews;
00119 vuSphericView<SIZE,TYPE> *m_views;
00120 };
00121
00122 template class vu1611<1,byte>;
00123 template class vu1611<2,byte>;
00124 template class vu1611<3,byte>;
00125 template class vu1611<1,float>;
00126 template class vu1611<2,float>;
00127 template class vu1611<3,float>;
00128
00129 #endif
00130