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_GEO_STRIP_SET_HPP
00026 #define __SGL_GEO_STRIP_SET_HPP
00027
00028 #include <sgl.h>
00029 #include <sglGeoSet.hpp>
00030
00031
00032
00089 class SGL_DLL_API sglGeoStripSet : public sglGeoSet
00090 {
00091 public:
00093 sglGeoStripSet();
00095 virtual ~sglGeoStripSet();
00096
00098 virtual unsigned int getPrimSize() const {return 0;}
00099
00101 sglDataPtr *getPrimLengths() const {return m_lengths.getDataPtr();}
00102
00104 void setPrimLengths(sglIndexType *alist)
00105 { setPrimLengths(new sglNoRefDataPtr(alist)); }
00106
00119 void setPrimLengths(sglDataPtr *data,
00120 int offset = 0,
00121 int stride = 0);
00122
00124 int getPrimLengthsOffset() const { return m_lengths.getOffset(); }
00125
00127 int getPrimLengthsStride() const { return m_lengths.getStride(); }
00128
00130 virtual void addStats(sglStats &stats) const;
00131
00132 protected:
00133 virtual bool computeBounds();
00134 virtual void updateDrawFunc();
00135
00136 private:
00137 sglGeoStripSet(const sglGeoStripSet &);
00138 sglGeoStripSet &operator=(const sglGeoStripSet &);
00139
00140 void drawVT(const vector<sglTexCoords> &tex_coords) const;
00141 void drawVNoT(const vector<sglTexCoords> &tex_coords) const;
00142 void drawVNpT(const vector<sglTexCoords> &tex_coords) const;
00143 void drawVNvT(const vector<sglTexCoords> &tex_coords) const;
00144 void drawVCoT(const vector<sglTexCoords> &tex_coords) const;
00145 void drawVCoNoT(const vector<sglTexCoords> &tex_coords) const;
00146 void drawVCoNpT(const vector<sglTexCoords> &tex_coords) const;
00147 void drawVCoNvT(const vector<sglTexCoords> &tex_coords) const;
00148 void drawVCpT(const vector<sglTexCoords> &tex_coords) const;
00149 void drawVCpNoT(const vector<sglTexCoords> &tex_coords) const;
00150 void drawVCpNpT(const vector<sglTexCoords> &tex_coords) const;
00151 void drawVCpNvT(const vector<sglTexCoords> &tex_coords) const;
00152 void drawVCvT(const vector<sglTexCoords> &tex_coords) const;
00153 void drawVCvNoT(const vector<sglTexCoords> &tex_coords) const;
00154 void drawVCvNpT(const vector<sglTexCoords> &tex_coords) const;
00155 void drawVCvNvT(const vector<sglTexCoords> &tex_coords) const;
00156
00157 #ifndef SGL_NO_VERTEX_ARRAYS
00158 void drawVTm(const vector<sglTexCoords> &tex_coords) const;
00159 void drawVNoTm(const vector<sglTexCoords> &tex_coords) const;
00160 void drawVNpTm(const vector<sglTexCoords> &tex_coords) const;
00161 void drawVNvTm(const vector<sglTexCoords> &tex_coords) const;
00162 void drawVCoTm(const vector<sglTexCoords> &tex_coords) const;
00163 void drawVCoNoTm(const vector<sglTexCoords> &tex_coords) const;
00164 void drawVCoNpTm(const vector<sglTexCoords> &tex_coords) const;
00165 void drawVCoNvTm(const vector<sglTexCoords> &tex_coords) const;
00166 void drawVCpTm(const vector<sglTexCoords> &tex_coords) const;
00167 void drawVCpNoTm(const vector<sglTexCoords> &tex_coords) const;
00168 void drawVCpNpTm(const vector<sglTexCoords> &tex_coords) const;
00169 void drawVCpNvTm(const vector<sglTexCoords> &tex_coords) const;
00170 void drawVCvTm(const vector<sglTexCoords> &tex_coords) const;
00171 void drawVCvNoTm(const vector<sglTexCoords> &tex_coords) const;
00172 void drawVCvNpTm(const vector<sglTexCoords> &tex_coords) const;
00173 void drawVCvNvTm(const vector<sglTexCoords> &tex_coords) const;
00174 #endif
00175
00176 class Initializer;
00177 friend class Initializer;
00178 static void setupFuncTable();
00179
00180 protected:
00181 sglIndexPtr m_lengths;
00182
00183 private:
00184 static DrawFunc s_func_table[(eMULTI_TEXTURE|eCOLORS|eNORMALS)+1];
00185 static Initializer sInitializer;
00186 };
00187
00188 #endif