00001
00002
00003
00005
00006
00011
00016
00021
00023
00024 #ifndef SPHEREARRAY_H
00025 #define SPHEREARRAY_H
00026
00027 #include "X3DTypes.h"
00028 #include "X3DGLTypes.h"
00029
00030 #include <vector>
00031
00032 namespace X3DTK {
00033 namespace GL {
00034
00037
00038 class SphereDrawArray
00039 {
00040 public:
00042 static SphereDrawArray *getInstanceOfSection(unsigned int section);
00044 void removeInstance();
00045
00046
00048 unsigned int getSphereSize() const;
00050 const void *getSphereVertexArrayAddress() const;
00052 const unsigned int *getSphereIndexArrayAddress() const;
00053
00054 private:
00055 unsigned int _section;
00056
00059 SphereDrawArray(unsigned int section);
00060
00061 typedef struct
00062 {
00063 unsigned int count;
00064 SphereDrawArray *ref;
00065 } data;
00066
00067 typedef std::list<std::pair<unsigned int, data> > refList;
00068
00069 static refList _refList;
00070
00071 std::vector<N3F_V3F> _sphereVertexArray;
00072 std::vector<unsigned int> _sphereIndexArray;
00073 };
00074
00075 }
00076 }
00077
00078 #endif