10#ifndef CDT_POINTKDTREE_H
11#define CDT_POINTKDTREE_H
22 size_t NumVerticesInLeaf = 32,
23 size_t InitialStackDepth = 32,
24 size_t StackDepthIncrement = 32>
32 V2d_t min = points.front();
34 typedef typename std::vector<V2d_t>::const_iterator Cit;
35 for(Cit it = points.begin(); it != points.end(); ++it)
37 min = V2d_t::make(std::min(min.x, it->x), std::min(min.y, it->y));
38 max = V2d_t::make(std::max(max.x, it->x), std::max(max.y, it->y));
41 for(
VertInd i(0); i < points.size(); ++i)
43 m_kdTree.
insert(i, points);
49 m_kdTree.
insert(i, points);
56 return m_kdTree.
nearest(pos, points).second;
61 return m_kdTree.size();
70 typedef KDTree::KDTree<
Simple tree structure with alternating half splitting nodes.
void insert(const point_index &iPoint, const std::vector< point_type > &points)
Insert a point into kd-tree.
value_type nearest(const point_type &point, const std::vector< point_type > &points) const
Query kd-tree for a nearest neighbor point.
void initialize(const std::vector< V2d< TCoordType > > &points)
Initialize KD-tree with points.
void addPoint(const VertInd i, const std::vector< V2d< TCoordType > > &points)
Add point to KD-tree.
VertInd nearPoint(const V2d< TCoordType > &pos, const std::vector< V2d< TCoordType > > &points) const
Find nearest point using R-tree.
Namespace containing triangulation functionality.
IndexSizeType VertInd
Vertex index.