BucketSizeSubdivisionTreeStrategy.h
Go to the documentation of this file.
1 #ifndef GfxTL__BUCKETSIZESUBDIVISIONTREESTRATEGY_HEADER__
2 #define GfxTL__BUCKETSIZESUBDIVISIONTREESTRATEGY_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  {}
27  void InitMaxBucketSize(size_t size)
28  {
29  m_maxBucketSize = size;
30  }
31  size_t& MaxBucketSize()
32  {
33  return m_maxBucketSize;
34  }
35  const size_t MaxBucketSize() const
36  {
37  return m_maxBucketSize;
38  }
39 
40 protected:
41  template< class BuildInformationT >
42  bool ShouldSubdivide(const CellType& cell,
43  const BuildInformationT& bi) const
44  {
45  return cell.Size() > m_maxBucketSize;
46  }
47 
48 private:
49  size_t m_maxBucketSize;
50  };
51  };
52 };
53 
54 #endif
GfxTL::BucketSizeSubdivisionTreeStrategy::StrategyBase::ShouldSubdivide
bool ShouldSubdivide(const CellType &cell, const BuildInformationT &bi) const
Definition: BucketSizeSubdivisionTreeStrategy.h:42
GfxTL::BucketSizeSubdivisionTreeStrategy::StrategyBase::StrategyBase
StrategyBase()
Definition: BucketSizeSubdivisionTreeStrategy.h:24
GfxTL::BucketSizeSubdivisionTreeStrategy
Definition: BucketSizeSubdivisionTreeStrategy.h:7
GfxTL::BucketSizeSubdivisionTreeStrategy::StrategyBase::MaxBucketSize
const size_t MaxBucketSize() const
Definition: BucketSizeSubdivisionTreeStrategy.h:35
GfxTL::BucketSizeSubdivisionTreeStrategy::StrategyBase::MaxBucketSize
size_t & MaxBucketSize()
Definition: BucketSizeSubdivisionTreeStrategy.h:31
GfxTL::BucketSizeSubdivisionTreeStrategy::StrategyBase::InitMaxBucketSize
void InitMaxBucketSize(size_t size)
Definition: BucketSizeSubdivisionTreeStrategy.h:27
GfxTL::BucketSizeSubdivisionTreeStrategy::StrategyBase
Definition: BucketSizeSubdivisionTreeStrategy.h:16
GfxTL
Definition: AABox.h:8
GfxTL::BucketSizeSubdivisionTreeStrategy::StrategyBase::CellType
BaseType::CellType CellType
Definition: BucketSizeSubdivisionTreeStrategy.h:22
GfxTL::BucketSizeSubdivisionTreeStrategy::value_type
InheritedStrategyT::value_type value_type
Definition: BucketSizeSubdivisionTreeStrategy.h:9
GfxTL::BucketSizeSubdivisionTreeStrategy::CellData
Definition: BucketSizeSubdivisionTreeStrategy.h:11
GfxTL::BucketSizeSubdivisionTreeStrategy::StrategyBase::BaseType
InheritedStrategyT::template StrategyBase< BaseT > BaseType
Definition: BucketSizeSubdivisionTreeStrategy.h:21