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