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