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