mirror of https://github.com/CGAL/cgal
Rename to CGAL::Frechet_distance::Neighbor_search
This commit is contained in:
parent
3a6e314036
commit
6104cce18b
|
|
@ -1,6 +1,6 @@
|
||||||
#include <CGAL/Frechet_distance.h>
|
#include <CGAL/Frechet_distance.h>
|
||||||
#include <CGAL/Frechet_distance_traits_3.h>
|
#include <CGAL/Frechet_distance_traits_3.h>
|
||||||
#include <CGAL/Frechet_distance_near_neighbors_ds.h>
|
#include <CGAL/Frechet_distance/Neighbor_search.h>
|
||||||
#include <CGAL/Simple_cartesian.h>
|
#include <CGAL/Simple_cartesian.h>
|
||||||
#include <CGAL/IO/WKT.h>
|
#include <CGAL/IO/WKT.h>
|
||||||
|
|
||||||
|
|
@ -29,7 +29,7 @@ int main(int argc, char* argv[])
|
||||||
Curve query = curves.back();
|
Curve query = curves.back();
|
||||||
curves.pop_back();
|
curves.pop_back();
|
||||||
|
|
||||||
CGAL::FrechetDistanceNearNeighborsDS<Curve, Traits> ds;
|
CGAL::Frechet_distance::Neighbor_search<Curve, Traits> ds;
|
||||||
ds.insert(curves);
|
ds.insert(curves);
|
||||||
|
|
||||||
for(const Curve& c : curves){
|
for(const Curve& c : curves){
|
||||||
|
|
|
||||||
|
|
@ -19,13 +19,13 @@
|
||||||
#include <CGAL/license/Frechet_distance.h>
|
#include <CGAL/license/Frechet_distance.h>
|
||||||
#include <CGAL/Frechet_distance.h>
|
#include <CGAL/Frechet_distance.h>
|
||||||
#include <CGAL/basic.h>
|
#include <CGAL/basic.h>
|
||||||
#include <CGAL/Frechet_distance/internal/Frechet_distance_near_neighbors_ds.h>
|
#include <CGAL/Frechet_distance/internal/Neighbor_search.h>
|
||||||
|
|
||||||
#include <iterator>
|
#include <iterator>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
namespace CGAL
|
namespace CGAL {
|
||||||
{
|
namespace Frechet_distance {
|
||||||
|
|
||||||
// TODO: hide away in Frechet_distance_::internal (different naming but nvm)
|
// TODO: hide away in Frechet_distance_::internal (different naming but nvm)
|
||||||
template <typename PointRange>
|
template <typename PointRange>
|
||||||
|
|
@ -34,7 +34,7 @@ using PointRangeKernel = typename CGAL::Kernel_traits<
|
||||||
Kernel; // TODO: replace by CORE type for initial testing
|
Kernel; // TODO: replace by CORE type for initial testing
|
||||||
|
|
||||||
template <class PointRange, class Traits = PointRangeKernel<PointRange>>
|
template <class PointRange, class Traits = PointRangeKernel<PointRange>>
|
||||||
class FrechetDistanceNearNeighborsDS
|
class Neighbor_search
|
||||||
{
|
{
|
||||||
using PT = Traits; // Polyline_traits_2<Traits, double>;
|
using PT = Traits; // Polyline_traits_2<Traits, double>;
|
||||||
using FT = typename PT::FT;
|
using FT = typename PT::FT;
|
||||||
|
|
@ -45,7 +45,7 @@ class FrechetDistanceNearNeighborsDS
|
||||||
using PolylineIDs = std::vector<PolylineID>;
|
using PolylineIDs = std::vector<PolylineID>;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
FrechetDistanceNearNeighborsDS() = default;
|
Neighbor_search() = default;
|
||||||
|
|
||||||
void insert(const Polyline& curve);
|
void insert(const Polyline& curve);
|
||||||
void insert(const Polylines& curves);
|
void insert(const Polylines& curves);
|
||||||
|
|
@ -59,7 +59,7 @@ private:
|
||||||
|
|
||||||
// TODO: store preprocessed curves after CGALization
|
// TODO: store preprocessed curves after CGALization
|
||||||
template <class PointRange, class Traits>
|
template <class PointRange, class Traits>
|
||||||
void FrechetDistanceNearNeighborsDS<PointRange, Traits>::insert(
|
void Neighbor_search<PointRange, Traits>::insert(
|
||||||
const Polylines& curves)
|
const Polylines& curves)
|
||||||
{
|
{
|
||||||
this->curves = curves; // FIXME: copies all the curves...
|
this->curves = curves; // FIXME: copies all the curves...
|
||||||
|
|
@ -69,7 +69,7 @@ void FrechetDistanceNearNeighborsDS<PointRange, Traits>::insert(
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class PointRange, class Traits>
|
template <class PointRange, class Traits>
|
||||||
auto FrechetDistanceNearNeighborsDS<PointRange, Traits>::get_close_curves(
|
auto Neighbor_search<PointRange, Traits>::get_close_curves(
|
||||||
const Polyline& curve, double distance) -> PolylineIDs
|
const Polyline& curve, double distance) -> PolylineIDs
|
||||||
{
|
{
|
||||||
auto result = kd_tree.search(curve, distance);
|
auto result = kd_tree.search(curve, distance);
|
||||||
|
|
@ -86,6 +86,7 @@ auto FrechetDistanceNearNeighborsDS<PointRange, Traits>::get_close_curves(
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
} // end of namespace CGAL
|
} // end of namespace CGAL
|
||||||
|
|
||||||
#endif // CGAL_FRECHET_DISTANCE_NEAR_NEIGHBORS_DS_H
|
#endif // CGAL_FRECHET_DISTANCE_NEAR_NEIGHBORS_DS_H
|
||||||
|
|
@ -13,8 +13,7 @@
|
||||||
// Andreas Fabri
|
// Andreas Fabri
|
||||||
// =============================================================================
|
// =============================================================================
|
||||||
|
|
||||||
#ifndef CGAL_INTERNAL_FRECHET_DISTANCE_NEAR_NEIGHBORS_DS_H
|
#pragma once
|
||||||
#define CGAL_INTERNAL_FRECHET_DISTANCE_NEAR_NEIGHBORS_DS_H
|
|
||||||
#include <CGAL/license/Frechet_distance.h>
|
#include <CGAL/license/Frechet_distance.h>
|
||||||
#include <CGAL/Dimension.h>
|
#include <CGAL/Dimension.h>
|
||||||
#include <CGAL/Kd_tree.h>
|
#include <CGAL/Kd_tree.h>
|
||||||
|
|
@ -287,7 +286,7 @@ auto FrechetKdTree<Traits>::search(Polyline const& curve, FT distance)
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace internal
|
} // namespace internal
|
||||||
} // namespace Frechet_distance_
|
} // namespace Frechet_distance
|
||||||
} // end of namespace CGAL
|
} // end of namespace CGAL
|
||||||
|
|
||||||
#endif // CGAL_INTERNAL_FRECHET_DISTANCE_NEAR_NEIGHBORS_DS_H
|
|
||||||
Loading…
Reference in New Issue