7#ifndef __PNTREELIGHT_H_IMPL__
8#define __PNTREELIGHT_H_IMPL__
15template<
typename T,
typename U,
unsigned char N>
25template<
typename T,
typename U,
unsigned char N>
33template<
typename T,
typename U,
unsigned char N>
39template<
typename T,
typename U,
unsigned char N>
48template<
typename T,
typename U,
unsigned char N>
58template<
typename T,
typename U,
unsigned char N>
66template<
typename T,
typename U,
unsigned char N>
68 memcpy(
p_pos, pos, N*
sizeof(T));
74template<
typename T,
typename U,
unsigned char N>
76 memcpy(
p_size, size, N*
sizeof(T));
82template<
typename T,
typename U,
unsigned char N>
92template<
typename T,
typename U,
unsigned char N>
101template<
typename T,
typename U,
unsigned char N>
110template<
typename T,
typename U,
unsigned char N>
113 bool tabNeighbour[nbNeighbours];
114 for(
unsigned int i(0u); i < nbNeighbours; ++i){
115 tabNeighbour[i] =
false;
117 tabNeighbour[nbNeighbours/2] =
true;
118 U * closerData = NULL;
119 T distFromCloserData = 0.0;
120 p_node.getCloserData(closerData, distFromCloserData, tabNeighbour, nbNeighbours, posData,
p_pos,
p_size);
129template<
typename T,
typename U,
unsigned char N>
132 bool tabNeighbour[nbNeighbours];
133 for(
unsigned int i(0u); i < nbNeighbours; ++i){
134 tabNeighbour[i] =
false;
136 tabNeighbour[nbNeighbours/2] =
true;
137 U * closerData = NULL;
138 distFromCloserData = 0.0;
139 p_node.getCloserData(closerData, distFromCloserData, tabNeighbour, nbNeighbours, posData,
p_pos,
p_size);
147template<
typename T,
typename U,
unsigned char N>
156template<
typename T,
typename U,
unsigned char N>
166template<
typename T,
typename U,
unsigned char N>
void setPosition(T pos[N])
Set the position of the PNTreeLight.
virtual ~PNTreeLight()
Destructeur of PNTreeLight.
PNTreeLight & operator=(const PNTreeLight< T, U, N > &other)
Definition of equal operator of PNTreeLight.
PNTreeLight()
Default constructeur of PNTreeLight.
bool saveGnuplotData(const std::string &fileName)
Saves the PNTreeLight into a txt file for gnuplot.
T p_pos[N]
Position of the hyper cube.
T p_sizeLimit
Size limit of the cells.
const U * getLastData(T *posData) const
Get the data of the last node in the N tree.
void copyPNTreeLight(const PNTreeLight< T, U, N > &other)
Copy function of PNTreeLight.
T p_size[N]
Size of the hyper cube.
PNTreeLightNode< T, U, N > p_node
Table of the children of the current node.
const U * getCloserData(T *posData) const
Get the closer data from the given position.
void setSize(T size[N])
Set the size of the PNTreeLight.
const U * getCloserDataDist(T &distFromCloserData, T *posData) const
Get the closer data from the given position.
bool addElement(T *posData, U *data)
Add an element in the PNTreeLightNode.
void setLimitSize(T limitSize)
Set the limit size of the PNTreeLight cells.
void initialisationPNTreeLight(T pos[N], T size[N], T sizeLimit)
Initialisation function of the class PNTreeLight.