ug4
|
organizes vertices in a binary-tree structure. Only for static use! More...
#include <kd_tree_static.h>
Classes | |
class | Node |
Public Types | |
typedef std::vector< Vertex * > | VertexVec |
Public Member Functions | |
void | clear () |
template<class TVrtIterator > | |
bool | create_from_grid (Grid &grid, TVrtIterator vrtsBegin, TVrtIterator vrtsEnd, Grid::VertexAttachmentAccessor< TPositionAttachment > aaPos, int maxTreeDepth, int splitThreshold, KDSplitDimension splitDimension=KDSD_LARGEST) |
template<class TVrtIterator > | |
bool | create_from_grid (Grid &grid, TVrtIterator vrtsBegin, TVrtIterator vrtsEnd, TPositionAttachment &aPos, int maxTreeDepth, int splitThreshold, KDSplitDimension splitDimension=KDSD_LARGEST) |
void | get_leafs (std::vector< Node * > &vLeafsOut) |
bool | get_neighbourhood (std::vector< Vertex * > &vrtsOut, typename TPositionAttachment::ValueType &pos, int numClosest) |
bool | get_points_in_box (std::vector< Vertex * > &vrtsOut, const TVector &boxMin, const TVector &boxMax) |
Node * | get_root () |
KDTreeStatic () | |
Protected Member Functions | |
template<class TVertexIterator > | |
bool | create_barycentric (TVertexIterator vrts_begin, TVertexIterator vrts_end, int numVertices, Node *pNode, int actDimension, int maxTreeDepth) |
template<class TVertexIterator > | |
int | get_largest_dimension (TVertexIterator vrts_begin, TVertexIterator vrts_end) |
void | get_leafs_recursive (std::vector< Node * > &vLeafsOut, Node *pNode) |
template<class TVertexIterator > | |
int | get_next_split_dimension (int actSplitDimension, TVertexIterator vrts_begin, TVertexIterator vrts_end) |
bool | get_points_in_box (std::vector< Vertex * > &vrtsOut, Node *pNode, const TVector &boxMin, const TVector &boxMax) |
void | neighbourhood (KDVertexDistanceList &vrtsOut, Node *pNode, TVector &pos, int numClosest) |
Protected Attributes | |
Grid::VertexAttachmentAccessor< TPositionAttachment > | m_aaPos |
int | m_iSplitThreshold |
float | m_maxDistSQ |
int | m_numNeighboursFound |
Node | m_parentNode |
Grid * | m_pGrid |
KDSplitDimension | m_splitDimension |
organizes vertices in a binary-tree structure. Only for static use!
A kd-tree allows you to find vertices close to a given position in O(log(n)).
This kd-tree should be only used for static geometry. If you intend to add or delete vertices after creation, KDTreeStatic is not suited for your needs.
This class should be replaced by a dynamic kd-tree, which is capable of dynamic auto-balancing.
typedef std::vector<Vertex*> ug::KDTreeStatic< TPositionAttachment, numDimensions, TVector >::VertexVec |
|
inline |
void ug::KDTreeStatic< TPositionAttachment, numDimensions, TVector >::clear |
|
protected |
References ug::KDTreeStatic< TPositionAttachment, numDimensions, TVector >::Node::m_fSplitValue, ug::KDTreeStatic< TPositionAttachment, numDimensions, TVector >::Node::m_iSplitDimension, ug::KDTreeStatic< TPositionAttachment, numDimensions, TVector >::Node::m_pChild, and ug::KDTreeStatic< TPositionAttachment, numDimensions, TVector >::Node::m_pvVertices.
bool ug::KDTreeStatic< TPositionAttachment, numDimensions, TVector >::create_from_grid | ( | Grid & | grid, |
TVrtIterator | vrtsBegin, | ||
TVrtIterator | vrtsEnd, | ||
Grid::VertexAttachmentAccessor< TPositionAttachment > | aaPos, | ||
int | maxTreeDepth, | ||
int | splitThreshold, | ||
KDSplitDimension | splitDimension = KDSD_LARGEST |
||
) |
References ug::Grid::num_vertices().
bool ug::KDTreeStatic< TPositionAttachment, numDimensions, TVector >::create_from_grid | ( | Grid & | grid, |
TVrtIterator | vrtsBegin, | ||
TVrtIterator | vrtsEnd, | ||
TPositionAttachment & | aPos, | ||
int | maxTreeDepth, | ||
int | splitThreshold, | ||
KDSplitDimension | splitDimension = KDSD_LARGEST |
||
) |
Referenced by ug::RemoveDoubles().
|
protected |
void ug::KDTreeStatic< TPositionAttachment, numDimensions, TVector >::get_leafs | ( | std::vector< Node * > & | vLeafsOut | ) |
|
protected |
bool ug::KDTreeStatic< TPositionAttachment, numDimensions, TVector >::get_neighbourhood | ( | std::vector< Vertex * > & | vrtsOut, |
typename TPositionAttachment::ValueType & | pos, | ||
int | numClosest | ||
) |
Referenced by ug::RemoveDoubles().
|
protected |
References ug::KDSD_CIRCULAR, and ug::KDSD_LARGEST.
bool ug::KDTreeStatic< TPositionAttachment, numDimensions, TVector >::get_points_in_box | ( | std::vector< Vertex * > & | vrtsOut, |
const TVector & | boxMin, | ||
const TVector & | boxMax | ||
) |
|
protected |
References ug::KDTreeStatic< TPositionAttachment, numDimensions, TVector >::Node::m_fSplitValue, ug::KDTreeStatic< TPositionAttachment, numDimensions, TVector >::Node::m_iSplitDimension, ug::KDTreeStatic< TPositionAttachment, numDimensions, TVector >::Node::m_pChild, and ug::KDTreeStatic< TPositionAttachment, numDimensions, TVector >::Node::m_pvVertices.
|
inline |
|
protected |
References ug::KDTreeStatic< TPositionAttachment, numDimensions, TVector >::Node::m_fSplitValue, ug::KDTreeStatic< TPositionAttachment, numDimensions, TVector >::Node::m_iSplitDimension, ug::KDTreeStatic< TPositionAttachment, numDimensions, TVector >::Node::m_pChild, and ug::KDTreeStatic< TPositionAttachment, numDimensions, TVector >::Node::m_pvVertices.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |