|
| Octree () |
| Default constructor. More...
|
|
void | build (const std::vector< T > &items, const BoundingBox3D &bound, const BoxIntersectionTestFunc3< T > &testFunc, size_t maxDepth) |
|
void | clear () |
| Clears all the contents of this instance. More...
|
|
NearestNeighborQueryResult3< T > | nearest (const Vector3D &pt, const NearestNeighborDistanceFunc3< T > &distanceFunc) const override |
|
bool | intersects (const BoundingBox3D &box, const BoxIntersectionTestFunc3< T > &testFunc) const override |
| Returns true if given box intersects with any of the stored items. More...
|
|
bool | intersects (const Ray3D &ray, const RayIntersectionTestFunc3< T > &testFunc) const override |
| Returns true if given ray intersects with any of the stored items. More...
|
|
void | forEachIntersectingItem (const BoundingBox3D &box, const BoxIntersectionTestFunc3< T > &testFunc, const IntersectionVisitorFunc3< T > &visitorFunc) const override |
| Invokes visitorFunc for every intersecting items. More...
|
|
void | forEachIntersectingItem (const Ray3D &ray, const RayIntersectionTestFunc3< T > &testFunc, const IntersectionVisitorFunc3< T > &visitorFunc) const override |
| Invokes visitorFunc for every intersecting items. More...
|
|
ClosestIntersectionQueryResult3< T > | closestIntersection (const Ray3D &ray, const GetRayIntersectionFunc3< T > &testFunc) const override |
| Returns the closest intersection for given ray . More...
|
|
Iterator | begin () |
| Returns the begin iterator of the item. More...
|
|
Iterator | end () |
| Returns the end iterator of the item. More...
|
|
ConstIterator | begin () const |
| Returns the immutable begin iterator of the item. More...
|
|
ConstIterator | end () const |
| Returns the immutable end iterator of the item. More...
|
|
size_t | numberOfItems () const |
| Returns the number of items. More...
|
|
const T & | item (size_t i) const |
| Returns the item at i . More...
|
|
size_t | numberOfNodes () const |
| Returns the number of octree nodes. More...
|
|
const std::vector< size_t > & | itemsAtNode (size_t nodeIdx) const |
| Returns the list of the items for given noide index. More...
|
|
size_t | childIndex (size_t nodeIdx, size_t childIdx) const |
| Returns a child's index for given node. More...
|
|
const BoundingBox3D & | boundingBox () const |
| Returns the bounding box of this octree. More...
|
|
size_t | maxDepth () const |
| Returns the maximum depth of the tree. More...
|
|
template<typename T>
class jet::Octree< T >
Generic octree data structure.
This class is a generic octree representation to store arbitrary spatial data. The octree supports closest neighbor search, overlapping test, and ray intersection test.
- Template Parameters
-
template<typename T >
size_t jet::Octree< T >::childIndex |
( |
size_t |
nodeIdx, |
|
|
size_t |
childIdx |
|
) |
| const |
Returns a child's index for given node.
For a given node, its children is stored continuously, such that if the node's first child's index is i, then i + 1, i + 2, ... , i + 7 are the indices for its children. The order of octant is x-major.
- Parameters
-
[in] | nodeIdx | The node index. |
[in] | childIdx | The child index (0 to 7). |
- Returns
- Index of the selected child.