LevelBuildInformationTreeStrategy.h
Go to the documentation of this file.
1 #ifndef GfxTL__LEVELBUILDINFORMATIONTREESTRATEGY_HEADER__
2 #define GfxTL__LEVELBUILDINFORMATIONTREESTRATEGY_HEADER__
3 
4 namespace GfxTL
5 {
6  template< class InheritedStrategyT >
8  {
9  typedef typename InheritedStrategyT::value_type value_type;
10  struct CellData
11  : public InheritedStrategyT::CellData
12  {};
13 
14  template< class BaseT >
16  : public InheritedStrategyT::template StrategyBase< BaseT >
17  {
18 public:
19  typedef typename InheritedStrategyT::template StrategyBase< BaseT >
21  typedef typename BaseType::CellType CellType;
22 
23 protected:
25  : public BaseType::BuildInformation
26  {
27  public:
28  size_t Level() const
29  {
30  return m_level;
31  }
32  void Level(size_t l)
33  {
34  m_level = l;
35  }
36  private:
37  size_t m_level;
38  };
39 
40  template< class BuildInformationT >
41  void InitRootBuildInformation(BuildInformationT* bi)
42  {
43  BaseType::InitRootBuildInformation(bi);
44  bi->Level(0);
45  }
46 
47  template< class BuildInformationT >
48  void InitBuildInformation(const CellType& parent,
49  const BuildInformationT& parentInfo, unsigned int childIdx,
50  BuildInformationT* bi) const
51  {
52  BaseType::InitBuildInformation(parent, parentInfo, childIdx,
53  bi);
54  bi->Level(parentInfo.Level() + 1);
55  }
56  };
57  };
58 };
59 
60 #endif
GfxTL::LevelBuildInformationTreeStrategy::StrategyBase::InitRootBuildInformation
void InitRootBuildInformation(BuildInformationT *bi)
Definition: LevelBuildInformationTreeStrategy.h:41
GfxTL::LevelBuildInformationTreeStrategy::StrategyBase::CellType
BaseType::CellType CellType
Definition: LevelBuildInformationTreeStrategy.h:21
GfxTL::LevelBuildInformationTreeStrategy
Definition: LevelBuildInformationTreeStrategy.h:7
GfxTL::LevelBuildInformationTreeStrategy::StrategyBase::BaseType
InheritedStrategyT::template StrategyBase< BaseT > BaseType
Definition: LevelBuildInformationTreeStrategy.h:20
GfxTL::LevelBuildInformationTreeStrategy::StrategyBase::InitBuildInformation
void InitBuildInformation(const CellType &parent, const BuildInformationT &parentInfo, unsigned int childIdx, BuildInformationT *bi) const
Definition: LevelBuildInformationTreeStrategy.h:48
GfxTL::LevelBuildInformationTreeStrategy::StrategyBase::BuildInformation::Level
void Level(size_t l)
Definition: LevelBuildInformationTreeStrategy.h:32
GfxTL::LevelBuildInformationTreeStrategy::CellData
Definition: LevelBuildInformationTreeStrategy.h:10
GfxTL
Definition: AABox.h:8
GfxTL::LevelBuildInformationTreeStrategy::value_type
InheritedStrategyT::value_type value_type
Definition: LevelBuildInformationTreeStrategy.h:9
GfxTL::LevelBuildInformationTreeStrategy::StrategyBase::BuildInformation::Level
size_t Level() const
Definition: LevelBuildInformationTreeStrategy.h:28
GfxTL::LevelBuildInformationTreeStrategy::StrategyBase
Definition: LevelBuildInformationTreeStrategy.h:15
GfxTL::LevelBuildInformationTreeStrategy::StrategyBase::BuildInformation
Definition: LevelBuildInformationTreeStrategy.h:24