7#ifndef __PNTREE_LIGHT_NODE_H__
8#define __PNTREE_LIGHT_NODE_H__
13template<
typename T,
typename U,
unsigned char N>
21template<
typename T,
typename U,
unsigned char N>
27 bool addElement(T * posData, U * data,
const T pos[N],
const T size[N],
const T sizeLimit);
30 bool saveGnuplotData(
const std::string & fileName, T pos[N], T size[N]);
31 bool saveGnuplotData(std::ofstream & fs, T height, T pos[N], T size[N]);
39 const U *
getLastData(
const T * posData,
const T pos[N],
const T size[N])
const;
40 bool getCloserData(U*& closerData, T & distFromCloserData,
bool * tabIsNeighbourChecked,
unsigned int nbNeighbour,
41 const T * posData,
const T pos[N],
const T size[N])
const;
60 bool split(
const T pos[N],
const T size[N], T sizeLimit);
bool isNeighbourSearchFinised(const bool *tabIsNeighbourChecked, unsigned int nbNeighbour)
Says is the neighbours search is finised.
virtual ~PNTreeLightNode()
Destructeur of PNTreeLightNode.
void getIndexOfChildFromPos(unsigned char index[N], const T posData[N], const T pos[N], const T size[N]) const
void copyPNTreeLightNode(const PNTreeLightNode< T, U, N > &other)
Copy function of PNTreeLightNode.
PNTreeLightNode< T, U, N > * p_tableChildren
Position of the data in the hyper cube.
unsigned char getFullIndexChild(unsigned char index[N]) const
Get the full index position of a child.
PNTreeLightNode()
Default constructor of PNTreeLightNode.
const T * getDataPos() const
Returns the data position.
const PNTreeLightNode< T, U, N > * getChild(unsigned char childId) const
Returns the child of the PNTreeLightNode.
bool addElement(T *posData, U *data, const T pos[N], const T size[N], const T sizeLimit)
Add an element in the PNTreeLightNode.
bool split(const T pos[N], const T size[N], T sizeLimit)
Split the PNTreeLightNode.
void initialisationPNTreeLightNode()
Initialisation function of the class PNTreeLightNode.
void clear()
Clear the PNTreeLightNode content.
bool getCloserData(U *&closerData, T &distFromCloserData, bool *tabIsNeighbourChecked, unsigned int nbNeighbour, const T *posData, const T pos[N], const T size[N]) const
Get the closer data from the given position posData.
const U * getData() const
const PNTreeLightNode< T, U, N > * getTabChildren() const
Returns the table of children of the PNTreeLightNode.
U * p_data
Data of the node.
void getIndexOfChildFromPos(unsigned char index[N], T posData[N], T pos[N], T size[N])
bool saveGnuplotData(const std::string &fileName, T pos[N], T size[N])
Saves the PNTreeLightNode into a txt file for gnuplot.
const U * getLastData(const T *posData, const T pos[N], const T size[N]) const
Get the data of the last node in the N tree.
T * p_posData
Position of the data in the cell.
const PNTreeLightNode< T, U, N > * getChildFromPos(T childPos[N], const T *posData, const T pos[N], const T size[N]) const
Get the child of the PNTreeLightNode with a position.