cgma
|
#include <KDDTreeNode.hpp>
Public Member Functions | |
KDDTreeNode (Y aData, DIMENSION aDisc=DIMX) | |
~KDDTreeNode () | |
KDDTreeNode< Y > * | get_child (DIRECTION dir) const |
void | set_child (KDDTreeNode< Y > *node, DIRECTION dir) |
double | get_dist () const |
void | set_dist (double dist) |
DISTDATA | get_dist_data () const |
void | set_dist_data (DISTDATA distData) |
DIMENSION | get_disc () const |
void | set_disc (DIMENSION dim) |
DIMENSION | next_disc () const |
DIRECTION | compare (KDDTreeNode< Y > *Q) const |
DIRECTION | compare_with_equality (KDDTreeNode< Y > *Q) const |
Public Attributes | |
KDDTreeNode< Y > * | parent |
KDDTreeNode< Y > * | left |
KDDTreeNode< Y > * | right |
double | x |
double | y |
double | z |
Y | data |
CubitBoolean | valid |
CubitBox | safetyBox |
CubitBox | boundingBox |
Private Attributes | |
DIMENSION | myDisc |
double | myDist |
DISTDATA | myDistData |
Definition at line 46 of file KDDTreeNode.hpp.
MY_INLINE KDDTreeNode< Y >::KDDTreeNode | ( | Y | aData, |
DIMENSION | aDisc = DIMX |
||
) |
Definition at line 39 of file KDDTreeNode.cpp.
{ parent = left = right = NULL; data = aData; boundingBox = data->bounding_box(); x = boundingBox.center().x(); y = boundingBox.center().y(); z = boundingBox.center().z(); myDist = CUBIT_DBL_MAX; myDistData = DD_SAFETY; myDisc = aDisc; valid = CUBIT_TRUE; }
MY_INLINE KDDTreeNode< Y >::~KDDTreeNode | ( | ) |
Definition at line 58 of file KDDTreeNode.cpp.
{ }
MY_INLINE DIRECTION KDDTreeNode< Y >::compare | ( | KDDTreeNode< Y > * | Q | ) | const |
MY_INLINE DIRECTION KDDTreeNode< Y >::compare_with_equality | ( | KDDTreeNode< Y > * | Q | ) | const |
Definition at line 116 of file KDDTreeNode.cpp.
{ if (Q->myDisc == DIMX) { if (x < Q->x) return DIR_LEFT; else if (x == Q->x) return DIR_EITHER; else return DIR_RIGHT; } else if (Q->myDisc == DIMY) { if (y < Q->y) return DIR_LEFT; else if (y == Q->y) return DIR_EITHER; else return DIR_RIGHT; } else if (z < Q->z) { return DIR_LEFT; } else if (z == Q->z) { return DIR_EITHER; } else { return DIR_RIGHT; } }
MY_INLINE KDDTreeNode< Y > * KDDTreeNode< Y >::get_child | ( | DIRECTION | dir | ) | const |
Definition at line 62 of file KDDTreeNode.cpp.
DIMENSION KDDTreeNode< Y >::get_disc | ( | ) | const [inline] |
Definition at line 81 of file KDDTreeNode.hpp.
{ return myDisc; }
double KDDTreeNode< Y >::get_dist | ( | ) | const [inline] |
Definition at line 73 of file KDDTreeNode.hpp.
{ return myDist; }
DISTDATA KDDTreeNode< Y >::get_dist_data | ( | ) | const [inline] |
Definition at line 77 of file KDDTreeNode.hpp.
{ return myDistData; }
MY_INLINE DIMENSION KDDTreeNode< Y >::next_disc | ( | ) | const |
MY_INLINE void KDDTreeNode< Y >::set_child | ( | KDDTreeNode< Y > * | node, |
DIRECTION | dir | ||
) |
Definition at line 69 of file KDDTreeNode.cpp.
void KDDTreeNode< Y >::set_disc | ( | DIMENSION | dim | ) | [inline] |
Definition at line 82 of file KDDTreeNode.hpp.
{ myDisc = dim; }
void KDDTreeNode< Y >::set_dist | ( | double | dist | ) | [inline] |
Definition at line 74 of file KDDTreeNode.hpp.
void KDDTreeNode< Y >::set_dist_data | ( | DISTDATA | distData | ) | [inline] |
Definition at line 78 of file KDDTreeNode.hpp.
{ myDistData = distData; }
CubitBox KDDTreeNode< Y >::boundingBox |
Definition at line 62 of file KDDTreeNode.hpp.
Y KDDTreeNode< Y >::data |
Definition at line 58 of file KDDTreeNode.hpp.
KDDTreeNode<Y>* KDDTreeNode< Y >::left |
Definition at line 55 of file KDDTreeNode.hpp.
DIMENSION KDDTreeNode< Y >::myDisc [private] |
Definition at line 49 of file KDDTreeNode.hpp.
double KDDTreeNode< Y >::myDist [private] |
Definition at line 50 of file KDDTreeNode.hpp.
DISTDATA KDDTreeNode< Y >::myDistData [private] |
Definition at line 51 of file KDDTreeNode.hpp.
KDDTreeNode<Y>* KDDTreeNode< Y >::parent |
Definition at line 54 of file KDDTreeNode.hpp.
KDDTreeNode<Y>* KDDTreeNode< Y >::right |
Definition at line 56 of file KDDTreeNode.hpp.
CubitBox KDDTreeNode< Y >::safetyBox |
Definition at line 61 of file KDDTreeNode.hpp.
CubitBoolean KDDTreeNode< Y >::valid |
Definition at line 59 of file KDDTreeNode.hpp.
double KDDTreeNode< Y >::x |
Definition at line 57 of file KDDTreeNode.hpp.
double KDDTreeNode< Y >::y |
Definition at line 57 of file KDDTreeNode.hpp.
double KDDTreeNode< Y >::z |
Definition at line 57 of file KDDTreeNode.hpp.