CellCenterAACubeTreeStrategy.h
Go to the documentation of this file.
1#ifndef GfxTL__CELLCENTERAACUBETREESTRATEGY_HEADER__
2#define GfxTL__CELLCENTERAACUBETREESTRATEGY_HEADER__
4#include <GfxTL/VectorXD.h>
5
6namespace GfxTL
7{
8 template <unsigned int DimT, class InheritedStrategyT>
10 {
11 typedef typename InheritedStrategyT::value_type value_type;
12
13 class CellData : public InheritedStrategyT::CellData
14 {
15 public:
17
19 Center() const
20 {
21 return m_center;
22 }
23
26 {
27 return m_center;
28 }
29
30 private:
32 };
33
34 template <class BaseT>
35 class StrategyBase : public InheritedStrategyT::template StrategyBase<BaseT>
36 {
37 public:
38 typedef typename InheritedStrategyT::template StrategyBase<BaseT> BaseType;
39 typedef typename BaseType::CellType CellType;
41
42 protected:
44
45 template <class BaseTraversalT>
46 class CellCenterTraversalInformation : public BaseTraversalT
47 {
48 };
49
50 template <class BuildInformationT>
51 void
52 InitRoot(const BuildInformationT& bi, CellType* root)
53 {
54 BaseType::InitRoot(bi, root);
55 bi.Cube().Center(&root->Center());
56 }
57
58 template <class BuildInformationT>
59 void
60 InitCell(const CellType& parent,
61 const BuildInformationT& pbi,
62 unsigned int child,
63 const BuildInformationT& bi,
64 CellType* cell)
65 {
66 BaseType::InitCell(parent, pbi, child, bi, cell);
67 bi.Cube().Center(&cell->Center());
68 }
69
70 template <class TraversalInformationT>
71 void
72 CellCenter(const CellType& cell,
73 const TraversalInformationT&,
74 CellCenterType* center) const
75 {
76 *center = cell.Center();
77 }
78 };
79 };
80}; // namespace GfxTL
81
82#endif
GfxTL::ScalarTypeDeferer< value_type >::ScalarType ScalarType
const GfxTL::VectorXD< DimT, ScalarType > & Center() const
GfxTL::ScalarTypeDeferer< value_type >::ScalarType ScalarType
void InitCell(const CellType &parent, const BuildInformationT &pbi, unsigned int child, const BuildInformationT &bi, CellType *cell)
void InitRoot(const BuildInformationT &bi, CellType *root)
void CellCenter(const CellType &cell, const TraversalInformationT &, CellCenterType *center) const
InheritedStrategyT::template StrategyBase< BaseT > BaseType
Definition AABox.h:10
PointT::value_type ScalarType