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
00026
00027 #ifndef __SGL_INDEXED_TRIANGLE_SET_HPP
00028 #define __SGL_INDEXED_TRIANGLE_SET_HPP
00029
00030 #include <sgl.h>
00031 #include <sglIndexedGeoSet.hpp>
00032
00033
00034
00038 class SGL_DLL_API sglIndexedTriangleSet : public sglIndexedGeoSet
00039 {
00040 public:
00042 sglIndexedTriangleSet();
00044 virtual ~sglIndexedTriangleSet();
00045
00047 sglStats::PrimEnum getPrimType() const {return sglStats::eINDEXED_TRIS;}
00049 GLenum getGLPrimType() const {return GL_TRIANGLES;}
00051 unsigned int getPrimSize() const {return 3;}
00053 AAEnum getAAType() const {return ePOLYGON_AA;}
00054
00056 virtual sglBound::IntersectResultEnum intersectPrim(sglIntersectf &segset);
00058 virtual sglBound::IntersectResultEnum intersectPrim(sglIntersectd &segset);
00059
00060 protected:
00061 virtual void updateDrawFunc();
00062
00063 private:
00064 sglIndexedTriangleSet(const sglIndexedTriangleSet &);
00065 sglIndexedTriangleSet &operator=(const sglIndexedTriangleSet &);
00066
00067 void drawVT(const vector<sglTexCoords> &tex_coords) const;
00068 void drawVNoT(const vector<sglTexCoords> &tex_coords) const;
00069 void drawVNpT(const vector<sglTexCoords> &tex_coords) const;
00070 void drawVNvT(const vector<sglTexCoords> &tex_coords) const;
00071 void drawVCoT(const vector<sglTexCoords> &tex_coords) const;
00072 void drawVCoNoT(const vector<sglTexCoords> &tex_coords) const;
00073 void drawVCoNpT(const vector<sglTexCoords> &tex_coords) const;
00074 void drawVCoNvT(const vector<sglTexCoords> &tex_coords) const;
00075 void drawVCpT(const vector<sglTexCoords> &tex_coords) const;
00076 void drawVCpNoT(const vector<sglTexCoords> &tex_coords) const;
00077 void drawVCpNpT(const vector<sglTexCoords> &tex_coords) const;
00078 void drawVCpNvT(const vector<sglTexCoords> &tex_coords) const;
00079 void drawVCvT(const vector<sglTexCoords> &tex_coords) const;
00080 void drawVCvNoT(const vector<sglTexCoords> &tex_coords) const;
00081 void drawVCvNpT(const vector<sglTexCoords> &tex_coords) const;
00082 void drawVCvNvT(const vector<sglTexCoords> &tex_coords) const;
00083
00084 class Initializer;
00085 friend class Initializer;
00086 static void setupFuncTable();
00087
00088 private:
00089 static DrawFunc s_func_table[(eCOLORS|eNORMALS)+1];
00090 static Initializer sInitializer;
00091 };
00092
00093 #endif