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