00001
00002
00003
00005
00006
00011
00016
00021
00023
00024 #ifndef GLTRIANGLESET_H
00025 #define GLTRIANGLESET_H
00026
00027 #include "X3DGLComposedGeometryNode.h"
00028
00029 #include <vector>
00030
00031 namespace X3DTK {
00032 namespace GL {
00033
00036
00037 class TriangleSet : public X3DComposedGeometryNode
00038 {
00039 public:
00041 TriangleSet();
00043 virtual SFNode clone() const;
00045 virtual ~TriangleSet();
00046
00048 void setN3F_V3F_vertexArray(const std::vector<N3F_V3F> &N3F_V3FvertexArray);
00050 void setC4F_N3F_V3F_vertexArray(const std::vector<C4F_N3F_V3F> &C4F_N3F_V3FvertexArray);
00052 void setT2F_N3F_V3F_vertexArray(const std::vector<T2F_N3F_V3F> &T2F_N3F_V3F_vertexArray);
00054 void setT2F_C4F_N3F_V3F_vertexArray(const std::vector<T2F_C4F_N3F_V3F> &T2F_C4F_N3F_V3F_vertexArray);
00055
00057 inline std::vector<N3F_V3F> &N3F_V3F_vertexArray() {return _N3F_V3F_vertexArray;};
00059 inline std::vector<C4F_N3F_V3F> &C4F_N3F_V3F_vertexArray() {return _C4F_N3F_V3F_vertexArray;};
00061 inline std::vector<T2F_N3F_V3F> &T2F_N3F_V3F_vertexArray() {return _T2F_N3F_V3F_vertexArray;};
00063 inline std::vector<T2F_C4F_N3F_V3F> &T2F_C4F_N3F_V3F_vertexArray() {return _T2F_C4F_N3F_V3F_vertexArray;};
00064
00066 virtual void update();
00068 virtual void render() const;
00069
00070 protected:
00072 TriangleSet(const TriangleSet &T);
00073
00074 private:
00076 std::vector<N3F_V3F> _N3F_V3F_vertexArray;
00078 std::vector<C4F_N3F_V3F> _C4F_N3F_V3F_vertexArray;
00080 std::vector<T2F_N3F_V3F> _T2F_N3F_V3F_vertexArray;
00082 std::vector<T2F_C4F_N3F_V3F> _T2F_C4F_N3F_V3F_vertexArray;
00083
00085 void computeNoColorNoTexCoord(const MFVec3f &vertexArray, const MFVec3f &normalArray);
00087 void computeColorNoTexCoord(const MFVec3f &vertexArray, const MFVec3f &normalArray);
00089 void computeNoColorTexCoord(const MFVec3f &vertexArray, const MFVec3f &normalArray);
00091 void computeColorTexCoord(const MFVec3f &vertexArray, const MFVec3f &normalArray);
00093 void computeArrays(const MFVec3f &vertexArray, MFVec3f &normalArray);
00094 };
00095
00096 }
00097 }
00098
00099 #endif