CGAL 5.3 - dD Spatial Searching
CGAL::Orthogonal_k_neighbor_search< Traits, OrthogonalDistance, Splitter, SpatialTree > Class Template Reference

#include <CGAL/Orthogonal_k_neighbor_search.h>

Definition

The class Orthogonal_k_neighbor_search implements approximatek-nearest and k-furthest neighbor searching on a tree using an orthogonal distance class.

Template Parameters
Traitsmust be a model of the concept SearchTraits, for example Search_traits_2<Simple_cartesian<double> >.
OrthogonalDistancemust be a model of the concept OrthogonalDistance. If Traits is Search_traits_adapter<Key,PointPropertyMap,BaseTraits> the default type is Distance_adapter<Key,PointPropertyMap,Euclidean_distance<BaseTraits> >, and Euclidean_distance<Traits> otherwise.
Splittermust be a model of the concept Splitter. The default type is Sliding_midpoint<Traits>.
SpatialTreemust be a model of the concept SpatialTree. The default type is Kd_tree<Traits, Splitter, Tag_true, Tag_false>. The third template argument must be Tag_true because orthogonal search needs extended kd tree nodes.
See also
CGAL::K_neighbor_search<Traits, GeneralDistance, Splitter, SpatialTree>
Examples:
Spatial_searching/nearest_neighbor_searching.cpp, Spatial_searching/parallel_kdtree.cpp, Spatial_searching/searching_polyhedron_vertices.cpp, Spatial_searching/searching_sphere_orthogonally.cpp, Spatial_searching/searching_surface_mesh_vertices.cpp, Spatial_searching/searching_with_point_with_info.cpp, Spatial_searching/searching_with_point_with_info_inplace.cpp, Spatial_searching/searching_with_point_with_info_pmap.cpp, Spatial_searching/splitter_worst_cases.cpp, Spatial_searching/user_defined_point_and_distance.cpp, Spatial_searching/using_fair_splitting_rule.cpp, and Spatial_searching/weighted_Minkowski_distance.cpp.

Types

typedef Traits::Point_d Point_d
 Point type.
 
typedef Traits::FT FT
 Number type.
 
typedef OrthogonalDistance Distance
 Distance type.
 
typedef GeneralDistance::Query_item Query_item
 Query item.
 
typedef std::pair< Point_d, FTPoint_with_transformed_distance
 Pair of point and transformed distance.
 
typedef unspecified_type iterator
 Bidirectional const iterator with value type Point_with_transformed_distance for enumerating approximate neighbors.
 
typedef SpatialTree Tree
 The tree type.
 

Operations

 Orthogonal_k_neighbor_search (SpatialTree tree, Query_item query, unsigned int k=1, FT eps=FT(0.0), bool search_nearest=true, OrthogonalDistance d=OrthogonalDistance(), bool sorted=true)
 Constructor for searching approximately k neighbors of the query item query in the points stored in tree using distance d and approximation factor eps. More...
 
iterator begin () const
 Returns a const iterator to the approximate nearest or furthest neighbor.
 
iterator end () const
 Returns the appropriate past-the-end const iterator.
 
std::ostream & statistics (std::ostream &s)
 Inserts statistics of the search process into the output stream s.
 

Constructor & Destructor Documentation

◆ Orthogonal_k_neighbor_search()

template<typename Traits , typename OrthogonalDistance , typename Splitter , typename SpatialTree >
CGAL::Orthogonal_k_neighbor_search< Traits, OrthogonalDistance, Splitter, SpatialTree >::Orthogonal_k_neighbor_search ( SpatialTree  tree,
Query_item  query,
unsigned int  k = 1,
FT  eps = FT(0.0),
bool  search_nearest = true,
OrthogonalDistance  d = OrthogonalDistance(),
bool  sorted = true 
)

Constructor for searching approximately k neighbors of the query item query in the points stored in tree using distance d and approximation factor eps.

sorted indicates if the computed sequence of k-nearest neighbors needs to be sorted.