Support Forum       G3D Web Page     
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
G3D::PointKDTree< T, PositionFunc, HashFunc, EqualsFunc >::Node Class Reference

Public Member Functions

 Node ()
 Creates node with nullptr children. More...
 
 Node (const Node &other)
 
Doesn't clone children. More...
 
 Node (const Array< Handle > &pt)
 Copies the specified subarray of pt into point, NULLs the children. More...
 
 ~Node ()
 Deletes the children (but not the values) More...
 
void assignSplitBounds (const AABox &myBounds)
 
Recurse through the tree, assigning splitBounds fields. More...
 
NodefindDeepestContainingNode (const Vector3 &point)
 Returns the deepest node that completely contains bounds. More...
 
void getHandles (Array< Handle > &handleArray) const
 
Recursively appends all handles and children's handles to the array. More...
 
void getIntersectingMembers (const AABox &sphereBounds, const Sphere &sphere, Array< T > &members) const
 Appends all members that intersect the box. More...
 
void getIntersectingMembers (const AABox &box, const Sphere &sphere, Array< T > &members, bool useSphere) const
 Appends all members that intersect the box. More...
 
bool isLeaf () const
 Returns true if this node is a leaf (no children) More...
 
void verifyNode (const Vector3 &lo, const Vector3 &hi)
 

Static Public Member Functions

static NodedeserializeStructure (BinaryInput &bi)
 Clears the member table. More...
 
static void serializeStructure (const Node *n, BinaryOutput &bo)
 Stores the locations of the splitting planes (the structure but not the content) so that the tree can be quickly rebuilt from a previous configuration without calling balance. More...
 

Public Attributes

Nodechild [2]
 child[0] contains all values strictly smaller than splitLocation along splitAxis. More...
 
Vector3::Axis splitAxis
 
AABox splitBounds
 Spatial bounds on all values at this node and its children, based purely on the parent's splitting planes. More...
 
float splitLocation
 Location along the specified axis. More...
 
Array< HandlevalueArray
 Values if this is a leaf node). More...
 

Constructor & Destructor Documentation

◆ Node() [1/3]

template<class T , class PositionFunc = PositionTrait<T>, class HashFunc = HashTrait<T>, class EqualsFunc = EqualsTrait<T>>
G3D::PointKDTree< T, PositionFunc, HashFunc, EqualsFunc >::Node::Node ( )
inline

◆ Node() [2/3]

template<class T , class PositionFunc = PositionTrait<T>, class HashFunc = HashTrait<T>, class EqualsFunc = EqualsTrait<T>>
G3D::PointKDTree< T, PositionFunc, HashFunc, EqualsFunc >::Node::Node ( const Node other)
inline


Doesn't clone children.

◆ Node() [3/3]

template<class T , class PositionFunc = PositionTrait<T>, class HashFunc = HashTrait<T>, class EqualsFunc = EqualsTrait<T>>
G3D::PointKDTree< T, PositionFunc, HashFunc, EqualsFunc >::Node::Node ( const Array< Handle > &  pt)
inline

Copies the specified subarray of pt into point, NULLs the children.

Assumes a second pass will set splitBounds.

◆ ~Node()

template<class T , class PositionFunc = PositionTrait<T>, class HashFunc = HashTrait<T>, class EqualsFunc = EqualsTrait<T>>
G3D::PointKDTree< T, PositionFunc, HashFunc, EqualsFunc >::Node::~Node ( )
inline

Deletes the children (but not the values)

Member Function Documentation

◆ assignSplitBounds()

template<class T , class PositionFunc = PositionTrait<T>, class HashFunc = HashTrait<T>, class EqualsFunc = EqualsTrait<T>>
void G3D::PointKDTree< T, PositionFunc, HashFunc, EqualsFunc >::Node::assignSplitBounds ( const AABox myBounds)
inline

◆ deserializeStructure()

template<class T , class PositionFunc = PositionTrait<T>, class HashFunc = HashTrait<T>, class EqualsFunc = EqualsTrait<T>>
static Node* G3D::PointKDTree< T, PositionFunc, HashFunc, EqualsFunc >::Node::deserializeStructure ( BinaryInput bi)
inlinestatic

◆ findDeepestContainingNode()

template<class T , class PositionFunc = PositionTrait<T>, class HashFunc = HashTrait<T>, class EqualsFunc = EqualsTrait<T>>
Node* G3D::PointKDTree< T, PositionFunc, HashFunc, EqualsFunc >::Node::findDeepestContainingNode ( const Vector3 point)
inline

◆ getHandles()

template<class T , class PositionFunc = PositionTrait<T>, class HashFunc = HashTrait<T>, class EqualsFunc = EqualsTrait<T>>
void G3D::PointKDTree< T, PositionFunc, HashFunc, EqualsFunc >::Node::getHandles ( Array< Handle > &  handleArray) const
inline

◆ getIntersectingMembers() [1/2]

template<class T , class PositionFunc = PositionTrait<T>, class HashFunc = HashTrait<T>, class EqualsFunc = EqualsTrait<T>>
void G3D::PointKDTree< T, PositionFunc, HashFunc, EqualsFunc >::Node::getIntersectingMembers ( const AABox sphereBounds,
const Sphere sphere,
Array< T > &  members 
) const
inline

Appends all members that intersect the box.

If useSphere is true, members are tested against the sphere instead.

Referenced by G3D::PointKDTree< T, PositionFunc, HashFunc, EqualsFunc >::Node::getIntersectingMembers(), and G3D::PointKDTree< T, PositionFunc, HashFunc, EqualsFunc >::getIntersectingMembers().

◆ getIntersectingMembers() [2/2]

template<class T , class PositionFunc = PositionTrait<T>, class HashFunc = HashTrait<T>, class EqualsFunc = EqualsTrait<T>>
void G3D::PointKDTree< T, PositionFunc, HashFunc, EqualsFunc >::Node::getIntersectingMembers ( const AABox box,
const Sphere sphere,
Array< T > &  members,
bool  useSphere 
) const
inline

Appends all members that intersect the box.

If useSphere is true, members are tested against the sphere instead.

Implemented using both box and sphere tests to simplify the implementation of a future beginSphereInteresection iterator using the same underlying BoxIterator class.

◆ isLeaf()

template<class T , class PositionFunc = PositionTrait<T>, class HashFunc = HashTrait<T>, class EqualsFunc = EqualsTrait<T>>
bool G3D::PointKDTree< T, PositionFunc, HashFunc, EqualsFunc >::Node::isLeaf ( ) const
inline

Returns true if this node is a leaf (no children)

◆ serializeStructure()

template<class T , class PositionFunc = PositionTrait<T>, class HashFunc = HashTrait<T>, class EqualsFunc = EqualsTrait<T>>
static void G3D::PointKDTree< T, PositionFunc, HashFunc, EqualsFunc >::Node::serializeStructure ( const Node n,
BinaryOutput bo 
)
inlinestatic

Stores the locations of the splitting planes (the structure but not the content) so that the tree can be quickly rebuilt from a previous configuration without calling balance.

Referenced by G3D::PointKDTree< T, PositionFunc, HashFunc, EqualsFunc >::serializeStructure().

◆ verifyNode()

template<class T , class PositionFunc = PositionTrait<T>, class HashFunc = HashTrait<T>, class EqualsFunc = EqualsTrait<T>>
void G3D::PointKDTree< T, PositionFunc, HashFunc, EqualsFunc >::Node::verifyNode ( const Vector3 lo,
const Vector3 hi 
)
inline

Member Data Documentation

◆ child

template<class T , class PositionFunc = PositionTrait<T>, class HashFunc = HashTrait<T>, class EqualsFunc = EqualsTrait<T>>
Node* G3D::PointKDTree< T, PositionFunc, HashFunc, EqualsFunc >::Node::child[2]

◆ splitAxis

template<class T , class PositionFunc = PositionTrait<T>, class HashFunc = HashTrait<T>, class EqualsFunc = EqualsTrait<T>>
Vector3::Axis G3D::PointKDTree< T, PositionFunc, HashFunc, EqualsFunc >::Node::splitAxis

◆ splitBounds

template<class T , class PositionFunc = PositionTrait<T>, class HashFunc = HashTrait<T>, class EqualsFunc = EqualsTrait<T>>
AABox G3D::PointKDTree< T, PositionFunc, HashFunc, EqualsFunc >::Node::splitBounds

◆ splitLocation

template<class T , class PositionFunc = PositionTrait<T>, class HashFunc = HashTrait<T>, class EqualsFunc = EqualsTrait<T>>
float G3D::PointKDTree< T, PositionFunc, HashFunc, EqualsFunc >::Node::splitLocation

◆ valueArray

template<class T , class PositionFunc = PositionTrait<T>, class HashFunc = HashTrait<T>, class EqualsFunc = EqualsTrait<T>>
Array<Handle> G3D::PointKDTree< T, PositionFunc, HashFunc, EqualsFunc >::Node::valueArray

documentation generated on Wed Nov 24 2021 08:01:59 using doxygen 1.8.15