CGAL::Orthogonal_k_neighbor_search<Traits, OrthogonalDistance, Splitter, SpatialTree>

Definition

The class Orthogonal_k_neighbor_search<Traits, OrthogonalDistance, Splitter, SpatialTree> implements approximate k-nearest and k-furthest neighbor searching on a tree using an orthogonal distance class.

#include <CGAL/Orthogonal_k_neighbor_search.h>

Parameters

Expects for the first template argument an implementation of the concept SearchTraits, for example CGAL::Search_traits_2<CGAL::Cartesian<double> >.

Expects for the second template argument a model of the concept GeneralDistance. The default type is CGAL::Euclidean_distance<Traits>.

Expects for third template argument a model of the concept Splitter. The default type is CGAL::Sliding_midpoint<Traits>.

Expects for fourth template argument an implementation of the concept SpatialTree. The default type is CGAL::Kd_tree<Traits, Splitter, CGAL::Tag_true>. The template argument must be CGAL::Tag_true because orthogonal search needs extended kd tree nodes.

Types

Traits::Point_d Point_d; Point type.

Traits::FT FT; Number type.

GeneralDistance::Query_item
Query_item; Query item.

std::pair<Point_d,FT>
Point_with_transformed_distance;
Pair of point and transformed distance.

Orthogonal_k_neighbor_search<Traits, OrthogonalDistance, Splitter, SpatialTree>::iterator
Bidirectional iterator with value type Point_with_transformed_distance for enumerating approximate neighbors.

SpatialTree Tree; The tree type.

Operations

Orthogonal_k_neighbor_search<Traits, OrthogonalDistance, Splitter, SpatialTree> s (
SpatialTree tree,
Query_item query,
int k=1,
FT eps=FT(0.0),
bool search_nearest=true,
OrthogonalDistance d=OrthogonalDistance());
Constructor for searching approximately k neighbors of the query item query in the points stored in tree using distance d and approximation factor eps.

iterator s.begin () Returns an iterator to the approximate neighbors.

iterator s.end () Past-the-end iterator.


begin of advanced section  advanced  begin of advanced section
std::ostream& s.statistics ( std::ostream& s)
Inserts statistics of the search process into the output stream s.
end of advanced section  advanced  end of advanced section

See Also

CGAL::K_neighbor_search<Traits, GeneralDistance, Splitter, SpatialTree>.