1 #ifndef GfxTL__BBOXDISTANCEKDTREESTRATEGY_HEADER__
2 #define GfxTL__BBOXDISTANCEKDTREESTRATEGY_HEADER__
9 template <
class InheritedStrategyT>
12 typedef typename InheritedStrategyT::value_type
value_type;
14 class CellData :
public InheritedStrategyT::CellData
17 typedef typename InheritedStrategyT::CellData
BaseType;
23 m_bbox[0] = m_bbox[1] = NULL;
48 template <
class BaseT>
68 template <
class BuildInformationT>
72 BaseType::InitRoot(bi, cell);
73 cell->BBox()[0] =
new ScalarType[BaseType::m_dim];
74 cell->BBox()[1] =
new ScalarType[BaseType::m_dim];
75 BaseType::AssignVector(bi.BBox()[0], &cell->BBox()[0]);
76 BaseType::AssignVector(bi.BBox()[1], &cell->BBox()[1]);
79 template <
class BuildInformationT>
82 const BuildInformationT& parentInfo,
83 unsigned int childIdx,
84 const BuildInformationT& bi,
87 BaseType::InitCell(parent, parentInfo, childIdx, bi, cell);
88 cell->BBox()[0] =
new ScalarType[BaseType::m_dim];
89 cell->BBox()[1] =
new ScalarType[BaseType::m_dim];
90 BaseType::AssignVector(bi.BBox()[0], &cell->BBox()[0]);
91 BaseType::AssignVector(bi.BBox()[1], &cell->BBox()[1]);
94 template <
class TraversalInformationT>
98 BaseType::UpdateCellWithBack(ti, cell);
99 BaseType::IncludeInAABox(BaseType::back(), cell->BBox());
102 template <
class TraversalInformationT>
103 typename BaseType::template DistanceType<
109 return BaseType::BoxSqrDistance(
110 ti.Global().Point(), cell.BBox()[0], cell.BBox()[1]);