mirror of https://github.com/CGAL/cgal
comments of Geert-Jan:
*typos+rephrase doc *Search_traits_with_info -> Search_traits_adapter *Distance_for_point_with_info -> Distance_adapter
This commit is contained in:
parent
01338f1751
commit
a8313cc2cb
|
|
@ -317,8 +317,8 @@ wrapper for all these types. The searching itself works exactly as for \cgal\ k
|
|||
|
||||
\newpage
|
||||
\subsection{Example for Associating an Information to a Point}
|
||||
The following three example programs illustrate how to use the classes \ccc{Search_traits_with_info<Point_with_info,Point_accessor,Base_traits>} and
|
||||
\ccc{Distance_for_point_with_info<Point_with_info,Point_accessor,Base_distance>} to store in the kd-tree points and additional information.
|
||||
The following three example programs illustrate how to use the classes \ccc{Search_traits_adapter<Point_with_info,Point_accessor,Base_traits>} and
|
||||
\ccc{Distance_for_point_adapter<Point_with_info,Point_accessor,Base_distance>} to store in the kd-tree points and additional information.
|
||||
|
||||
\subsubsection{Using a Point and an Integer}
|
||||
In this example program, the search tree stores tuples of point and integer.
|
||||
|
|
|
|||
|
|
@ -1,17 +1,17 @@
|
|||
\begin{ccRefClass}{Distance_for_point_with_info<Point_with_info,Point_accessor,Base_distance>}
|
||||
\begin{ccRefClass}{Distance_for_point_adapter<Point_with_info,Point_accessor,Base_distance>}
|
||||
|
||||
\ccDefinition
|
||||
|
||||
A class that uses a point accessor to adapt a distance class to work on a
|
||||
point with info type.
|
||||
When using \ccc{Search_traits_with_info<Point_with_info,Point_accessor,Base_traits>}
|
||||
When using \ccc{Search_traits_adapter<Point_with_info,Point_accessor,Base_traits>}
|
||||
in a nearest neighbor search algorithm, this class must be used as distance.
|
||||
|
||||
|
||||
\ccInclude{CGAL/Search_traits_with_info.h}
|
||||
\ccInclude{CGAL/Search_traits_adapter.h}
|
||||
|
||||
\ccParameters
|
||||
\ccc{Point_with_info} is a point type enhanced with an information.\\
|
||||
\ccc{Point_with_info} is a type that has an associated point of type \ccc{Base_distance::Point_d}.\\
|
||||
\ccc{Point_accessor} is a model of \ccAnchor{http://www.boost.org/doc/libs/release/libs/property_map/index.html}{boost::ReadablePropertyMap}
|
||||
with \ccc{Point_with_info} as \ccc{key_type} and \ccc{Base_distance::Point_d} as \ccc{value_type}.
|
||||
In practice, the current implementation requires a class providing \ccc{Base_traits::Point_d operator[] (const Point_with_info& point) const}.\\
|
||||
|
|
@ -34,7 +34,7 @@ In practice, the current implementation requires a class providing \ccc{Base_tra
|
|||
\ccCreationVariable{d} %% choose variable name
|
||||
|
||||
|
||||
\ccConstructor{Distance_for_point_with_info(const Point_accessor& accessor=Point_accessor(),const Base_distance& base=Base_distance());}
|
||||
\ccConstructor{Distance_for_point_adapter(const Point_accessor& accessor=Point_accessor(),const Base_distance& base=Base_distance());}
|
||||
{Constructor initializing the class to \ccc{base} and setting the point accessor of the class to \ccc{accessor}.}
|
||||
|
||||
\ccOperations
|
||||
|
|
@ -45,7 +45,7 @@ In practice, the current implementation requires a class providing \ccc{Base_tra
|
|||
|
||||
\ccSeeAlso
|
||||
|
||||
\ccc{Search_traits_with_info<Point_with_info,Point_accessor,Base_traits>}
|
||||
\ccc{Search_traits_adapter<Point_with_info,Point_accessor,Base_traits>}
|
||||
|
||||
|
||||
\end{ccRefClass}
|
||||
|
|
|
|||
|
|
@ -30,8 +30,8 @@ for example \ccc{CGAL::Search_traits_2<CGAL::Cartesian<double> >}.
|
|||
|
||||
Expects for the second template argument a model of the
|
||||
concept \ccc{GeneralDistance}. If \ccc{Traits} is
|
||||
\ccc{CGAL::Search_traits_with_info<Point_with_info,Point_accessor,Base_traits>}
|
||||
the default type is \ccc{CGAL::Distance_for_point_with_info<Point_with_info,Point_accessor,CGAL::Euclidean_distance<Traits> >},
|
||||
\ccc{CGAL::Search_traits_adapter<Point_with_info,Point_accessor,Base_traits>}
|
||||
the default type is \ccc{CGAL::Distance_for_point_adapter<Point_with_info,Point_accessor,CGAL::Euclidean_distance<Traits> >},
|
||||
and \ccc{CGAL::Euclidean_distance<Traits>} otherwise.
|
||||
|
||||
Expects for third template argument a model of the concept \ccc{Splitter}.
|
||||
|
|
|
|||
|
|
@ -31,8 +31,8 @@ for example \ccc{CGAL::Cartesian_d<double>}.
|
|||
|
||||
Expects for the second template argument a model of the
|
||||
concept \ccc{GeneralDistance}. If \ccc{Traits} is
|
||||
\ccc{CGAL::Search_traits_with_info<Point_with_info,Point_accessor,Base_traits>}
|
||||
the default type is \ccc{CGAL::Distance_for_point_with_info<Point_with_info,Point_accessor,CGAL::Euclidean_distance<Traits> >},
|
||||
\ccc{CGAL::Search_traits_adapter<Point_with_info,Point_accessor,Base_traits>}
|
||||
the default type is \ccc{CGAL::Distance_for_point_adapter<Point_with_info,Point_accessor,CGAL::Euclidean_distance<Traits> >},
|
||||
and \ccc{CGAL::Euclidean_distance<Traits>} otherwise.
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -29,8 +29,8 @@ for example \ccc{CGAL::Search_traits_2<CGAL::Cartesian<double> >}.
|
|||
|
||||
Expects for the second template argument a model of the
|
||||
concept \ccc{GeneralDistance}. If \ccc{Traits} is
|
||||
\ccc{CGAL::Search_traits_with_info<Point_with_info,Point_accessor,Base_traits>}
|
||||
the default type is \ccc{CGAL::Distance_for_point_with_info<Point_with_info,Point_accessor,CGAL::Euclidean_distance<Traits> >},
|
||||
\ccc{CGAL::Search_traits_adapter<Point_with_info,Point_accessor,Base_traits>}
|
||||
the default type is \ccc{CGAL::Distance_for_point_adapter<Point_with_info,Point_accessor,CGAL::Euclidean_distance<Traits> >},
|
||||
and \ccc{CGAL::Euclidean_distance<Traits>} otherwise.
|
||||
|
||||
Expects for third template argument a model of the concept \ccc{Splitter}.
|
||||
|
|
|
|||
|
|
@ -31,8 +31,8 @@ for example \ccc{CGAL::Search_traits_2<CGAL::Cartesian<double> >}.
|
|||
|
||||
Expects for the second template argument a model of the
|
||||
concept \ccc{GeneralDistance}. If \ccc{Traits} is
|
||||
\ccc{CGAL::Search_traits_with_info<Point_with_info,Point_accessor,Base_traits>}
|
||||
the default type is \ccc{CGAL::Distance_for_point_with_info<Point_with_info,Point_accessor,CGAL::Euclidean_distance<Traits> >},
|
||||
\ccc{CGAL::Search_traits_adapter<Point_with_info,Point_accessor,Base_traits>}
|
||||
the default type is \ccc{CGAL::Distance_adapter<Point_with_info,Point_accessor,CGAL::Euclidean_distance<Traits> >},
|
||||
and \ccc{CGAL::Euclidean_distance<Traits>} otherwise.
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -28,12 +28,12 @@ specialized for this type.}
|
|||
|
||||
\ccNestedType{FT}{The number type of the \ccHtmlNoLinksFrom{Cartesian} coordinates of types \ccc{Point_d}}
|
||||
|
||||
\ccNestedType{Cartesian_const_iterator_d}{An random access iterator type to enumerate the
|
||||
\ccNestedType{Cartesian_const_iterator_d}{A random access iterator type to enumerate the
|
||||
\ccHtmlNoLinksFrom{Cartesian} coordinates of a point.}
|
||||
|
||||
\ccNestedType{Construct_cartesian_const_iterator_d}{Functor with operators to construct iterators on the
|
||||
first and the past-the-end iterator for the \ccHtmlNoLinksFrom{Cartesian} coordinates of a point. This functor must
|
||||
provides the type \ccc{result_type} that must be the same than \ccc{Cartesian_const_iterator_d}.}
|
||||
provides the type \ccc{result_type} that must be the same a \ccc{Cartesian_const_iterator_d}.}
|
||||
|
||||
\ccCreation
|
||||
\ccCreationVariable{t} %% choose variable name
|
||||
|
|
|
|||
|
|
@ -1,17 +1,17 @@
|
|||
\begin{ccRefClass}{Search_traits_with_info<Point_with_info,Point_accessor,Base_traits>}
|
||||
\begin{ccRefClass}{Search_traits_adapter<Point_with_info,Point_accessor,Base_traits>}
|
||||
|
||||
\ccDefinition
|
||||
|
||||
The class \ccRefName\ can be used as a template parameter of the kd tree
|
||||
and the search classes. When using this traits class in a nearest neighbor search algorithm, the class
|
||||
\ccc{Distance_for_point_with_info<Point_with_info,Point_accessor,Base_distance>}
|
||||
\ccc{Distance_for_point_adapter<Point_with_info,Point_accessor,Base_distance>}
|
||||
must be used as distance.
|
||||
|
||||
|
||||
\ccInclude{CGAL/Search_traits_with_info.h}
|
||||
\ccInclude{CGAL/Search_traits_adapter.h}
|
||||
|
||||
\ccParameters
|
||||
\ccc{Point_with_info} is a point type enhanced with an information.\\
|
||||
\ccc{Point_with_info} is a type that has an associated point of type \ccc{Base_type::Point_d}.\\
|
||||
\ccc{Point_accessor} is a model of \ccAnchor{http://www.boost.org/doc/libs/release/libs/property_map/index.html}{boost::ReadablePropertyMap}
|
||||
with \ccc{Point_with_info} as \ccc{key_type} and \ccc{Base_traits::Point_d} as \ccc{value_type}.
|
||||
In practice, the current implementation requires a class providing \ccc{Base_traits::Point_d operator[] (const Point_with_info& point) const}.\\
|
||||
|
|
@ -35,7 +35,7 @@ In practice, the current implementation requires a class providing \ccc{Base_tra
|
|||
\ccCreationVariable{t} %% choose variable name
|
||||
|
||||
|
||||
\ccConstructor{Search_traits_with_info(const Point_accessor& accessor=Point_accessor(),const Base_traits& base=Base_traits());}
|
||||
\ccConstructor{Search_traits_adapter(const Point_accessor& accessor=Point_accessor(),const Base_traits& base=Base_traits());}
|
||||
{Constructor initializing the class to \ccc{base} and setting the point accessor of the class to \ccc{accessor}.}
|
||||
|
||||
\ccOperations
|
||||
|
|
@ -46,7 +46,7 @@ In practice, the current implementation requires a class providing \ccc{Base_tra
|
|||
|
||||
\ccSeeAlso
|
||||
|
||||
\ccc{Distance_for_point_with_info<Point_with_info,Point_accessor,Base_distance>}\\
|
||||
\ccc{Distance_for_point_adapter<Point_with_info,Point_accessor,Base_distance>}\\
|
||||
\ccc{Search_traits_2<Kernel>}\\
|
||||
\ccc{Search_traits_3<Kernel>}\\
|
||||
\ccc{Search_traits_d<Kernel>}\\
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ classes that are described in the reference pages.
|
|||
\ccRefIdfierPage{CGAL::Search_traits_3<Kernel>}\\
|
||||
\ccRefIdfierPage{CGAL::Search_traits_d<Kernel>}\\
|
||||
\ccRefIdfierPage{CGAL::Search_traits<NT,Point,CartesianIterator,ConstructCartesianIterator,ConstructMinVertex,ConstructMaxVertex>}\\
|
||||
\ccRefIdfierPage{CGAL::Search_traits_with_info<Point_with_info,Point_accessor,Base_traits>}
|
||||
\ccRefIdfierPage{CGAL::Search_traits_adapter<Point_with_info,Point_accessor,Base_traits>}
|
||||
|
||||
\ccHeading{Distance Classes}
|
||||
|
||||
|
|
@ -64,7 +64,7 @@ classes that are described in the reference pages.
|
|||
\ccRefIdfierPage{CGAL::Euclidean_distance_sphere_point<Traits>} \\
|
||||
\ccRefIdfierPage{CGAL::Manhattan_distance_iso_box_point<Traits>} \\
|
||||
\ccRefIdfierPage{CGAL::Weighted_Minkowski_distance<Traits>} \\
|
||||
\ccRefIdfierPage{CGAL::Distance_for_point_with_info<Point_with_info,Point_accessor,Base_distance>}
|
||||
\ccRefIdfierPage{CGAL::Distance_for_point_adapter<Point_with_info,Point_accessor,Base_distance>}
|
||||
|
||||
|
||||
\ccHeading{Splitter Classes}
|
||||
|
|
|
|||
|
|
@ -35,8 +35,8 @@
|
|||
\input{Spatial_searching_ref/Search_traits_3.tex}
|
||||
\input{Spatial_searching_ref/Search_traits_d.tex}
|
||||
\input{Spatial_searching_ref/Search_traits.tex}
|
||||
\input{Spatial_searching_ref/Search_traits_with_info.tex}
|
||||
\input{Spatial_searching_ref/Distance_for_point_with_info.tex}
|
||||
\input{Spatial_searching_ref/Search_traits_adapter.tex}
|
||||
\input{Spatial_searching_ref/Distance_adapter.tex}
|
||||
\input{Spatial_searching_ref/Sliding_fair.tex}
|
||||
\input{Spatial_searching_ref/Sliding_midpoint.tex}
|
||||
\input{Spatial_searching_ref/SpatialSeparator.tex}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
|
||||
#include <CGAL/basic.h>
|
||||
#include <CGAL/Search_traits_3.h>
|
||||
#include <CGAL/Search_traits_with_info.h>
|
||||
#include <CGAL/Search_traits_adapter.h>
|
||||
#include <CGAL/point_generators_3.h>
|
||||
#include <CGAL/Orthogonal_k_neighbor_search.h>
|
||||
#include <boost/iterator/zip_iterator.hpp>
|
||||
|
|
@ -19,7 +19,7 @@ struct My_Point_accessor{
|
|||
|
||||
typedef CGAL::Random_points_in_cube_3<Point_3> Random_points_iterator;
|
||||
typedef CGAL::Search_traits_3<Kernel> Traits_base;
|
||||
typedef CGAL::Search_traits_with_info<Point,My_Point_accessor,Traits_base> Traits;
|
||||
typedef CGAL::Search_traits_adapter<Point,My_Point_accessor,Traits_base> Traits;
|
||||
|
||||
|
||||
typedef CGAL::Orthogonal_k_neighbor_search<Traits> K_neighbor_search;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
|
||||
#include <CGAL/basic.h>
|
||||
#include <CGAL/Search_traits_3.h>
|
||||
#include <CGAL/Search_traits_with_info.h>
|
||||
#include <CGAL/Search_traits_adapter.h>
|
||||
#include <CGAL/point_generators_3.h>
|
||||
#include <CGAL/Orthogonal_k_neighbor_search.h>
|
||||
#include <boost/iterator/counting_iterator.hpp>
|
||||
|
|
@ -21,7 +21,7 @@ struct My_Point_accessor{
|
|||
|
||||
typedef CGAL::Random_points_in_cube_3<Point_3> Random_points_iterator;
|
||||
typedef CGAL::Search_traits_3<Kernel> Traits_base;
|
||||
typedef CGAL::Search_traits_with_info<Point,My_Point_accessor,Traits_base> Traits;
|
||||
typedef CGAL::Search_traits_adapter<Point,My_Point_accessor,Traits_base> Traits;
|
||||
|
||||
|
||||
typedef CGAL::Orthogonal_k_neighbor_search<Traits> K_neighbor_search;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
|
||||
#include <CGAL/basic.h>
|
||||
#include <CGAL/Search_traits_3.h>
|
||||
#include <CGAL/Search_traits_with_info.h>
|
||||
#include <CGAL/Search_traits_adapter.h>
|
||||
#include <CGAL/point_generators_3.h>
|
||||
#include <CGAL/Orthogonal_k_neighbor_search.h>
|
||||
#include <boost/iterator/counting_iterator.hpp>
|
||||
|
|
@ -17,7 +17,7 @@ typedef boost::const_associative_property_map<std::map<Point,Point_3> >
|
|||
|
||||
typedef CGAL::Random_points_in_cube_3<Point_3> Random_points_iterator;
|
||||
typedef CGAL::Search_traits_3<Kernel> Traits_base;
|
||||
typedef CGAL::Search_traits_with_info<Point,My_Point_accessor,Traits_base> Traits;
|
||||
typedef CGAL::Search_traits_adapter<Point,My_Point_accessor,Traits_base> Traits;
|
||||
|
||||
|
||||
typedef CGAL::Orthogonal_k_neighbor_search<Traits> K_neighbor_search;
|
||||
|
|
|
|||
|
|
@ -27,10 +27,10 @@
|
|||
namespace CGAL{
|
||||
|
||||
template <class Point_with_info,class Point_accessor,class Base_traits>
|
||||
class Search_traits_with_info;
|
||||
class Search_traits_adapter;
|
||||
|
||||
template <class Point_with_info,class Point_accessor,class Base_distance>
|
||||
class Distance_for_point_with_info;
|
||||
class Distance_adapter;
|
||||
|
||||
namespace internal{
|
||||
|
||||
|
|
@ -52,8 +52,8 @@ struct Get_iso_box_d<T,true>
|
|||
};
|
||||
|
||||
template <class Point_with_info,class Point_accessor,class Base_traits>
|
||||
struct Spatial_searching_default_distance< ::CGAL::Search_traits_with_info<Point_with_info,Point_accessor,Base_traits> >{
|
||||
typedef ::CGAL::Distance_for_point_with_info<Point_with_info,
|
||||
struct Spatial_searching_default_distance< ::CGAL::Search_traits_adapter<Point_with_info,Point_accessor,Base_traits> >{
|
||||
typedef ::CGAL::Distance_adapter<Point_with_info,
|
||||
Point_accessor,
|
||||
typename Spatial_searching_default_distance<Base_traits>::type> type;
|
||||
};
|
||||
|
|
@ -62,13 +62,13 @@ struct Get_iso_box_d<T,true>
|
|||
|
||||
|
||||
template <class Point_with_info,class Point_accessor,class Base_traits>
|
||||
class Search_traits_with_info : public Base_traits{
|
||||
class Search_traits_adapter : public Base_traits{
|
||||
Point_accessor accessor;
|
||||
public:
|
||||
typedef Base_traits Base;
|
||||
typedef typename internal::Get_iso_box_d<Base>::type Iso_box_d;
|
||||
|
||||
Search_traits_with_info(const Point_accessor& accessor_=Point_accessor(),
|
||||
Search_traits_adapter(const Point_accessor& accessor_=Point_accessor(),
|
||||
const Base_traits& base=Base_traits()
|
||||
):Base_traits(base),accessor(accessor_){}
|
||||
|
||||
|
|
@ -110,12 +110,12 @@ public:
|
|||
};
|
||||
|
||||
template <class Point_with_info,class Point_accessor,class Base_distance>
|
||||
class Distance_for_point_with_info : public Base_distance {
|
||||
class Distance_adapter : public Base_distance {
|
||||
Point_accessor accessor;
|
||||
typedef typename Base_distance::FT FT;
|
||||
public:
|
||||
|
||||
Distance_for_point_with_info( const Point_accessor& accessor_=Point_accessor(),
|
||||
Distance_adapter( const Point_accessor& accessor_=Point_accessor(),
|
||||
const Base_distance& distance=Base_distance()
|
||||
):Base_distance(distance),accessor(accessor_){}
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
#include <CGAL/Orthogonal_k_neighbor_search.h>
|
||||
#include <CGAL/K_neighbor_search.h>
|
||||
#include <CGAL/point_generators_d.h>
|
||||
#include <CGAL/Search_traits_with_info.h>
|
||||
#include <CGAL/Search_traits_adapter.h>
|
||||
#include "Point_with_info.h"
|
||||
#include <vector>
|
||||
#include <cassert>
|
||||
|
|
@ -27,10 +27,10 @@ typedef CGAL::K_neighbor_search<SearchTraits> K_neighbor_searc
|
|||
typedef Orthogonal_k_neighbor_search::Distance Distance;
|
||||
//typdefs for Point_with_info
|
||||
typedef Point_with_info_helper<SearchTraits::Point_d>::type Point_with_info;
|
||||
typedef CGAL::Search_traits_with_info<Point_with_info,Point_accessor,SearchTraits> Traits_with_info;
|
||||
typedef CGAL::Distance_for_point_with_info <Point_with_info,Point_accessor,Distance> Distance_with_info;
|
||||
typedef CGAL::Orthogonal_k_neighbor_search<Traits_with_info,Distance_with_info> Orthogonal_k_neighbor_search_with_info;
|
||||
typedef CGAL::K_neighbor_search<Traits_with_info,Distance_with_info> K_neighbor_search_with_info;
|
||||
typedef CGAL::Search_traits_adapter<Point_with_info,Point_accessor,SearchTraits> Traits_with_info;
|
||||
typedef CGAL::Distance_adapter <Point_with_info,Point_accessor,Distance> Distance_adapter;
|
||||
typedef CGAL::Orthogonal_k_neighbor_search<Traits_with_info,Distance_adapter> Orthogonal_k_neighbor_search_with_info;
|
||||
typedef CGAL::K_neighbor_search<Traits_with_info,Distance_adapter> K_neighbor_search_with_info;
|
||||
|
||||
|
||||
const unsigned int N = 1000;
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
#include <CGAL/basic.h>
|
||||
#include <CGAL/Search_traits.h>
|
||||
#include <CGAL/Search_traits_with_info.h>
|
||||
#include <CGAL/Search_traits_adapter.h>
|
||||
#include <CGAL/point_generators_3.h>
|
||||
#include <CGAL/Orthogonal_k_neighbor_search.h>
|
||||
#include <cassert>
|
||||
|
|
@ -16,9 +16,9 @@ typedef CGAL::Search_traits<double, Point, const double*, Construct_coord_iterat
|
|||
typedef CGAL::Orthogonal_k_neighbor_search<Traits, Distance> K_neighbor_search;
|
||||
//typdefs for Point_with_info
|
||||
typedef Point_with_info_helper<Point>::type Point_with_info;
|
||||
typedef CGAL::Search_traits_with_info<Point_with_info,Point_accessor,Traits> Traits_with_info;
|
||||
typedef CGAL::Distance_for_point_with_info <Point_with_info,Point_accessor,Distance> Distance_with_info;
|
||||
typedef CGAL::Orthogonal_k_neighbor_search<Traits_with_info, Distance_with_info> K_neighbor_search_with_info;
|
||||
typedef CGAL::Search_traits_adapter<Point_with_info,Point_accessor,Traits> Traits_with_info;
|
||||
typedef CGAL::Distance_adapter <Point_with_info,Point_accessor,Distance> Distance_adapter;
|
||||
typedef CGAL::Orthogonal_k_neighbor_search<Traits_with_info, Distance_adapter> K_neighbor_search_with_info;
|
||||
|
||||
const unsigned int N = 1000;
|
||||
const unsigned int K = 5;
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
#include <cassert>
|
||||
#include <CGAL/Kd_tree.h>
|
||||
#include <CGAL/Search_traits_2.h>
|
||||
#include <CGAL/Search_traits_with_info.h>
|
||||
#include <CGAL/Search_traits_adapter.h>
|
||||
#include <CGAL/point_generators_2.h>
|
||||
#include <CGAL/algorithm.h>
|
||||
#include <CGAL/Fuzzy_sphere.h>
|
||||
|
|
@ -22,7 +22,7 @@ typedef CGAL::Counting_iterator<Random_points_iterator> N_Random_points_iterator
|
|||
typedef CGAL::Search_traits_2<K> Traits;
|
||||
//for Point_with_info
|
||||
typedef Point_with_info_helper<Point>::type Point_with_info;
|
||||
typedef CGAL::Search_traits_with_info<Point_with_info,Point_accessor,Traits> Traits_with_info;
|
||||
typedef CGAL::Search_traits_adapter<Point_with_info,Point_accessor,Traits> Traits_with_info;
|
||||
|
||||
|
||||
template <class Traits>
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
#include <cassert>
|
||||
#include <CGAL/Kd_tree.h>
|
||||
#include <CGAL/Search_traits_2.h>
|
||||
#include <CGAL/Search_traits_with_info.h>
|
||||
#include <CGAL/Search_traits_adapter.h>
|
||||
#include <CGAL/point_generators_2.h>
|
||||
#include <CGAL/Fuzzy_iso_box.h>
|
||||
#include "Point_with_info.h"
|
||||
|
|
@ -20,7 +20,7 @@ typedef CGAL::Random_points_in_square_2<Point> Random_points_iterator;
|
|||
typedef CGAL::Counting_iterator<Random_points_iterator> N_Random_points_iterator;
|
||||
typedef CGAL::Search_traits_2<K> Traits;
|
||||
typedef Point_with_info_helper<Point>::type Point_with_info;
|
||||
typedef CGAL::Search_traits_with_info<Point_with_info,Point_accessor,Traits> Traits_with_info;
|
||||
typedef CGAL::Search_traits_adapter<Point_with_info,Point_accessor,Traits> Traits_with_info;
|
||||
|
||||
template <class SearchTraits>
|
||||
void run(std::list<Point> all_points)
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
#include <CGAL/Manhattan_distance_iso_box_point.h>
|
||||
#include <CGAL/K_neighbor_search.h>
|
||||
#include <CGAL/Search_traits_2.h>
|
||||
#include <CGAL/Search_traits_with_info.h>
|
||||
#include <CGAL/Search_traits_adapter.h>
|
||||
#include "Point_with_info.h"
|
||||
|
||||
typedef CGAL::Cartesian<double> Kernel;
|
||||
|
|
@ -16,9 +16,9 @@ typedef CGAL::Manhattan_distance_iso_box_point<TreeTraits> Distance;
|
|||
typedef CGAL::K_neighbor_search<TreeTraits, Distance> Neighbor_search;
|
||||
//typdefs for Point_with_info
|
||||
typedef Point_with_info_helper<Point_d>::type Point_with_info;
|
||||
typedef CGAL::Search_traits_with_info<Point_with_info,Point_accessor,TreeTraits> Traits_with_info;
|
||||
typedef CGAL::Distance_for_point_with_info <Point_with_info,Point_accessor,Distance> Distance_with_info;
|
||||
typedef CGAL::K_neighbor_search<Traits_with_info, Distance_with_info> Neighbor_search_with_info;
|
||||
typedef CGAL::Search_traits_adapter<Point_with_info,Point_accessor,TreeTraits> Traits_with_info;
|
||||
typedef CGAL::Distance_adapter <Point_with_info,Point_accessor,Distance> Distance_adapter;
|
||||
typedef CGAL::K_neighbor_search<Traits_with_info, Distance_adapter> Neighbor_search_with_info;
|
||||
|
||||
const unsigned int K = 8;
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
#include <CGAL/Euclidean_distance_sphere_point.h>
|
||||
#include <CGAL/K_neighbor_search.h>
|
||||
#include <CGAL/point_generators_2.h>
|
||||
#include <CGAL/Search_traits_with_info.h>
|
||||
#include <CGAL/Search_traits_adapter.h>
|
||||
#include "Point_with_info.h"
|
||||
#include <vector>
|
||||
#include <algorithm>
|
||||
|
|
@ -21,9 +21,9 @@ typedef CGAL::K_neighbor_search<TreeTraits, Distance> Neighbor_search;
|
|||
typedef CGAL::Random_points_in_square_2<Point> Random_points_iterator;
|
||||
//typdefs for Point_with_info
|
||||
typedef Point_with_info_helper<Point>::type Point_with_info;
|
||||
typedef CGAL::Search_traits_with_info<Point_with_info,Point_accessor,TreeTraits> Traits_with_info;
|
||||
typedef CGAL::Distance_for_point_with_info <Point_with_info,Point_accessor,Distance> Distance_with_info;
|
||||
typedef CGAL::K_neighbor_search<Traits_with_info, Distance_with_info> Neighbor_search_with_info;
|
||||
typedef CGAL::Search_traits_adapter<Point_with_info,Point_accessor,TreeTraits> Traits_with_info;
|
||||
typedef CGAL::Distance_adapter <Point_with_info,Point_accessor,Distance> Distance_adapter;
|
||||
typedef CGAL::K_neighbor_search<Traits_with_info, Distance_adapter> Neighbor_search_with_info;
|
||||
|
||||
|
||||
const unsigned int N = 1000;
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
#include <CGAL/Orthogonal_incremental_neighbor_search.h>
|
||||
#include <CGAL/Incremental_neighbor_search.h>
|
||||
#include <CGAL/algorithm.h>
|
||||
#include <CGAL/Search_traits_with_info.h>
|
||||
#include <CGAL/Search_traits_adapter.h>
|
||||
#include "Point_with_info.h"
|
||||
|
||||
|
||||
|
|
@ -39,9 +39,9 @@ typedef Orthogonal_incremental_neighbor_search::iterator NN_iterator;
|
|||
typedef Orthogonal_incremental_neighbor_search::Point_with_transformed_distance Point_with_transformed_distance;
|
||||
//typdefs for Point_with_info
|
||||
typedef Point_with_info_helper<Point>::type Point_with_info;
|
||||
typedef CGAL::Search_traits_with_info<Point_with_info,Point_accessor,TreeTraits> Traits_with_info;
|
||||
typedef CGAL::Distance_for_point_with_info <Point_with_info,Point_accessor,Distance> Distance_with_info;
|
||||
typedef CGAL::Incremental_neighbor_search<Traits_with_info,Distance_with_info> Orthogonal_incremental_neighbor_search_with_info;
|
||||
typedef CGAL::Search_traits_adapter<Point_with_info,Point_accessor,TreeTraits> Traits_with_info;
|
||||
typedef CGAL::Distance_adapter <Point_with_info,Point_accessor,Distance> Distance_adapter;
|
||||
typedef CGAL::Incremental_neighbor_search<Traits_with_info,Distance_adapter> Orthogonal_incremental_neighbor_search_with_info;
|
||||
|
||||
|
||||
template <class K_search>
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
#include <CGAL/Cartesian.h>
|
||||
#include <CGAL/point_generators_2.h>
|
||||
#include <CGAL/Search_traits_2.h>
|
||||
#include <CGAL/Search_traits_with_info.h>
|
||||
#include <CGAL/Search_traits_adapter.h>
|
||||
#include <CGAL/Orthogonal_k_neighbor_search.h>
|
||||
#include "Point_with_info.h"
|
||||
#include <set>
|
||||
|
|
@ -16,9 +16,9 @@ typedef CGAL::Search_traits_2<K> TreeTrai
|
|||
typedef CGAL::Orthogonal_k_neighbor_search<TreeTraits> Neighbor_search;
|
||||
//typdefs fo Point_with_info
|
||||
typedef Point_with_info_helper<Point>::type Point_with_info;
|
||||
typedef CGAL::Search_traits_with_info<Point_with_info,Point_accessor,TreeTraits> Traits_with_info;
|
||||
typedef CGAL::Distance_for_point_with_info <Point_with_info,Point_accessor,Neighbor_search::Distance> Distance_with_info;
|
||||
typedef CGAL::Orthogonal_k_neighbor_search<Traits_with_info,Distance_with_info> Neighbor_search_with_info;
|
||||
typedef CGAL::Search_traits_adapter<Point_with_info,Point_accessor,TreeTraits> Traits_with_info;
|
||||
typedef CGAL::Distance_adapter <Point_with_info,Point_accessor,Neighbor_search::Distance> Distance_adapter;
|
||||
typedef CGAL::Orthogonal_k_neighbor_search<Traits_with_info,Distance_adapter> Neighbor_search_with_info;
|
||||
|
||||
template <class K_search>
|
||||
void search(bool nearest)
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
#include <cassert>
|
||||
#include <CGAL/Kd_tree.h>
|
||||
#include <CGAL/Search_traits_3.h>
|
||||
#include <CGAL/Search_traits_with_info.h>
|
||||
#include <CGAL/Search_traits_adapter.h>
|
||||
#include <CGAL/point_generators_3.h>
|
||||
#include <CGAL/Fuzzy_iso_box.h>
|
||||
#include "Point_with_info.h"
|
||||
|
|
@ -19,7 +19,7 @@ typedef CGAL::Counting_iterator<Random_points_iterator> N_Random_points_iterator
|
|||
typedef CGAL::Search_traits_3<K> Traits;
|
||||
//for Point_with_info
|
||||
typedef Point_with_info_helper<Point>::type Point_with_info;
|
||||
typedef CGAL::Search_traits_with_info<Point_with_info,Point_accessor,Traits> Traits_with_info;
|
||||
typedef CGAL::Search_traits_adapter<Point_with_info,Point_accessor,Traits> Traits_with_info;
|
||||
|
||||
const int N=10000;
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
#include <CGAL/Random.h>
|
||||
#include <CGAL/Search_traits_2.h>
|
||||
#include <CGAL/Search_traits_3.h>
|
||||
#include <CGAL/Search_traits_with_info.h>
|
||||
#include <CGAL/Search_traits_adapter.h>
|
||||
#include <CGAL/Orthogonal_incremental_neighbor_search.h>
|
||||
#include <CGAL/algorithm.h>
|
||||
#include "Point_with_info.h"
|
||||
|
|
@ -29,8 +29,8 @@ typedef CGAL::Search_traits_3<K> TreeTraits;
|
|||
typedef CGAL::Euclidean_distance<TreeTraits> Distance;
|
||||
#endif
|
||||
typedef Point_with_info_helper<Point>::type Point_with_info;
|
||||
typedef CGAL::Search_traits_with_info<Point_with_info,Point_accessor,TreeTraits> Traits_with_info;
|
||||
typedef CGAL::Distance_for_point_with_info <Point_with_info,Point_accessor,Distance> Distance_with_info;
|
||||
typedef CGAL::Search_traits_adapter<Point_with_info,Point_accessor,TreeTraits> Traits_with_info;
|
||||
typedef CGAL::Distance_adapter <Point_with_info,Point_accessor,Distance> Distance_adapter;
|
||||
|
||||
typedef std::vector<Point> Vector;
|
||||
|
||||
|
|
@ -99,14 +99,14 @@ main() {
|
|||
std::cout << "Testing Sliding_midpoint" << std::endl;
|
||||
Splitter_test<TreeTraits,CGAL::Sliding_midpoint<TreeTraits>,Distance > st;
|
||||
st(points,query);
|
||||
Splitter_test<Traits_with_info,CGAL::Sliding_midpoint<Traits_with_info>,Distance_with_info > sti;
|
||||
Splitter_test<Traits_with_info,CGAL::Sliding_midpoint<Traits_with_info>,Distance_adapter > sti;
|
||||
sti(points,query);
|
||||
}
|
||||
{
|
||||
std::cout << "Testing Sliding_fair" << std::endl;
|
||||
Splitter_test<TreeTraits,CGAL::Sliding_fair<TreeTraits>,Distance > st;
|
||||
st(points,query);
|
||||
Splitter_test<Traits_with_info,CGAL::Sliding_fair<Traits_with_info>,Distance_with_info > sti;
|
||||
Splitter_test<Traits_with_info,CGAL::Sliding_fair<Traits_with_info>,Distance_adapter > sti;
|
||||
sti(points,query);
|
||||
}
|
||||
|
||||
|
|
@ -114,7 +114,7 @@ main() {
|
|||
std::cout << "Testing Fair" << std::endl;
|
||||
Splitter_test<TreeTraits,CGAL::Fair<TreeTraits>,Distance > st;
|
||||
st(points,query);
|
||||
Splitter_test<Traits_with_info,CGAL::Fair<Traits_with_info>,Distance_with_info > sti;
|
||||
Splitter_test<Traits_with_info,CGAL::Fair<Traits_with_info>,Distance_adapter > sti;
|
||||
sti(points,query);
|
||||
}
|
||||
|
||||
|
|
@ -122,7 +122,7 @@ main() {
|
|||
std::cout << "Testing Median_of_rectangle" << std::endl;
|
||||
Splitter_test<TreeTraits,CGAL::Median_of_rectangle<TreeTraits>,Distance > st;
|
||||
st(points,query);
|
||||
Splitter_test<Traits_with_info,CGAL::Median_of_rectangle<Traits_with_info>,Distance_with_info > sti;
|
||||
Splitter_test<Traits_with_info,CGAL::Median_of_rectangle<Traits_with_info>,Distance_adapter > sti;
|
||||
sti(points,query);
|
||||
}
|
||||
|
||||
|
|
@ -131,7 +131,7 @@ main() {
|
|||
std::cout << "Testing Midpoint_of_rectangle" << std::endl;
|
||||
Splitter_test<TreeTraits,CGAL::Midpoint_of_rectangle<TreeTraits>,Distance > st;
|
||||
st(points,query);
|
||||
Splitter_test<Traits_with_info,CGAL::Midpoint_of_rectangle<Traits_with_info>,Distance_with_info > sti;
|
||||
Splitter_test<Traits_with_info,CGAL::Midpoint_of_rectangle<Traits_with_info>,Distance_adapter > sti;
|
||||
sti(points,query);
|
||||
}
|
||||
|
||||
|
|
@ -139,14 +139,14 @@ main() {
|
|||
std::cout << "Testing Midpoint_of_max_spread" << std::endl;
|
||||
Splitter_test<TreeTraits,CGAL::Midpoint_of_max_spread<TreeTraits>,Distance > st;
|
||||
st(points,query);
|
||||
Splitter_test<Traits_with_info,CGAL::Midpoint_of_max_spread<Traits_with_info>,Distance_with_info > sti;
|
||||
Splitter_test<Traits_with_info,CGAL::Midpoint_of_max_spread<Traits_with_info>,Distance_adapter > sti;
|
||||
sti(points,query);
|
||||
}
|
||||
{
|
||||
std::cout << "Testing Median_of_max_spread" << std::endl;
|
||||
Splitter_test<TreeTraits,CGAL::Median_of_max_spread<TreeTraits>,Distance > st;
|
||||
st(points,query);
|
||||
Splitter_test<Traits_with_info,CGAL::Median_of_max_spread<Traits_with_info>,Distance_with_info > sti;
|
||||
Splitter_test<Traits_with_info,CGAL::Median_of_max_spread<Traits_with_info>,Distance_adapter > sti;
|
||||
sti(points,query);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue