mirror of https://github.com/CGAL/cgal
Use EPEC_with_root_of.h instead of EPEC_with_sqrt.h and Use
SpannerKernel as the template parameter instead of traits
This commit is contained in:
parent
8e25cec681
commit
436ca7b94d
|
|
@ -37,7 +37,7 @@
|
|||
#include <CGAL/Polynomial.h>
|
||||
#include <CGAL/number_type_config.h> // CGAL_PI is defined there
|
||||
#include <CGAL/enum.h>
|
||||
#include <CGAL/Exact_predicates_exact_constructions_kernel_with_sqrt.h>
|
||||
#include <CGAL/Exact_predicates_exact_constructions_kernel_with_root_of.h>
|
||||
#include <CGAL/Aff_transformation_2.h>
|
||||
|
||||
namespace CGAL {
|
||||
|
|
@ -52,13 +52,13 @@ namespace CGAL {
|
|||
* which are slow). The inexact computation is done by the general functor definition,
|
||||
* while the exact computation is done by a specialization of this functor.
|
||||
*
|
||||
* \tparam Kernel_ If this parameter is `Exact_predicates_exact_constructions_kernel_with_sqrt`,
|
||||
* \tparam SpannerKernel If this parameter is `Exact_predicates_exact_constructions_kernel_with_root_of`,
|
||||
* the specialization functor will be called; otherwise, the general functor will
|
||||
* be called.
|
||||
*
|
||||
* In the construction of Yao graph and Theta graph implemented by this package,
|
||||
* all predicates and construction functions are from \cgal.
|
||||
* Therefore, if the kernel `Exact_predicates_exact_constructions_kernel_with_sqrt` is used,
|
||||
* Therefore, if the kernel `Exact_predicates_exact_constructions_kernel_with_root_of` is used,
|
||||
* the Yao or Theta graph will be constructed exactly, otherwise inexactly.
|
||||
*
|
||||
* Of course, this functor can also be used in other applications where the plane needs to be divided
|
||||
|
|
@ -67,16 +67,16 @@ namespace CGAL {
|
|||
* \cgalModels `ComputeConeBoundaries_2`
|
||||
*
|
||||
*/
|
||||
template <typename Kernel_>
|
||||
template <typename SpannerKernel>
|
||||
class Compute_cone_boundaries_2 {
|
||||
|
||||
public:
|
||||
/*! Indicate the type of the \cgal kernel. */
|
||||
typedef Kernel_ Kernel_type;
|
||||
typedef SpannerKernel Kernel_type;
|
||||
|
||||
private:
|
||||
typedef typename Kernel_::Direction_2 Direction_2;
|
||||
typedef typename Kernel_::Aff_transformation_2 Transformation;
|
||||
typedef typename SpannerKernel::Direction_2 Direction_2;
|
||||
typedef typename SpannerKernel::Aff_transformation_2 Transformation;
|
||||
|
||||
public:
|
||||
/* No member variables in this class, so a custom constructor is not needed. */
|
||||
|
|
@ -126,11 +126,11 @@ public:
|
|||
with a given cone number and a given initial direction.
|
||||
*/
|
||||
template <>
|
||||
class Compute_cone_boundaries_2<Exact_predicates_exact_constructions_kernel_with_sqrt> {
|
||||
class Compute_cone_boundaries_2<Exact_predicates_exact_constructions_kernel_with_root_of> {
|
||||
|
||||
public:
|
||||
/* Indicate the type of the cgal kernel. */
|
||||
typedef Exact_predicates_exact_constructions_kernel_with_sqrt Kernel_type;
|
||||
typedef Exact_predicates_exact_constructions_kernel_with_root_of Kernel_type;
|
||||
|
||||
private:
|
||||
typedef typename Kernel_type::FT FT;
|
||||
|
|
|
|||
|
|
@ -49,21 +49,21 @@ namespace CGAL {
|
|||
|
||||
\cgalModels `ConstructConeBasedSpanner_2`
|
||||
*/
|
||||
template <typename Traits, typename Graph_>
|
||||
template <typename SpannerKernel, typename Graph_>
|
||||
class Construct_theta_graph_2 {
|
||||
|
||||
public:
|
||||
/*! is the geometric traits which must be a model of the concept `ConeBasedSpannerTraits` */
|
||||
typedef Traits Geom_traits;
|
||||
/*! indicate the type of the \cgal kernel. */
|
||||
typedef SpannerKernel Kernel_type;
|
||||
/*! Indicate the specific type of `boost::adjacency_list`. */
|
||||
typedef Graph_ Graph_type;
|
||||
|
||||
private:
|
||||
typedef typename Geom_traits::Direction_2 Direction_2;
|
||||
typedef typename Geom_traits::Point_2 Point_2;
|
||||
typedef typename Geom_traits::Line_2 Line_2;
|
||||
typedef typename Geom_traits::Aff_transformation_2 Transformation;
|
||||
typedef Less_by_direction_2<Geom_traits, Graph_> Less_by_direction;
|
||||
typedef typename SpannerKernel::Direction_2 Direction_2;
|
||||
typedef typename SpannerKernel::Point_2 Point_2;
|
||||
typedef typename SpannerKernel::Line_2 Line_2;
|
||||
typedef typename SpannerKernel::Aff_transformation_2 Transformation;
|
||||
typedef Less_by_direction_2<SpannerKernel, Graph_> Less_by_direction;
|
||||
|
||||
/* Store the number of cones. */
|
||||
unsigned int cone_number;
|
||||
|
|
@ -94,7 +94,7 @@ public:
|
|||
|
||||
/* Initialize a functor, specialization will happen here depending on the kernel type to
|
||||
compute the cone boundaries either exactly or inexactly */
|
||||
Compute_cone_boundaries_2<Geom_traits> compute_cones;
|
||||
Compute_cone_boundaries_2<SpannerKernel> compute_cones;
|
||||
// compute the rays using the functor
|
||||
compute_cones(k, initial_direction, rays.begin());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,20 +47,20 @@ namespace CGAL {
|
|||
|
||||
\cgalModels `ConstructConeBasedSpanner_2`
|
||||
*/
|
||||
template <typename Traits, typename Graph_>
|
||||
template <typename SpannerKernel, typename Graph_>
|
||||
class Construct_yao_graph_2 {
|
||||
|
||||
public:
|
||||
/*! is the geometric traits which must be a model of the concept `ConeBasedSpannerTraits` */
|
||||
typedef Traits Geom_traits;
|
||||
/*! indicate the type of the \cgal kernel. */
|
||||
typedef SpannerKernel Kernel_type;
|
||||
/*! Indicate the specific type of `boost::adjacency_list`. */
|
||||
typedef Graph_ Graph_type;
|
||||
|
||||
private:
|
||||
typedef typename Geom_traits::Direction_2 Direction_2;
|
||||
typedef typename Geom_traits::Point_2 Point_2;
|
||||
typedef typename Geom_traits::Line_2 Line_2;
|
||||
typedef Less_by_direction_2<Geom_traits, Graph_> Less_by_direction;
|
||||
typedef typename SpannerKernel::Direction_2 Direction_2;
|
||||
typedef typename SpannerKernel::Point_2 Point_2;
|
||||
typedef typename SpannerKernel::Line_2 Line_2;
|
||||
typedef Less_by_direction_2<SpannerKernel, Graph_> Less_by_direction;
|
||||
// a type for the set to store vertices sorted by a direction
|
||||
typedef std::set<typename Graph_::vertex_descriptor, Less_by_direction> Point_set;
|
||||
|
||||
|
|
@ -93,7 +93,7 @@ public:
|
|||
|
||||
/* Initialize a functor, specialization will happen here depending on the kernel type to
|
||||
compute the cone boundaries either exactly or inexactly */
|
||||
Compute_cone_boundaries_2<Geom_traits> compute_cones;
|
||||
Compute_cone_boundaries_2<SpannerKernel> compute_cones;
|
||||
// compute the rays using the functor
|
||||
compute_cones(k, initial_direction, rays.begin());
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue