public

Inheritance Graph

graph BT
	PointOctree
	click PointOctree "classGeometry_1_1PointOctree"

Description

Three-dimensional spatial data structure for storing points with additional arbitrary data.

Author: Benjamin Eikel, Jonas Knoll

Date: 2011-02-08

Public Types

   
   
typedef Point_t point_t

Public Functions

   
   
  PointOctree(const Box & boundingBox, float minimumBoxSize, uint32_t maximumPoints)
   
const Box & getBox() const
   
float getMinBoxSize() const
   
uint32_t getMaxNumPoints() const
   
bool hasChildren() const
   
bool isLeaf() const
   
bool empty() const
   
void clear()
   
bool insert(const Point_t & point)
   
bool remove(const Point_t & point)
   
void collectPoints(std::deque< Point_t > & out) const
   
void collectPointsWithinBox(const Box & box, std::deque< Point_t > & out) const
   
void collectPointsWithinSphere(const Sphere_f & sphere, std::deque< Point_t > & out) const
   
const PointOctree * findLeafCell(const Vec3f & point) const
   
PointOctree * findLeafCell(const Vec3f & point)
   
void getClosestPoints(const Vec3f & pos, size_t count, std::deque< Point_t > & out) const
   
std::deque< Point_t > getSortedClosestPoints(const Vec3f & pos, size_t count) const

Documentation

typedef
Geometry::PointOctree::point_t

public
 
 
typedef Point_t point_t

Defined in Geometry/PointOctree.h:59


function
Geometry::PointOctree::PointOctree

public inline
     
     
PointOctree( const Box & boundingBox,
  float minimumBoxSize,
  uint32_t maximumPoints
)    

Create a new octree for points within the given bounds.

Parameters

boundingBox
Bounding box for all points to store.
minimumBoxSize
Minimum side length of leaf cells. If this is reached, the leaf will not be split anymore.
maximumPoints
Maximum number of points in leaf cells. If this is reached, a leaf will be split.

Defined in Geometry/PointOctree.h:68


function
Geometry::PointOctree::getBox

public const inline
   
   
const Box & getBox( ) const

Defined in Geometry/PointOctree.h:72


function
Geometry::PointOctree::getMinBoxSize

public const inline
   
   
float getMinBoxSize( ) const

Defined in Geometry/PointOctree.h:75


function
Geometry::PointOctree::getMaxNumPoints

public const inline
   
   
uint32_t getMaxNumPoints( ) const

Defined in Geometry/PointOctree.h:78


function
Geometry::PointOctree::hasChildren

public const inline
   
   
bool hasChildren( ) const

Defined in Geometry/PointOctree.h:81


function
Geometry::PointOctree::isLeaf

public const inline
   
   
bool isLeaf( ) const

Defined in Geometry/PointOctree.h:84


function
Geometry::PointOctree::empty

public const inline
   
   
bool empty( ) const

Defined in Geometry/PointOctree.h:87


function
Geometry::PointOctree::clear

public inline
   
   
void clear( )

Delete all child nodes and all points.

Defined in Geometry/PointOctree.h:94


function
Geometry::PointOctree::insert

public inline
     
     
bool insert( const Point_t & point )

Insert the point into the octree.

Parameters

point
Data item containing the position.

Defined in Geometry/PointOctree.h:104


function
Geometry::PointOctree::remove

public inline
     
     
bool remove( const Point_t & point )

Removes the point from the octree.

Parameters

point
Data item containing the position.

Defined in Geometry/PointOctree.h:111


function
Geometry::PointOctree::collectPoints

public const inline
     
     
void collectPoints( std::deque< Point_t > & out ) const

Return all points.

Parameters

out
Points in the tree.

Defined in Geometry/PointOctree.h:118


function
Geometry::PointOctree::collectPointsWithinBox

public const inline
     
     
void collectPointsWithinBox( const Box & box,
  std::deque< Point_t > & out
) const    

Return all points where the location is within the given box.

Parameters

box
out
Points that fulfill the condition are added to this container.

Defined in Geometry/PointOctree.h:126


function
Geometry::PointOctree::collectPointsWithinSphere

public const inline
     
     
void collectPointsWithinSphere( const Sphere_f & sphere,
  std::deque< Point_t > & out
) const    

Return all points where the location is within the sphere.

Parameters

sphere
The sphere describing the query region.
out
Points that fulfill the condition are added to this container.

Defined in Geometry/PointOctree.h:134


function
Geometry::PointOctree::findLeafCell

public const inline
     
     
const PointOctree * findLeafCell( const Vec3f & point ) const

Return the leaf node containing the given point or nullptr if the point is outside the tree.

Parameters

point
Point

Returns

PointOctree leaf node or nullptr.

Defined in Geometry/PointOctree.h:142


function
Geometry::PointOctree::findLeafCell

public inline
     
     
PointOctree * findLeafCell( const Vec3f & point )

Defined in Geometry/PointOctree.h:157


function
Geometry::PointOctree::getClosestPoints

public const inline
     
     
void getClosestPoints( const Vec3f & pos,
  size_t count,
  std::deque< Point_t > & out
) const    

Defined in Geometry/PointOctree.h:173


function
Geometry::PointOctree::getSortedClosestPoints

public const inline
     
     
std::deque< Point_t > getSortedClosestPoints( const Vec3f & pos,
  size_t count
) const    

Defined in Geometry/PointOctree.h:175