BucketSizeSubdivisionTreeStrategy.h
Go to the documentation of this file.
1#ifndef GfxTL__BUCKETSIZESUBDIVISIONTREESTRATEGY_HEADER__
2#define GfxTL__BUCKETSIZESUBDIVISIONTREESTRATEGY_HEADER__
3
4namespace GfxTL
5{
6 template <class InheritedStrategyT>
8 {
9 typedef typename InheritedStrategyT::value_type value_type;
10
11 struct CellData : public InheritedStrategyT::CellData
12 {
13 };
14
15 template <class BaseT>
16 class StrategyBase : public InheritedStrategyT::template StrategyBase<BaseT>
17 {
18 public:
19 typedef typename InheritedStrategyT::template StrategyBase<BaseT> BaseType;
20 typedef typename BaseType::CellType CellType;
21
22 StrategyBase() : m_maxBucketSize(10)
23 {
24 }
25
26 void
27 InitMaxBucketSize(size_t size)
28 {
29 m_maxBucketSize = size;
30 }
31
32 size_t&
34 {
35 return m_maxBucketSize;
36 }
37
38 const size_t
40 {
41 return m_maxBucketSize;
42 }
43
44 protected:
45 template <class BuildInformationT>
46 bool
47 ShouldSubdivide(const CellType& cell, const BuildInformationT& bi) const
48 {
49 return cell.Size() > m_maxBucketSize;
50 }
51
52 private:
53 size_t m_maxBucketSize;
54 };
55 };
56}; // namespace GfxTL
57
58#endif
InheritedStrategyT::template StrategyBase< BaseT > BaseType
bool ShouldSubdivide(const CellType &cell, const BuildInformationT &bi) const
Definition AABox.h:10