Template Struct OctreeNode

Struct Documentation

template<typename T>
struct OctreeNode

Node in the octree data structure.

Public Functions

inline OctreeNode()
inline OctreeNode(BoundingBox<T> &bBox)
inline bool isLeaf() const

True if node is leaf, false otherwise.

inline bool isEmpty() const

True if tree node has weight zero (== is empty), false otherwise.

inline bool contains(const Point<T> &point) const

True if point point is stored in the octree node, false otherwise.

inline void computeCenterOfMass()

Computes octree node’s (possibly weighted) center of mass.

inline void compress()
inline std::string toString()

String label of octree node. Composed of sidelength, weight, and children’s labels.

inline void split(count dimensions, count numChildren)

Split area corresponding octree node so as to obtain numChildren octree node children.

inline void addPoint(const Point<T> &point, count dimensions, count numChildrenPerNode)

Adds point to octree node.

  • point[in] Point to be added.

  • dimensions[in] Point’s number of dimensions.

  • numChildrenPerNode[in] Number of children an octree node has if split.

Public Members

count weight
Point<T> centerOfMass
std::vector<OctreeNode> children
BoundingBox<T> bBox