1 #ifndef GfxTL__CELLBBOXBUILDINFORMATIONKDTREESTRATEGY_HEADER__
2 #define GfxTL__CELLBBOXBUILDINFORMATIONKDTREESTRATEGY_HEADER__
6 template<
class InheritedStrategyT >
9 typedef typename InheritedStrategyT::value_type
value_type;
12 :
public InheritedStrategyT::CellData
15 template<
class BaseT >
17 :
public InheritedStrategyT::template
StrategyBase< BaseT >
47 :
public BaseType::BuildInformation
64 m_cellBbox = cellBbox;
72 template<
class BuildInformationT >
75 BaseType::InitRootBuildInformation(bi);
82 typename BaseType::HandleType i = bi->Range().first;
83 this->AssignAsAABoxMin(this->at(this->Dereference(i)), &m_bbox[0]);
84 this->AssignAsAABoxMax(this->at(this->Dereference(i)), &m_bbox[1]);
85 for (++i; i != bi->Range().second; ++i)
87 this->IncludeInAABox(this->at(this->Dereference(i)), m_bbox);
92 template<
class BuildInformationT >
94 const BuildInformationT& parentInfo,
unsigned int childIdx,
95 BuildInformationT* bi)
97 BaseType::InitBuildInformation(parent, parentInfo, childIdx, bi);
101 template<
class BuildInformationT >
103 BuildInformationT* bi)
105 BaseType::EnterGlobalBuildInformation(cell, bi);
106 if (bi->CreateChild() == 0)
108 bi->OldBound() = m_bbox[1][cell.SplitAxis()];
109 m_bbox[1][cell.SplitAxis()] = cell.SplitValue();
113 bi->OldBound() = m_bbox[0][cell.SplitAxis()];
114 m_bbox[0][cell.SplitAxis()] = cell.SplitValue();
118 template<
class BuildInformationT >
120 const BuildInformationT& bi)
122 BaseType::LeaveGlobalBuildInformation(cell, bi);
123 if (bi.CreateChild() == 1)
125 m_bbox[1][cell.SplitAxis()] = bi.OldBound();
129 m_bbox[0][cell.SplitAxis()] = bi.OldBound();