mirror of https://github.com/CGAL/cgal
introduce new constructor in Kd_tree
This commit is contained in:
parent
45ea4541af
commit
258b4d3c82
|
|
@ -99,14 +99,20 @@ Constructs an empty `k-d` tree.
|
|||
Kd_tree(Splitter s=Splitter(),Traits t=Traits());
|
||||
|
||||
/*!
|
||||
|
||||
Constructs a `k-d` tree on the elements from the sequence
|
||||
`[first, beyond)` using the splitting rule implemented by `s`.
|
||||
The value type of the `InputIterator` must be `Point_d`.
|
||||
|
||||
*/
|
||||
template <class InputIterator> Kd_tree(InputIterator first, InputIterator beyond, Splitter s=Splitter(),Traits t=Traits());
|
||||
|
||||
/*!
|
||||
Constructs a `k-d` tree on the elements from the range `points`
|
||||
using the splitting rule implemented by `s`.
|
||||
The value type of elements in `PointRange` must be `Point_d`.
|
||||
*/
|
||||
template <class PointRange>
|
||||
Kd_tree(const PointRange& points, Splitter s = Splitter(), const Traits t = Traits());
|
||||
|
||||
/*!
|
||||
The constructor does not build the internal data structure, and it
|
||||
is also not updated after calls to `insert()`.
|
||||
|
|
|
|||
|
|
@ -287,6 +287,15 @@ public:
|
|||
: traits_(traits), split(s), pts(first, beyond), built_(false)
|
||||
{ }
|
||||
|
||||
template <class PointRange>
|
||||
Kd_tree(const PointRange& points,
|
||||
Splitter s = Splitter(), const SearchTraits traits = SearchTraits())
|
||||
: traits_(traits),
|
||||
split(s),
|
||||
pts(std::begin(points), std::end(points)),
|
||||
built_(false)
|
||||
{ }
|
||||
|
||||
bool empty() const {
|
||||
return pts.empty();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue