00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef _vu111211a_H_ //SimpleFVR was vu1112119, so 'a' is used for CellProjection
00019 #define _vu111211a_H_ //as specified by the coding conventions.
00020
00021
00022
00023 #include "../intensity.h"
00024 #include "vuImage.h"
00025 #include "vuVector.h"
00026 #include "vuGrid.h"
00027
00028
00029
00031
00035 enum DebugEnum { NORMAL, MANUAL_TET, ANIMATE_TET_ORDER, ANIMATE_VOXEL_ORDER };
00036
00038 enum SubdivEnum { FIVE_FOLD, SIX_FOLD };
00039
00040
00041
00042 class vu111211a;
00043
00044 typedef vu111211a vuVolumeRegularUnimodal3d1B1CellProjector;
00045
00047
00052 class vuCellProjector;
00053 class vu111211a : public vu111211
00054 {
00055 friend class vuCellProjector;
00056
00057 public:
00058
00060 vu111211a();
00061
00063 vu111211a(const vu111211a& inst);
00064
00066 ~vu111211a();
00067
00069 vu111211a& operator=(const vu111211a& rhs);
00070
00071 public:
00072
00074 void setViewVectors(const vuVector& view,const vuVector& up,const vuVector& right);
00075
00077
00078
00079
00080
00081
00082 void initOpenGL() const;
00083
00085
00089 void render();
00090
00093
00094
00095
00096
00097
00098 void drawPic() const;
00099
00101
00102
00103
00104
00105
00106 vuImage* getBuffer();
00107
00109 bool read();
00110
00112
00113
00114
00115
00116
00117 virtual bool readRaw();
00118
00119 private:
00120
00122 void drawVoxelsSorted() const;
00123
00125 void drawVoxelsUnsorted() const;
00126
00128 void drawVoxel(int x, int y, int z) const;
00129
00131
00134 void drawTet(const int TET_RELATIVE_INDICES[4], const int VOXEL_ORIGIN[3]) const;
00135
00137
00158 void drawTet(int tetVertexLocations[4][3]) const;
00159
00161
00162
00163
00164 void drawTetNormals(int tetVertexLocations[4][3]) const;
00165
00167 void getTetOrientation(int tetVertexLocations[4][3],
00168 char orientation[4] ) const;
00169
00171 void getTetNormals(int tetVertexLocations[4][3],
00172 vuVector normals[4] ) const;
00173
00175 vuVector getNormal(vuVector* v[3]) const;
00176
00178 byte getIntensity(int vertex[3]) const;
00179
00181 void initGrid();
00182
00190 void writeImgBuffer();
00191
00192 private:
00193
00195 vuImage m_ImgBuffer;
00196
00199 vuVector m_View;
00200
00201 private:
00202
00204
00208 DebugEnum m_state;
00209
00211 SubdivEnum m_subdivScheme;
00212
00214 bool m_isSort;
00215
00217 bool m_isRender;
00218
00220
00223 int m_tetIndex;
00224
00226 vuGrid m_grid;
00227
00228 private:
00229
00231 static const int TETS_DEF_5_FOLD[10][4];
00232
00234 static const int TETS_DEF_6_FOLD[6][4];
00235
00237 static const int TRIANGLE_DEF[4][3];
00238
00240 static const int VOXEL_VERTEX_LOCATIONS[8][3];
00241 };
00242
00243 #endif