00001
00002
00004
00005 #ifndef SPHEREARRAY_H
00006 #define SPHEREARRAY_H
00007
00008 #include "X3DTypes.h"
00009 #include "X3DGLTypes.h"
00010
00011 #include <vector>
00012
00013 namespace X3DTK {
00014 namespace GL {
00015
00018
00019 class SphereDrawArray
00020 {
00021 public:
00023 static SphereDrawArray *getInstanceOfSection(unsigned int section);
00025 void removeInstance();
00026
00027
00029 unsigned int getSphereSize() const;
00031 const void *getSphereVertexArrayAddress() const;
00033 const unsigned int *getSphereIndexArrayAddress() const;
00034
00035 private:
00036 unsigned int _section;
00037
00040 SphereDrawArray(unsigned int section);
00041
00042 typedef struct
00043 {
00044 unsigned int count;
00045 SphereDrawArray *ref;
00046 } data;
00047
00048 typedef std::list<std::pair<unsigned int, data> > refList;
00049
00050 static refList _refList;
00051
00052 std::vector<N3F_V3F> _sphereVertexArray;
00053 std::vector<unsigned int> _sphereIndexArray;
00054 };
00055
00056 }
00057 }
00058
00059 #endif