Image Component Library (ICL)
Public Member Functions | Public Attributes | List of all members
icl::math::Octree< Scalar, CAPACITY, SF, Pt, ALLOC_CHUNK_SIZE >::Node Struct Reference

Internally used node structure. More...

#include <Octree.h>

Public Member Functions

 Node ()
 empty default constructor (does nothing) More...
 
 Node (const AABB &boundary)
 constructor from given AABB-boundary More...
 
void init (Node *parent, const AABB &boundary)
 initialization methods (with given boundary) More...
 
void query (const AABB &boundary, std::vector< Pt > &found) const
 recursive getter function that queries all nodes within a given bounding box More...
 
void split (Node *children)
 creates the children for this node More...
 

Public Attributes

AABB boundary
 node boundary More...
 
Pt points [CAPACITY]
 contained nodes More...
 
Pt * next
 next node to fill More...
 
Nodechildren
 pointer to four child-nodes More...
 
Nodeparent
 parent node More...
 
float radius
 aabb radius (can be used for bounding sphere tests) More...
 

Detailed Description

template<class Scalar, int CAPACITY = 16, int SF = 1, class Pt = FixedColVector<Scalar,4>, int ALLOC_CHUNK_SIZE = 1024>
struct icl::math::Octree< Scalar, CAPACITY, SF, Pt, ALLOC_CHUNK_SIZE >::Node

Internally used node structure.

Each node can contain up to CAPACITY elements. Further nodes are distributed to one of the four children

Constructor & Destructor Documentation

◆ Node() [1/2]

template<class Scalar, int CAPACITY = 16, int SF = 1, class Pt = FixedColVector<Scalar,4>, int ALLOC_CHUNK_SIZE = 1024>
icl::math::Octree< Scalar, CAPACITY, SF, Pt, ALLOC_CHUNK_SIZE >::Node::Node ( )
inline

empty default constructor (does nothing)

◆ Node() [2/2]

template<class Scalar, int CAPACITY = 16, int SF = 1, class Pt = FixedColVector<Scalar,4>, int ALLOC_CHUNK_SIZE = 1024>
icl::math::Octree< Scalar, CAPACITY, SF, Pt, ALLOC_CHUNK_SIZE >::Node::Node ( const AABB boundary)
inline

constructor from given AABB-boundary

Member Function Documentation

◆ init()

template<class Scalar, int CAPACITY = 16, int SF = 1, class Pt = FixedColVector<Scalar,4>, int ALLOC_CHUNK_SIZE = 1024>
void icl::math::Octree< Scalar, CAPACITY, SF, Pt, ALLOC_CHUNK_SIZE >::Node::init ( Node parent,
const AABB boundary 
)
inline

initialization methods (with given boundary)

sets next to points-begin and children to NULL

◆ query()

template<class Scalar, int CAPACITY = 16, int SF = 1, class Pt = FixedColVector<Scalar,4>, int ALLOC_CHUNK_SIZE = 1024>
void icl::math::Octree< Scalar, CAPACITY, SF, Pt, ALLOC_CHUNK_SIZE >::Node::query ( const AABB boundary,
std::vector< Pt > &  found 
) const
inline

recursive getter function that queries all nodes within a given bounding box

breaks the recursion if no children are present or if the nodes boundary does not intersect with the given boundary. Recursively fills the given 'found'-vector

◆ split()

template<class Scalar, int CAPACITY = 16, int SF = 1, class Pt = FixedColVector<Scalar,4>, int ALLOC_CHUNK_SIZE = 1024>
void icl::math::Octree< Scalar, CAPACITY, SF, Pt, ALLOC_CHUNK_SIZE >::Node::split ( Node children)
inline

creates the children for this node

children order is ul, ur, ll, lr. The children are created by the top-level QuadTree's allocator and passed to this function. 'split' initializes the four given children

Member Data Documentation

◆ boundary

template<class Scalar, int CAPACITY = 16, int SF = 1, class Pt = FixedColVector<Scalar,4>, int ALLOC_CHUNK_SIZE = 1024>
AABB icl::math::Octree< Scalar, CAPACITY, SF, Pt, ALLOC_CHUNK_SIZE >::Node::boundary

node boundary

◆ children

template<class Scalar, int CAPACITY = 16, int SF = 1, class Pt = FixedColVector<Scalar,4>, int ALLOC_CHUNK_SIZE = 1024>
Node* icl::math::Octree< Scalar, CAPACITY, SF, Pt, ALLOC_CHUNK_SIZE >::Node::children

pointer to four child-nodes

◆ next

template<class Scalar, int CAPACITY = 16, int SF = 1, class Pt = FixedColVector<Scalar,4>, int ALLOC_CHUNK_SIZE = 1024>
Pt* icl::math::Octree< Scalar, CAPACITY, SF, Pt, ALLOC_CHUNK_SIZE >::Node::next

next node to fill

◆ parent

template<class Scalar, int CAPACITY = 16, int SF = 1, class Pt = FixedColVector<Scalar,4>, int ALLOC_CHUNK_SIZE = 1024>
Node* icl::math::Octree< Scalar, CAPACITY, SF, Pt, ALLOC_CHUNK_SIZE >::Node::parent

parent node

◆ points

template<class Scalar, int CAPACITY = 16, int SF = 1, class Pt = FixedColVector<Scalar,4>, int ALLOC_CHUNK_SIZE = 1024>
Pt icl::math::Octree< Scalar, CAPACITY, SF, Pt, ALLOC_CHUNK_SIZE >::Node::points[CAPACITY]

contained nodes

◆ radius

template<class Scalar, int CAPACITY = 16, int SF = 1, class Pt = FixedColVector<Scalar,4>, int ALLOC_CHUNK_SIZE = 1024>
float icl::math::Octree< Scalar, CAPACITY, SF, Pt, ALLOC_CHUNK_SIZE >::Node::radius

aabb radius (can be used for bounding sphere tests)


The documentation for this struct was generated from the following file: