![]() |
PhoenixGraph
01.0.0
Set of tools to simplify graph manipulation
|
Describe a Quad tree. More...
#include <PNTreeLightNode.h>
Public Member Functions | |
bool | addElement (T *posData, U *data, const T pos[N], const T size[N], const T sizeLimit) |
Add an element in the PNTreeLightNode. | |
void | clear () |
Clear the PNTreeLightNode content. | |
PNTreeLightNode< T, U, N > * | getChild (unsigned char childId) |
Returns the child of the PNTreeLightNode. | |
const PNTreeLightNode< T, U, N > * | getChild (unsigned char childId) const |
Returns the child of the PNTreeLightNode. | |
PNTreeLightNode< T, U, N > * | getChildFromPos (T childPos[N], const T *posData, const T pos[N], const T size[N]) |
Get the child of the PNTreeLightNode with a position. | |
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. | |
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. | |
U * | getData () |
const U * | getData () const |
T * | getDataPos () |
Returns the data position. | |
const T * | getDataPos () const |
Returns the data position. | |
unsigned char | getFullIndexChild (unsigned char index[N]) const |
Get the full index position of a child. | |
void | getIndexOfChildFromPos (unsigned char index[N], const T posData[N], const T pos[N], const T size[N]) const |
void | getIndexOfChildFromPos (unsigned char index[N], T posData[N], T pos[N], T size[N]) |
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. | |
PNTreeLightNode< T, U, N > * | getTabChildren () |
Returns the table of children of the PNTreeLightNode. | |
const PNTreeLightNode< T, U, N > * | getTabChildren () const |
Returns the table of children of the PNTreeLightNode. | |
PNTreeLightNode () | |
Default constructor of PNTreeLightNode. | |
bool | saveGnuplotData (const std::string &fileName, T pos[N], T size[N]) |
Saves the PNTreeLightNode into a txt file for gnuplot. | |
bool | saveGnuplotData (std::ofstream &fs, T height, T pos[N], T size[N]) |
Saves the PNTreeLightNode into a txt file for gnuplot. | |
virtual | ~PNTreeLightNode () |
Destructeur of PNTreeLightNode. | |
Protected Member Functions | |
void | copyPNTreeLightNode (const PNTreeLightNode< T, U, N > &other) |
Copy function of PNTreeLightNode. | |
Private Member Functions | |
void | initialisationPNTreeLightNode () |
Initialisation function of the class PNTreeLightNode. | |
PNTreeLightNode (const PNTreeLightNode< T, U, N > &other) | |
Copy constructor of PNTreeLightNode. | |
bool | split (const T pos[N], const T size[N], T sizeLimit) |
Split the PNTreeLightNode. | |
Private Attributes | |
U * | p_data |
Data of the node. | |
T * | p_posData |
Position of the data in the cell. | |
PNTreeLightNode< T, U, N > * | p_tableChildren |
Position of the data in the hyper cube. | |
Describe a Quad tree.
T : Type of the positions U : type of the data pointors to be stored N : number of dimensions of the N Tree
Definition at line 22 of file PNTreeLightNode.h.
PNTreeLightNode< T, U, N >::PNTreeLightNode | ( | ) |
Default constructor of PNTreeLightNode.
Definition at line 19 of file PNTreeLightNode_impl.h.
References initialisationPNTreeLightNode().
Referenced by addElement(), clear(), copyPNTreeLightNode(), getChild(), getChild(), getChildFromPos(), getChildFromPos(), getCloserData(), getData(), getIndexOfChildFromPos(), getLastData(), getTabChildren(), getTabChildren(), PNTreeLightNode(), and split().
|
virtual |
Destructeur of PNTreeLightNode.
Definition at line 33 of file PNTreeLightNode_impl.h.
References clear().
|
private |
Copy constructor of PNTreeLightNode.
other | : class to copy |
Definition at line 27 of file PNTreeLightNode_impl.h.
References copyPNTreeLightNode(), and PNTreeLightNode().
bool PNTreeLightNode< T, U, N >::addElement | ( | T * | posData, |
U * | data, | ||
const T | pos[N], | ||
const T | size[N], | ||
const T | sizeLimit ) |
Add an element in the PNTreeLightNode.
posData | : position of the data |
data | : pointer to the data we want to sort |
pos | : position of the current node |
size | : size of the current node |
sizeLimit | : limit of the cell size |
Definition at line 70 of file PNTreeLightNode_impl.h.
References addElement(), checkSizeLimitLight(), getChildFromPos(), makeHalfSize(), p_data, p_posData, p_tableChildren, PNTreeLightNode(), and split().
Referenced by addElement(), and split().
void PNTreeLightNode< T, U, N >::clear | ( | ) |
Clear the PNTreeLightNode content.
Definition at line 176 of file PNTreeLightNode_impl.h.
References clear(), p_data, p_tableChildren, and PNTreeLightNode().
Referenced by clear(), and ~PNTreeLightNode().
|
protected |
Copy function of PNTreeLightNode.
other | : class to copy |
Definition at line 453 of file PNTreeLightNode_impl.h.
References PNTreeLightNode().
Referenced by PNTreeLightNode().
PNTreeLightNode< T, U, N > * PNTreeLightNode< T, U, N >::getChild | ( | unsigned char | childId | ) |
Returns the child of the PNTreeLightNode.
childId | : id of the child we want to have |
Definition at line 444 of file PNTreeLightNode_impl.h.
References p_tableChildren, PNTreeLightNode(), and PPower< V, N >::Value.
const PNTreeLightNode< T, U, N > * PNTreeLightNode< T, U, N >::getChild | ( | unsigned char | childId | ) | const |
Returns the child of the PNTreeLightNode.
childId | : id of the child we want to have |
Definition at line 434 of file PNTreeLightNode_impl.h.
References p_tableChildren, PNTreeLightNode(), and PPower< V, N >::Value.
PNTreeLightNode< T, U, N > * PNTreeLightNode< T, U, N >::getChildFromPos | ( | T | childPos[N], |
const T * | posData, | ||
const T | pos[N], | ||
const T | size[N] ) |
Get the child of the PNTreeLightNode with a position.
[out] | childPos | : position of the child |
posData | : position of the data | |
pos | : position of the current node | |
size | : size of the current node |
Definition at line 346 of file PNTreeLightNode_impl.h.
References p_tableChildren, PNTreeLightNode(), and PPower< V, N >::Value.
const PNTreeLightNode< T, U, N > * 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.
[out] | childPos | : position of the child |
posData | : position of the data | |
pos | : position of the current node | |
size | : size of the current node |
Definition at line 324 of file PNTreeLightNode_impl.h.
References p_tableChildren, PNTreeLightNode(), and PPower< V, N >::Value.
Referenced by addElement(), getCloserData(), getLastData(), and split().
bool PNTreeLightNode< T, U, N >::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.
[out] | closerData | : pointer to the closer data found |
[out] | distFromCloserData | : distance from the closer data to the search position posData |
[out] | tabIsNeighbourChecked | : table of the checked neighbours (true), or unchecked neighbours (false) |
nbNeighbour | : size of the table of neighbours | |
posData | : position used to search the closer data | |
pos | : position of the current node | |
size | : size of the current node |
Definition at line 258 of file PNTreeLightNode_impl.h.
References getChildFromPos(), getCloserData(), getDistanceFromData(), getFullIndexChild(), getIndexOfChildFromPos(), getNeighbourCellIndex(), isNeighbourSearchFinised(), makeHalfSize(), p_data, p_posData, p_tableChildren, and PNTreeLightNode().
Referenced by getCloserData().
U * PNTreeLightNode< T, U, N >::getData | ( | ) |
const U * PNTreeLightNode< T, U, N >::getData | ( | ) | const |
T * PNTreeLightNode< T, U, N >::getDataPos | ( | ) |
Returns the data position.
Definition at line 415 of file PNTreeLightNode_impl.h.
References p_posData.
const T * PNTreeLightNode< T, U, N >::getDataPos | ( | ) | const |
Returns the data position.
Definition at line 409 of file PNTreeLightNode_impl.h.
References p_posData.
unsigned char PNTreeLightNode< T, U, N >::getFullIndexChild | ( | unsigned char | index[N] | ) | const |
Get the full index position of a child.
index | : vector of index position of a child |
Definition at line 396 of file PNTreeLightNode_impl.h.
Referenced by getCloserData().
void PNTreeLightNode< T, U, N >::getIndexOfChildFromPos | ( | unsigned char | index[N], |
const T | posData[N], | ||
const T | pos[N], | ||
const T | size[N] ) const |
void PNTreeLightNode< T, U, N >::getIndexOfChildFromPos | ( | unsigned char | index[N], |
T | posData[N], | ||
T | pos[N], | ||
T | size[N] ) |
const U * PNTreeLightNode< T, U, N >::getLastData | ( | const T * | posData, |
const T | pos[N], | ||
const T | size[N] ) const |
Get the data of the last node in the N tree.
posData | : position of the data |
pos | : position of the current node |
size | : size of the current node |
Definition at line 195 of file PNTreeLightNode_impl.h.
References getChildFromPos(), getLastData(), makeHalfSize(), p_data, p_tableChildren, and PNTreeLightNode().
Referenced by getLastData().
PNTreeLightNode< T, U, N > * PNTreeLightNode< T, U, N >::getTabChildren | ( | ) |
Returns the table of children of the PNTreeLightNode.
Definition at line 427 of file PNTreeLightNode_impl.h.
References p_tableChildren, and PNTreeLightNode().
const PNTreeLightNode< T, U, N > * PNTreeLightNode< T, U, N >::getTabChildren | ( | ) | const |
Returns the table of children of the PNTreeLightNode.
Definition at line 421 of file PNTreeLightNode_impl.h.
References p_tableChildren, and PNTreeLightNode().
|
private |
Initialisation function of the class PNTreeLightNode.
Definition at line 499 of file PNTreeLightNode_impl.h.
References p_data, p_posData, and p_tableChildren.
Referenced by PNTreeLightNode().
bool PNTreeLightNode< T, U, N >::saveGnuplotData | ( | const std::string & | fileName, |
T | pos[N], | ||
T | size[N] ) |
Saves the PNTreeLightNode into a txt file for gnuplot.
fileName | : name of the text file we want to write |
pos | : position of the current node |
size | : size of the current node |
Definition at line 103 of file PNTreeLightNode_impl.h.
References saveGnuplotData().
Referenced by saveGnuplotData().
bool PNTreeLightNode< T, U, N >::saveGnuplotData | ( | std::ofstream & | fs, |
T | height, | ||
T | pos[N], | ||
T | size[N] ) |
Saves the PNTreeLightNode into a txt file for gnuplot.
fs | : text file we want to write |
height | : height of the quad to draw |
pos | : position of the current node |
size | : size of the current node |
Definition at line 121 of file PNTreeLightNode_impl.h.
References makeHalfSize(), and p_tableChildren.
|
private |
Split the PNTreeLightNode.
pos | : position of the current node |
size | : size of the current node |
sizeLimit | : limit of the cell size |
Definition at line 464 of file PNTreeLightNode_impl.h.
References addElement(), checkSizeLimitLight(), getChildFromPos(), makeHalfSize(), p_data, p_posData, p_tableChildren, PNTreeLightNode(), and PPower< V, N >::Value.
Referenced by addElement().
|
private |
Data of the node.
Definition at line 66 of file PNTreeLightNode.h.
Referenced by addElement(), clear(), getCloserData(), getLastData(), initialisationPNTreeLightNode(), and split().
|
private |
Position of the data in the cell.
Definition at line 64 of file PNTreeLightNode.h.
Referenced by addElement(), getCloserData(), getDataPos(), getDataPos(), initialisationPNTreeLightNode(), and split().
|
private |
Position of the data in the hyper cube.
Definition at line 68 of file PNTreeLightNode.h.
Referenced by addElement(), clear(), getChild(), getChild(), getChildFromPos(), getChildFromPos(), getCloserData(), getLastData(), getTabChildren(), getTabChildren(), initialisationPNTreeLightNode(), saveGnuplotData(), and split().