Class hierarchy   Compound list   Header files   Member list  

dimeBSPTree Class Reference

The dimeBSPTree class is a simple BSP tree implementation. More...

List of all members.

Public Members


Detailed Description

The dimeBSPTree class is a simple BSP tree implementation.


Member Function Documentation

dimeBSPTree::dimeBSPTree(const int maxnodepts, const int initsize)

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.

dimeBSPTree::~dimeBSPTree()

Destructor. Will free all memory used.

int dimeBSPTree::numPoints() const

Returns the number of points in the BSP tree.

void dimeBSPTree::getPoint(const int idx, dimeVec3f &pt)

Returns the coordinates for the point at index idx.

See also:
dimeBSPTree::numPoints()

void* dimeBSPTree::getUserData(const int idx) const

Returns the user data for the point at index idx.

void dimeBSPTree::setUserData(const int idx, void * const data)

Sets the user data for the point with index idx.

int dimeBSPTree::addPoint(const dimeVec3f &pt, void * const data)

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.

int dimeBSPTree::removePoint(const dimeVec3f &pt)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

void dimeBSPTree::removePoint(const int idx)

Removes the point at index. The BSP tree will not be restructured, no matter how many points you remove.

int dimeBSPTree::findPoint(const dimeVec3f &pos) const

Searches for a point with coordinates pos. Returns the index if found, -1 otherwise

void dimeBSPTree::clear(const int initsize)

Frees the memory used by the BSP tree. Do not use the BSP tree after this method has been called.

const dimeBox* dimeBSPTree::getBBox() const

Returns the bounding box for all points in the BSP tree.


The documentation for this class was generated from the following files:
Copyright © 1998-1999, Systems In Motion <sales@sim.no>. All rights reserved.
System documentation was generated using doxygen.