|
Cortex 6.0.0
|
#include <BoundedKDTree.h>
Public Types | |
| typedef BoundIterator | Iterator |
|
typedef std::iterator_traits < BoundIterator >::value_type | Bound |
|
typedef BoxTraits< Bound > ::BaseType | BaseType |
| typedef std::vector< Node > | NodeVector |
| typedef NodeVector::size_type | NodeIndex |
Public Member Functions | |
| BoundedKDTree () | |
| BoundedKDTree (BoundIterator first, BoundIterator last, int maxLeafSize=4) | |
| void | init (BoundIterator first, BoundIterator last, int maxLeafSize=4) |
| template<typename S > | |
| unsigned int | intersectingBounds (const S &b, std::vector< BoundIterator > &bounds) const |
| NodeIndex | numNodes () const |
| Returns the number of nodes in the tree. | |
| const Node & | node (NodeIndex idx) const |
| Retrieve the node associated with a given index. | |
| NodeIndex | rootIndex () const |
| Returns the index for the root node. | |
Static Public Member Functions | |
| static NodeIndex | lowChildIndex (NodeIndex index) |
| Retrieve the index of the "low" child node. | |
| static NodeIndex | highChildIndex (NodeIndex index) |
| Retrieve the index of the "high" child node. | |
Builds a KDTree of bounded volumes to permit fast intersection/overlap tests.
| IECore::BoundedKDTree< BoundIterator >::BoundedKDTree | ( | ) |
Construncts an uninitialised tree - you must call init() before using it.
| IECore::BoundedKDTree< BoundIterator >::BoundedKDTree | ( | BoundIterator | first, |
| BoundIterator | last, | ||
| int | maxLeafSize = 4 |
||
| ) |
Creates a tree for the fast searching of bounds. Note that the tree does not own the passed bounds - it is up to you to ensure that they remain valid and unchanged as long as the BoundedKDTree is in use.
| void IECore::BoundedKDTree< BoundIterator >::init | ( | BoundIterator | first, |
| BoundIterator | last, | ||
| int | maxLeafSize = 4 |
||
| ) |
Builds the tree for the specified bounds - the iterator range must remain valid and unchanged as long as the tree is in use. This method can be called again to rebuild the tree at any time.
| unsigned int IECore::BoundedKDTree< BoundIterator >::intersectingBounds | ( | const S & | b, |
| std::vector< BoundIterator > & | bounds | ||
| ) | const |
Populates the passed vector of iterators with the bounds which intersect "b". Returns the number of bounds found.
1.7.3