00001
00002
00004
00005 #ifndef CONEARRAY_H
00006 #define CONEARRAY_H
00007
00008 #include "X3DTypes.h"
00009 #include "X3DGLTypes.h"
00010
00011 #include <vector>
00012 #include <utility>
00013
00014 namespace X3DTK {
00015 namespace GL {
00016
00019
00020 class ConeDrawArray
00021 {
00022 public:
00024 static ConeDrawArray *getInstanceOfSection(unsigned int section);
00026 void removeInstance();
00027
00029 unsigned int getConeSideSize() const;
00031 unsigned int getConeBottomSize() const;
00032
00034 const void *getConeSideVertexArrayAddress() const;
00036 const void *getConeBottomVertexArrayAddress() const;
00037
00039 const unsigned int *getConeSideIndexArrayAddress() const;
00041 const unsigned int *getConeBottomIndexArrayAddress() const;
00042
00043 private:
00044 unsigned int _section;
00045
00047 ConeDrawArray(unsigned int section);
00048
00049 typedef struct
00050 {
00051 unsigned int count;
00052 ConeDrawArray *ref;
00053 } data;
00054
00055 typedef std::list<std::pair<unsigned int, data> > refList;
00056
00057 static refList _refList;
00058
00059 std::vector<N3F_V3F> _coneSideVertexArray;
00060 std::vector<N3F_V3F> _coneBottomVertexArray;
00061 std::vector<unsigned int> _coneSideIndexArray;
00062 std::vector<unsigned int> _coneBottomIndexArray;
00063 };
00064
00065 }
00066 }
00067
00068 #endif