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