00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef __SGL_MONO_INDEXED_GEOSET_HPP
00026 #define __SGL_MONO_INDEXED_GEOSET_HPP
00027
00028 #include <sgl.h>
00029 #include <sglGeoSet.hpp>
00030
00031 #include <vector>
00032
00033
00034
00092 class SGL_DLL_API sglMonoIndexedGeoSet : public sglGeoSet
00093 {
00094 public:
00096 sglMonoIndexedGeoSet();
00098 virtual ~sglMonoIndexedGeoSet();
00099
00101 void setIndexList(sglIndexType *alist)
00102 { setIndexList(new sglNoRefDataPtr(alist)); }
00103
00117 void setIndexList(sglDataPtr *data,
00118 int offset = 0,
00119 int stride = 0);
00120
00122 sglDataPtr *getIndexList() const {return m_index.getDataPtr();}
00123
00125 int getIndexOffset() const { return m_index.getOffset(); }
00126
00128 int getIndexStride() const { return m_index.getStride(); }
00129
00134 void setDisablePrefetch(bool val);
00136 bool getDisablePrefetch() {return m_disable_prefetch;}
00137
00138 protected:
00139 virtual bool computeBounds();
00140 virtual void computeNoBounds();
00141 virtual void updateDrawFunc();
00142
00143 private:
00144 sglMonoIndexedGeoSet(const sglMonoIndexedGeoSet &);
00145 sglMonoIndexedGeoSet &operator=(const sglMonoIndexedGeoSet &);
00146
00147 void drawVT(const vector<sglTexCoords> &tex_coords) const;
00148 void drawVNoT(const vector<sglTexCoords> &tex_coords) const;
00149 void drawVNpT(const vector<sglTexCoords> &tex_coords) const;
00150 void drawVNvT(const vector<sglTexCoords> &tex_coords) const;
00151 void drawVCoT(const vector<sglTexCoords> &tex_coords) const;
00152 void drawVCoNoT(const vector<sglTexCoords> &tex_coords) const;
00153 void drawVCoNpT(const vector<sglTexCoords> &tex_coords) const;
00154 void drawVCoNvT(const vector<sglTexCoords> &tex_coords) const;
00155 void drawVCpT(const vector<sglTexCoords> &tex_coords) const;
00156 void drawVCpNoT(const vector<sglTexCoords> &tex_coords) const;
00157 void drawVCpNpT(const vector<sglTexCoords> &tex_coords) const;
00158 void drawVCpNvT(const vector<sglTexCoords> &tex_coords) const;
00159 void drawVCvT(const vector<sglTexCoords> &tex_coords) const;
00160 void drawVCvNoT(const vector<sglTexCoords> &tex_coords) const;
00161 void drawVCvNpT(const vector<sglTexCoords> &tex_coords) const;
00162 void drawVCvNvT(const vector<sglTexCoords> &tex_coords) const;
00163
00164 #ifndef SGL_NO_VERTEX_ARRAYS
00165 void drawVTm(const vector<sglTexCoords> &tex_coords) const;
00166 void drawVNoTm(const vector<sglTexCoords> &tex_coords) const;
00167 void drawVNpTm(const vector<sglTexCoords> &tex_coords) const;
00168 void drawVNvTm(const vector<sglTexCoords> &tex_coords) const;
00169 void drawVCoTm(const vector<sglTexCoords> &tex_coords) const;
00170 void drawVCoNoTm(const vector<sglTexCoords> &tex_coords) const;
00171 void drawVCoNpTm(const vector<sglTexCoords> &tex_coords) const;
00172 void drawVCoNvTm(const vector<sglTexCoords> &tex_coords) const;
00173 void drawVCpTm(const vector<sglTexCoords> &tex_coords) const;
00174 void drawVCpNoTm(const vector<sglTexCoords> &tex_coords) const;
00175 void drawVCpNpTm(const vector<sglTexCoords> &tex_coords) const;
00176 void drawVCpNvTm(const vector<sglTexCoords> &tex_coords) const;
00177 void drawVCvTm(const vector<sglTexCoords> &tex_coords) const;
00178 void drawVCvNoTm(const vector<sglTexCoords> &tex_coords) const;
00179 void drawVCvNpTm(const vector<sglTexCoords> &tex_coords) const;
00180 void drawVCvNvTm(const vector<sglTexCoords> &tex_coords) const;
00181
00182 void drawPrefetchVT(const vector<sglTexCoords> &tex_coords) const;
00183 void drawPrefetchVNoT(const vector<sglTexCoords> &tex_coords) const;
00184 void drawPrefetchVNvT(const vector<sglTexCoords> &tex_coords) const;
00185 void drawPrefetchVCoT(const vector<sglTexCoords> &tex_coords) const;
00186 void drawPrefetchVCoNoT(const vector<sglTexCoords> &tex_coords) const;
00187 void drawPrefetchVCoNvT(const vector<sglTexCoords> &tex_coords) const;
00188 void drawPrefetchVCvT(const vector<sglTexCoords> &tex_coords) const;
00189 void drawPrefetchVCvNoT(const vector<sglTexCoords> &tex_coords) const;
00190 void drawPrefetchVCvNvT(const vector<sglTexCoords> &tex_coords) const;
00191
00192 void drawPrefetchVTm(const vector<sglTexCoords> &tex_coords) const;
00193 void drawPrefetchVNoTm(const vector<sglTexCoords> &tex_coords) const;
00194 void drawPrefetchVNvTm(const vector<sglTexCoords> &tex_coords) const;
00195 void drawPrefetchVCoTm(const vector<sglTexCoords> &tex_coords) const;
00196 void drawPrefetchVCoNoTm(const vector<sglTexCoords> &tex_coords) const;
00197 void drawPrefetchVCoNvTm(const vector<sglTexCoords> &tex_coords) const;
00198 void drawPrefetchVCvTm(const vector<sglTexCoords> &tex_coords) const;
00199 void drawPrefetchVCvNoTm(const vector<sglTexCoords> &tex_coords) const;
00200 void drawPrefetchVCvNvTm(const vector<sglTexCoords> &tex_coords) const;
00201 #endif
00202
00203 class Initializer;
00204 friend class Initializer;
00205 static void setupFuncTable();
00206
00207 protected:
00208 sglIndexPtr m_index;
00209 bool m_disable_prefetch;
00210
00211 #ifndef SGL_NO_VERTEX_ARRAYS
00212 vector<sglIndexType> m_index_min;
00213 vector<sglIndexType> m_index_max;
00214 #endif
00215
00216 private:
00217 static DrawFunc s_func_table[(ePREFETCH|eMULTI_TEXTURE|eCOLORS|eNORMALS)+1];
00218 static Initializer sInitializer;
00219 };
00220
00221 #endif