1 #ifndef SCOREAACUBETREESTRATEGY_HEADER
2 #define SCOREAACUBETREESTRATEGY_HEADER
9 template<
unsigned int DimT,
class InheritedStrategyT >
12 typedef typename InheritedStrategyT::value_type
value_type;
15 :
public InheritedStrategyT::CellData
36 template<
class BaseT >
38 :
public InheritedStrategyT::template
StrategyBase< BaseT >
47 template<
class ShapeT,
class ScoreT >
51 typedef typename BaseType::template
52 TraversalInformationBase< GfxTL::NullClass > tibT;
53 typedef typename BaseType::template
54 CellCenterTraversalInformation< tibT > TraversalInformation;
55 TraversalInformation ti;
56 this->InitRootTraversalInformation(*BaseType::Root(), &ti);
57 Score(*BaseType::Root(), ti, shape, score);
61 template<
class BuildInformationT >
64 BaseType::InitRoot(bi, root);
65 root->Radius() = bi.Cube().DiagLength() / 2;
67 template<
class BuildInformationT >
69 unsigned int child,
const BuildInformationT& bi,
72 BaseType::InitCell(parent, pbi, child, bi, cell);
73 cell->Radius() = bi.Cube().DiagLength() / 2;
77 template<
class TraversalInformationT,
class ShapeT,
class ScoreT >
78 void Score(
const CellType& cell,
const TraversalInformationT& ti,
79 const ShapeT& shape, ScoreT* score)
const
81 if ( this->IsLeaf(cell))
94 for (
typename BaseType::HandleType h = cell.Range().first;
95 h != cell.Range().second; ++h)
97 (*score)(shape, *
this, this->Dereference(h));
102 for (
unsigned int i = 0; i < CellType::NChildren; ++i)
104 if (!this->ExistChild(cell, i))
108 TraversalInformationT cti;
109 this->InitTraversalInformation(cell, ti, i, &cti);
113 if (dist < cell[i].Radius() + score->Epsilon())
115 Score(cell[i], cti, shape, score);