voxelTerrain
 All Classes Functions Variables Typedefs Enumerations Pages
base.hpp
1 #ifndef PROCEDURAL_VOXEL_TERRAIN_BASE_HPP
2 #define PROCEDURAL_VOXEL_TERRAIN_BASE_HPP
3 
4 #include "blub/async/predecl.hpp"
5 #include "blub/core/globals.hpp"
6 #include "blub/core/noncopyable.hpp"
7 #include "blub/core/scopedPtr.hpp"
8 #include "blub/core/vector.hpp"
9 #include "blub/procedural/predecl.hpp"
10 #include "blub/procedural/voxel/simple/base.hpp"
11 
12 #include <boost/function/function_fwd.hpp>
13 
14 
15 namespace blub
16 {
17 namespace procedural
18 {
19 namespace voxel
20 {
21 namespace terrain
22 {
23 
24 
29 template <class simpleType>
30 class base : public noncopyable
31 {
32 public:
33  typedef simpleType t_simple;
34  typedef t_simple* t_lod;
35  typedef vector<scopedPointer<t_simple> > t_lodList;
36  typedef typename t_simple::t_createTileCallback t_createTileCallback;
37 
41  base();
45  ~base();
46 
52  t_lod getLod(const uint16& lod) const;
57  const t_lodList& getLodList() const;
58 
63  int32 getNumLod() const;
64 
69  void setCreateTileCallback(const t_createTileCallback &toSet);
70 
71 protected:
72 
73 
74 protected:
78  t_lodList m_lods;
79 
80 };
81 
82 template <class tileType>
84 {
85  ;
86 }
87 template <class tileType>
89 {
90  ;
91 }
92 
93 template <class tileType>
94 typename base<tileType>::t_lod base<tileType>::getLod(const uint16 &lod) const
95 {
96  BASSERT(lod < m_lods.size());
97  return m_lods[lod].get();
98 }
99 
100 template <class tileType>
102 {
103  return m_lods;
104 }
105 
106 template <class tileType>
108 {
109  return m_lods.size();
110 }
111 
112 template <class tileType>
113 void base<tileType>::setCreateTileCallback(const t_createTileCallback &toSet)
114 {
115  for (typename t_lodList::value_type &lod : m_lods)
116  {
117  lod->setCreateTileCallback(toSet);
118  }
119 }
120 
121 
122 }
123 }
124 }
125 }
126 
127 
128 #endif // PROCEDURAL_VOXEL_TERRAIN_BASE_HPP
t_lod getLod(const uint16 &lod) const
getLod returns a level of detail.
Definition: base.hpp:94
const t_lodList & getLodList() const
getLodList returns all level of details.
Definition: base.hpp:101
t_lodList m_lods
m_lods container for the lods.
Definition: base.hpp:78
void setCreateTileCallback(const t_createTileCallback &toSet)
setCreateTileCallback sets the callback for creating tiles to the lods.
Definition: base.hpp:113
base()
base contructor
Definition: base.hpp:83
int32 getNumLod() const
getNumLod returns number of level of details.
Definition: base.hpp:107
~base()
~base destructor
Definition: base.hpp:88
Definition: deadlineTimer.hpp:10