00001 00002 00003 00005 00006 00011 00016 00021 // CylinderDrawArray.h // 00023 00024 #ifndef CYLINDERARRAY_H 00025 #define CYLINDERARRAY_H 00026 00027 #include "X3DTypes.h" 00028 #include "X3DGLTypes.h" 00029 00030 #include <vector> 00031 #include <list> 00032 #include <utility> 00033 00034 namespace X3DTK { 00035 namespace GL { 00036 00039 00040 class CylinderDrawArray 00041 { 00042 public: 00044 static CylinderDrawArray *getInstanceOfSection(unsigned int section); 00046 void removeInstance(); 00047 00049 unsigned int getCylinderBottomSize() const; 00051 unsigned int getCylinderSideSize() const; 00053 unsigned int getCylinderTopSize() const; 00055 const void *getCylinderBottomVertexArrayAddress() const; 00057 const void *getCylinderSideVertexArrayAddress() const; 00059 const void *getCylinderTopVertexArrayAddress() const; 00061 const unsigned int *getCylinderBottomIndexArrayAddress() const; 00063 const unsigned int *getCylinderSideIndexArrayAddress() const; 00065 const unsigned int *getCylinderTopIndexArrayAddress() const; 00066 00067 private: 00068 unsigned int _section; 00069 00070 CylinderDrawArray(unsigned int section); 00071 00072 typedef struct 00073 { 00074 unsigned int count; 00075 CylinderDrawArray *ref; 00076 } data; 00077 00078 typedef std::list<std::pair<unsigned int, data> > refList; 00079 00080 static refList _refList; 00081 00082 std::vector<N3F_V3F> _cylinderBottomVertexArray; 00083 std::vector<N3F_V3F> _cylinderSideVertexArray; 00084 std::vector<N3F_V3F>_cylinderTopVertexArray; 00085 std::vector<unsigned int> _cylinderBottomIndexArray; 00086 std::vector<unsigned int> _cylinderSideIndexArray; 00087 std::vector<unsigned int> _cylinderTopIndexArray; 00088 }; 00089 00090 } 00091 } 00092 00093 #endif