17 #ifndef ATOMPROBE_K3DTREE_H 18 #define ATOMPROBE_K3DTREE_H 47 void setAxis(
unsigned int Axis);
49 {
return p1[axis]<p2[axis];};
77 inline void setAxis(
unsigned int newAxis) {axis=newAxis;};
79 inline unsigned int getAxis()
const{
return axis;};
92 void deleteChildren();
94 void dump(std::ostream &,
unsigned int)
const;
102 unsigned int treeSize;
104 unsigned int maxDepth;
109 K3DNodeApprox *buildRecurse(std::vector<Point3D>::iterator pts_start, std::vector<Point3D>::iterator pts_end,
unsigned int depth );
123 void build(
const std::vector<Point3D> &pts);
129 void buildByRef(std::vector<Point3D> &pts);
143 float deadDistSqr)
const;
150 unsigned int numNNs, std::vector<const Point3D *> &results,
151 float deadDistSqr=0.0f)
const;
156 void dump(std::ostream &)
const;
159 inline unsigned int nodeCount()
const{
return treeSize;};
float sqrDist(const Point3D &pt) const
Returns the square of distance to another Point3D.
unsigned int getAxis() const
Retrieve the axis that this node operates on.
float getLocVal(unsigned int pos) const
Obtain the coordinates at dimension "pos".
bool operator()(const Point3D &p1, const Point3D &p2) const
unsigned int nodeCount() const
Print the number of nodes stored in the tree.
float sqrDist(const Point3D &pt) const
Obtain the distance between this node and another point.
const Point3D * getLocRef() const
Return a pointer to the point from the node.
K3DNodeApprox * left() const
Obtain pointer to left child.
A 3D point data class storage.
void setLeft(K3DNodeApprox *node)
Set the left child node.
K3DNodeApprox * right() const
Obtain pointer to right child.
float getAxisVal() const
retrieve the value associated with this axis
Helper class to define a bounding cube.
float getValue(unsigned int ui) const
Get value of ith dimension (0, 1, 2)
void setAxis(unsigned int Axis)
Node Class for storing point.
Functor allowing for sorting of points in 3D.
void setRight(K3DNodeApprox *node)
Set the right child node.
void setAxis(unsigned int newAxis)
Set the axis that this node operates on.