00001 #ifndef X3DTK_GL_TRIANGLESET_H
00002 #define X3DTK_GL_TRIANGLESET_H
00003
00004 #include "GL_X3DComposedGeometryNode.h"
00005
00006 #include <vector>
00007
00008 namespace X3DTK {
00009 namespace GL {
00010
00017 class TriangleSet : public X3DComposedGeometryNode
00018 {
00019 public:
00021 TriangleSet();
00023 virtual ~TriangleSet();
00024
00026 void setN3F_V3F_vertexArray(const std::vector<N3F_V3F> &N3F_V3FvertexArray);
00028 void setC4F_N3F_V3F_vertexArray(const std::vector<C4F_N3F_V3F> &C4F_N3F_V3FvertexArray);
00030 void setT2F_N3F_V3F_vertexArray(const std::vector<T2F_N3F_V3F> &T2F_N3F_V3F_vertexArray);
00032 void setT2F_C4F_N3F_V3F_vertexArray(const std::vector<T2F_C4F_N3F_V3F> &T2F_C4F_N3F_V3F_vertexArray);
00033
00035 inline std::vector<N3F_V3F> &N3F_V3F_vertexArray() {return _N3F_V3F_vertexArray;};
00037 inline std::vector<C4F_N3F_V3F> &C4F_N3F_V3F_vertexArray() {return _C4F_N3F_V3F_vertexArray;};
00039 inline std::vector<T2F_N3F_V3F> &T2F_N3F_V3F_vertexArray() {return _T2F_N3F_V3F_vertexArray;};
00041 inline std::vector<T2F_C4F_N3F_V3F> &T2F_C4F_N3F_V3F_vertexArray() {return _T2F_C4F_N3F_V3F_vertexArray;};
00042
00044 virtual void update();
00046 virtual void draw() const;
00047
00048 private:
00050 std::vector<N3F_V3F> _N3F_V3F_vertexArray;
00052 std::vector<C4F_N3F_V3F> _C4F_N3F_V3F_vertexArray;
00054 std::vector<T2F_N3F_V3F> _T2F_N3F_V3F_vertexArray;
00056 std::vector<T2F_C4F_N3F_V3F> _T2F_C4F_N3F_V3F_vertexArray;
00057
00059 void computeNoColorNoTexCoord(const MFVec3f &vertexArray, const MFVec3f &normalArray);
00061 void computeColorNoTexCoord(const MFVec3f &vertexArray, const MFVec3f &normalArray);
00063 void computeNoColorTexCoord(const MFVec3f &vertexArray, const MFVec3f &normalArray);
00065 void computeColorTexCoord(const MFVec3f &vertexArray, const MFVec3f &normalArray);
00067 void computeArrays(const MFVec3f &vertexArray, MFVec3f &normalArray);
00068 };
00069
00070 }
00071 }
00072
00073 #endif