33 #ifndef __H__LIB_GRID__KD_TREE__
34 #define __H__LIB_GRID__KD_TREE__
83 template <
class TPositionAttachment,
int numDimensions = 3,
class TVector = vector3 >
108 template <
class TVrtIterator>
110 TPositionAttachment& aPos,
int maxTreeDepth,
int splitThreshold,
113 template <
class TVrtIterator>
116 int maxTreeDepth,
int splitThreshold,
120 typename TPositionAttachment::ValueType& pos,
int numClosest);
123 const TVector& boxMin,
const TVector& boxMax);
127 void get_leafs(std::vector<Node*>& vLeafsOut);
131 const TVector& boxMin,
const TVector& boxMax);
135 template <
class TVertexIterator>
137 int numVertices, Node* pNode,
int actDimension,
int maxTreeDepth);
139 template <
class TVertexIterator>
142 template <
class TVertexIterator>
144 TVertexIterator vrts_end);
Manages the elements of a grid and their interconnection.
Definition: grid.h:132
Definition: kd_tree_static.h:90
float m_fSplitValue
Definition: kd_tree_static.h:98
int m_iSplitDimension
Definition: kd_tree_static.h:99
~Node()
Definition: kd_tree_static.h:93
void clear()
Definition: kd_tree_static_impl.hpp:50
Node * m_pChild[2]
Definition: kd_tree_static.h:97
VertexVec * m_pvVertices
Definition: kd_tree_static.h:100
Node()
Definition: kd_tree_static.h:92
organizes vertices in a binary-tree structure. Only for static use!
Definition: kd_tree_static.h:85
Node * get_root()
Definition: kd_tree_static.h:125
void clear()
Definition: kd_tree_static_impl.hpp:65
void get_leafs(std::vector< Node * > &vLeafsOut)
Definition: kd_tree_static_impl.hpp:128
void get_leafs_recursive(std::vector< Node * > &vLeafsOut, Node *pNode)
Definition: kd_tree_static_impl.hpp:404
int m_iSplitThreshold
Definition: kd_tree_static.h:151
Grid * m_pGrid
Definition: kd_tree_static.h:149
bool create_barycentric(TVertexIterator vrts_begin, TVertexIterator vrts_end, int numVertices, Node *pNode, int actDimension, int maxTreeDepth)
Definition: kd_tree_static_impl.hpp:278
KDSplitDimension m_splitDimension
Definition: kd_tree_static.h:153
float m_maxDistSQ
Definition: kd_tree_static.h:157
std::vector< Vertex * > VertexVec
Definition: kd_tree_static.h:87
bool get_neighbourhood(std::vector< Vertex * > &vrtsOut, typename TPositionAttachment::ValueType &pos, int numClosest)
Definition: kd_tree_static_impl.hpp:104
Grid::VertexAttachmentAccessor< TPositionAttachment > m_aaPos
Definition: kd_tree_static.h:150
bool get_points_in_box(std::vector< Vertex * > &vrtsOut, const TVector &boxMin, const TVector &boxMax)
Definition: kd_tree_static_impl.hpp:119
void neighbourhood(KDVertexDistanceList &vrtsOut, Node *pNode, TVector &pos, int numClosest)
Definition: kd_tree_static_impl.hpp:184
bool create_from_grid(Grid &grid, TVrtIterator vrtsBegin, TVrtIterator vrtsEnd, TPositionAttachment &aPos, int maxTreeDepth, int splitThreshold, KDSplitDimension splitDimension=KDSD_LARGEST)
Definition: kd_tree_static_impl.hpp:75
Node m_parentNode
Definition: kd_tree_static.h:152
int m_numNeighboursFound
Definition: kd_tree_static.h:156
KDTreeStatic()
Definition: kd_tree_static.h:104
int get_next_split_dimension(int actSplitDimension, TVertexIterator vrts_begin, TVertexIterator vrts_end)
Definition: kd_tree_static_impl.hpp:385
int get_largest_dimension(TVertexIterator vrts_begin, TVertexIterator vrts_end)
Definition: kd_tree_static_impl.hpp:340
used by KDTreeStatic
Definition: kd_tree_static.h:50
KDVertexDistance()
Definition: kd_tree_static.h:52
number distSQ
Definition: kd_tree_static.h:56
Vertex * vertex
Definition: kd_tree_static.h:55
KDVertexDistance(Vertex *vrt, float nDistSQ)
Definition: kd_tree_static.h:53
Base-class for all vertex-types.
Definition: grid_base_objects.h:231
std::list< KDVertexDistance > KDVertexDistanceList
Definition: kd_tree_static.h:67
KDSplitDimension
used by KDTreeStatic
Definition: kd_tree_static.h:62
@ KDSD_LARGEST
Definition: kd_tree_static.h:64
@ KDSD_CIRCULAR
Definition: kd_tree_static.h:63
double number
Definition: types.h:124