The dimeBSPTree class is a simple BSP tree implementation. More...
Constructor. Will create an empty BSP tree with one node. maxnodepts is the maximume number of points in a BSP node. initsize is the initial size of the arrays that holds the coordinates and userdata.
Destructor. Will free all memory used.
Returns the number of points in the BSP tree.
Returns the coordinates for the point at index idx.
Returns the user data for the point at index idx.
Sets the user data for the point with index idx.
Attempts to add a new point into the BSP tree. If a point with the same coordinates as pt already is in the tree, the index to that point will be returned. Otherwise, the point is appended at the end of the list of points, the userdata is set, and the new index is returned.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Removes the point at index. The BSP tree will not be restructured, no matter how many points you remove.
Searches for a point with coordinates pos. Returns the index if found, -1 otherwise
Frees the memory used by the BSP tree. Do not use the BSP tree after this method has been called.
Returns the bounding box for all points in the BSP tree.