00001 00002 // CylinderDrawArray.h // 00004 00005 #ifndef CYLINDERARRAY_H 00006 #define CYLINDERARRAY_H 00007 00008 #include "GLSceneGraphTypes.h" 00009 00010 #include <vector> 00011 #include <list> 00012 #include <utility> 00013 00014 namespace X3DTK { 00015 namespace GL { 00016 00019 00020 class CylinderDrawArray 00021 { 00022 public: 00024 static CylinderDrawArray *getInstanceOfSection(unsigned int section); 00026 void removeInstance(); 00027 00029 unsigned int getCylinderBottomSize() const; 00031 unsigned int getCylinderSideSize() const; 00033 unsigned int getCylinderTopSize() const; 00035 const void *getCylinderBottomVertexArrayAddress() const; 00037 const void *getCylinderSideVertexArrayAddress() const; 00039 const void *getCylinderTopVertexArrayAddress() const; 00041 const unsigned int *getCylinderBottomIndexArrayAddress() const; 00043 const unsigned int *getCylinderSideIndexArrayAddress() const; 00045 const unsigned int *getCylinderTopIndexArrayAddress() const; 00046 00047 private: 00048 unsigned int _section; 00049 00050 CylinderDrawArray(unsigned int section); 00051 00052 typedef struct 00053 { 00054 unsigned int count; 00055 CylinderDrawArray *ref; 00056 } data; 00057 00058 typedef std::list<std::pair<unsigned int, data> > refList; 00059 00060 static refList _refList; 00061 00062 std::vector<N3F_V3F> _cylinderBottomVertexArray; 00063 std::vector<N3F_V3F> _cylinderSideVertexArray; 00064 std::vector<N3F_V3F>_cylinderTopVertexArray; 00065 std::vector<unsigned int> _cylinderBottomIndexArray; 00066 std::vector<unsigned int> _cylinderSideIndexArray; 00067 std::vector<unsigned int> _cylinderTopIndexArray; 00068 }; 00069 00070 } 00071 } 00072 00073 #endif