CGAL 6.1 - Shape Detection

Loading...
Searching...
No Matches
List of all members | Related Functions
CGAL::Shape_detection::Point_set::Sphere_neighbor_query< GeomTraits, Item_, PointMap > Class Template Reference
Reference Manual » Region Growing » Point Set

`#include <CGAL/Shape_detection/Region_growing/Point_set/Sphere_neighbor_query.h>`

## Definition

template<typename GeomTraits, typename Item_, typename PointMap>
class CGAL::Shape_detection::Point_set::Sphere_neighbor_query< GeomTraits, Item_, PointMap >

Fuzzy sphere neighbors search in a set of 2D or 3D points.

This class returns all neighbors of a query point, which fall in a sphere of the fixed radius centered at this point.

Template Parameters

  GeomTraits | a model of `Kernel`
  Item_ | a descriptor representing a given point. Must be a model of `Hashable`.
  PointMap | a model of `ReadablePropertyMap` whose key type is `Item_` and value type is `GeomTraits::Point_2` or `GeomTraits::Point_3`

Is model of
  `NeighborQuery`

Examples
  Shape_detection/region_growing_lines_on_point_set_2.cpp.

## Related Functions
(Note that these are not member functions.)
template<class PointSet3 >
using | Sphere_neighbor_query_for_point_set = Sphere_neighbor_query< typename Kernel_traits< typename PointSet3::Point_3 >::Kernel, typename PointSet3::Index, typename PointSet3::Point_map >
| shortcut to ease the definition of the class when using `CGAL::Point_set_3`.
template<class PointSet3 , typename NamedParameters = CGAL::parameters::Default_named_parameters>
Sphere_neighbor_query_for_point_set< PointSet3 > | make_sphere_neighbor_query (const PointSet3 &ps, NamedParameters np=parameters::default_values())
| returns an instance of the sorting class to be used with `CGAL::Point_set_3`, with point and normal maps added to `np`.

## Types
typedef GeomTraits::FT | FT
| Number type.

## Initialization
template<typename InputRange , typename NamedParameters = CGAL::parameters::Default_named_parameters>
| Sphere_neighbor_query (const InputRange &input_range, const NamedParameters &np=parameters::default_values())
| initializes a Kd-tree with input points.

## Access
void | operator() (const Item query, std::vector< Item > &neighbors) const
| implements `NeighborQuery::operator()()`.

## Constructor & Destructor Documentation

## ◆ Sphere_neighbor_query()

template<typename GeomTraits , typename Item_ , typename PointMap >
template<typename InputRange , typename NamedParameters = CGAL::parameters::Default_named_parameters>

CGAL::Shape_detection::Point_set::Sphere_neighbor_query< GeomTraits, Item_, PointMap >::Sphere_neighbor_query | ( | const InputRange & | input_range,
|  | const NamedParameters & | np = `parameters::default_values()`
| ) |  |

initializes a Kd-tree with input points.

Template Parameters

  InputRange | a model of `ConstRange` whose iterator type is `RandomAccessIterator`
  NamedParameters | a sequence of Named Parameters

Parameters

  input_range | an instance of `InputRange` with 2D or 3D points
  np | a sequence of Named Parameters among the ones listed below

Optional Named Parameters

  an instance of a model of `ReadablePropertyMap` with `InputRange::const_iterator` as key type and `Item` as value type. Default: A default is provided when `Item` is `InputRange::const_iterator` or its value type. |
  the fixed radius of the fuzzy sphere used for searching neighbors of a query point Type: `GeomTraits::FT` Default: 1 |
  an instance of `PointMap` that maps an item from `input_range` to `Kernel::Point_2` or to `Kernel::Point_3` Default: `PointMap()` |

Precondition
  `input_range.size() > 0`
  `sphere_radius > 0`

## Member Function Documentation

## ◆ operator()()

template<typename GeomTraits , typename Item_ , typename PointMap >

void CGAL::Shape_detection::Point_set::Sphere_neighbor_query< GeomTraits, Item_, PointMap >::operator() | ( | const Item | query,
|  | std::vector< Item > & | neighbors
| ) |  | const

implements `NeighborQuery::operator()()`.

This operator finds all points, which fall into a sphere of the fixed radius `sphere_radius` centered at the query point. The references of those neighbors are returned in `neighbors`.

Parameters

  query | `Item` of the query point
  neighbors | `Items` of points, which are neighbors of the query point

Precondition
  `query` is a valid const_iterator of InputRange