00001 #ifndef X3DTK_GL_TRIANGLESTRIPSET_H 00002 #define X3DTK_GL_TRIANGLESTRIPSET_H 00003 00004 #include "GL_X3DComposedGeometryNode.h" 00005 00006 #include <vector> 00007 00008 namespace X3DTK { 00009 namespace GL { 00010 00017 class TriangleStripSet : public X3DComposedGeometryNode 00018 { 00019 public: 00021 TriangleStripSet(); 00023 virtual ~TriangleStripSet(); 00024 00026 void setN3F_V3F_vertexArrayArray(const std::vector<std::vector<N3F_V3F> > &N3F_V3F_vertexArrayArray); 00028 void setT2F_N3F_V3F_vertexArrayArray(const std::vector<std::vector<T2F_N3F_V3F> > &T2F_N3F_V3F_vertexArrayArray); 00030 void setC4F_N3F_V3F_vertexArrayArray(const std::vector<std::vector<C4F_N3F_V3F> > &C4F_N3F_V3F_vertexArrayArray); 00032 void setT2F_C4F_N3F_V3F_vertexArrayArray(const std::vector<std::vector<T2F_C4F_N3F_V3F> > &T2F_C4F_N3F_V3F_vertexArrayArray); 00033 00035 inline std::vector<std::vector<N3F_V3F> > &N3F_V3F_vertexArrayArray() {return _N3F_V3F_vertexArrayArray;}; 00037 inline std::vector<std::vector<T2F_N3F_V3F> > &T2F_N3F_V3F_vertexArrayArray() {return _T2F_N3F_V3F_vertexArrayArray;}; 00039 inline std::vector<std::vector<C4F_N3F_V3F> > &C4F_N3F_V3F_vertexArrayArray() {return _C4F_N3F_V3F_vertexArrayArray;}; 00041 inline std::vector<std::vector<T2F_C4F_N3F_V3F> > &T2F_C4F_N3F_V3F_vertexArrayArray() {return _T2F_C4F_N3F_V3F_vertexArrayArray;}; 00042 00044 void setVerticesDuplicated(bool value); 00046 inline bool getVerticesDuplicated() const {return _verticesDuplicated;}; 00047 00049 virtual void update(); 00051 virtual void draw() const; 00052 00053 private: 00055 std::vector<std::vector<N3F_V3F> > _N3F_V3F_vertexArrayArray; 00057 std::vector<std::vector<T2F_N3F_V3F> > _T2F_N3F_V3F_vertexArrayArray; 00059 std::vector<std::vector<C4F_N3F_V3F> > _C4F_N3F_V3F_vertexArrayArray; 00061 std::vector<std::vector<T2F_C4F_N3F_V3F> > _T2F_C4F_N3F_V3F_vertexArrayArray; 00062 00064 void computeNoColorNoTexCoord(const MFVec3f &vertexArray, const MFVec3f &normalArray); 00066 void computeColorNoTexCoord(const MFVec3f &vertexArray, const MFVec3f &normalArray); 00068 void computeNoColorTexCoord(const MFVec3f &vertexArray, const MFVec3f &normalArray); 00070 void computeColorTexCoord(const MFVec3f &vertexArray, const MFVec3f &normalArray); 00072 void computeArrays(const MFVec3f &vertexArray, MFVec3f &normalArray); 00073 00074 bool _verticesDuplicated; 00075 00076 }; 00077 00078 } 00079 } 00080 00081 #endif