1 #ifndef GfxTL__CELLBBOXBUILDINFORMATIONKDTREESTRATEGY_HEADER__
2 #define GfxTL__CELLBBOXBUILDINFORMATIONKDTREESTRATEGY_HEADER__
6 template <
class InheritedStrategyT>
9 typedef typename InheritedStrategyT::value_type
value_type;
11 class CellData :
public InheritedStrategyT::CellData
15 template <
class BaseT>
68 m_cellBbox = cellBbox;
76 template <
class BuildInformationT>
80 BaseType::InitRootBuildInformation(bi);
87 typename BaseType::HandleType i = bi->Range().first;
88 this->AssignAsAABoxMin(this->at(this->Dereference(i)), &m_bbox[0]);
89 this->AssignAsAABoxMax(this->at(this->Dereference(i)), &m_bbox[1]);
90 for (++i; i != bi->Range().second; ++i)
92 this->IncludeInAABox(this->at(this->Dereference(i)), m_bbox);
97 template <
class BuildInformationT>
100 const BuildInformationT& parentInfo,
101 unsigned int childIdx,
102 BuildInformationT* bi)
104 BaseType::InitBuildInformation(parent, parentInfo, childIdx, bi);
105 bi->CellBBox(m_bbox);
108 template <
class BuildInformationT>
112 BaseType::EnterGlobalBuildInformation(cell, bi);
113 if (bi->CreateChild() == 0)
115 bi->OldBound() = m_bbox[1][cell.SplitAxis()];
116 m_bbox[1][cell.SplitAxis()] = cell.SplitValue();
120 bi->OldBound() = m_bbox[0][cell.SplitAxis()];
121 m_bbox[0][cell.SplitAxis()] = cell.SplitValue();
125 template <
class BuildInformationT>
129 BaseType::LeaveGlobalBuildInformation(cell, bi);
130 if (bi.CreateChild() == 1)
132 m_bbox[1][cell.SplitAxis()] = bi.OldBound();
136 m_bbox[0][cell.SplitAxis()] = bi.OldBound();