mirror of https://github.com/CGAL/cgal
Added type Voronoi_point to both traits classes; Made class Circular_arc_2 internal of the CORE traits class (avoids conflicts if CK is included)
This commit is contained in:
parent
4cdd12eab4
commit
6d0785d1a7
|
|
@ -62,10 +62,10 @@ public:
|
||||||
typedef typename Base::All_faces_iterator All_faces_iterator;
|
typedef typename Base::All_faces_iterator All_faces_iterator;
|
||||||
|
|
||||||
typedef Gt Geom_traits;
|
typedef Gt Geom_traits;
|
||||||
typedef typename Geom_traits::FT FT;
|
typedef typename Geom_traits::FT FT;
|
||||||
typedef typename Geom_traits::Point_2 Point;
|
typedef typename Geom_traits::Point_2 Point;
|
||||||
//typedef typename Geom_traits::Circular_arc_point_2 Circular_arc_point;
|
typedef typename Geom_traits::Voronoi_point Voronoi_point;
|
||||||
typedef typename Geom_traits::Hyperbolic_segment_2 Hyperbolic_segment;
|
typedef typename Geom_traits::Hyperbolic_segment_2 Hyperbolic_segment;
|
||||||
|
|
||||||
Hyperbolic_Delaunay_triangulation_2(const Gt& gt = Gt())
|
Hyperbolic_Delaunay_triangulation_2(const Gt& gt = Gt())
|
||||||
: Delaunay_triangulation_2<Gt,Tds>(gt) {}
|
: Delaunay_triangulation_2<Gt,Tds>(gt) {}
|
||||||
|
|
@ -477,8 +477,7 @@ public:
|
||||||
Finite_edges_iterator finite_edges_begin() const { return hyperbolic_edges_begin(); }
|
Finite_edges_iterator finite_edges_begin() const { return hyperbolic_edges_begin(); }
|
||||||
Finite_edges_iterator finite_edges_end() const { return hyperbolic_edges_end(); }
|
Finite_edges_iterator finite_edges_end() const { return hyperbolic_edges_end(); }
|
||||||
|
|
||||||
//Circular_arc_point
|
Voronoi_point
|
||||||
Point
|
|
||||||
dual(Face_handle f) const
|
dual(Face_handle f) const
|
||||||
{
|
{
|
||||||
CGAL_triangulation_precondition (!this->is_non_hyperbolic(f));
|
CGAL_triangulation_precondition (!this->is_non_hyperbolic(f));
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,7 @@
|
||||||
#define CGAL_HYPERBOLIC_DELAUNAY_TRIANGULATION_CK_TRAITS_2_H
|
#define CGAL_HYPERBOLIC_DELAUNAY_TRIANGULATION_CK_TRAITS_2_H
|
||||||
|
|
||||||
#include <CGAL/Regular_triangulation_euclidean_traits_2.h>
|
#include <CGAL/Regular_triangulation_euclidean_traits_2.h>
|
||||||
|
#include <CGAL/Circular_kernel_2/Intersection_traits.h>
|
||||||
#include "boost/tuple/tuple.hpp"
|
#include "boost/tuple/tuple.hpp"
|
||||||
#include "boost/variant.hpp"
|
#include "boost/variant.hpp"
|
||||||
|
|
||||||
|
|
@ -44,6 +45,7 @@ public:
|
||||||
typedef typename R::Circular_arc_2 Circular_arc_2;
|
typedef typename R::Circular_arc_2 Circular_arc_2;
|
||||||
typedef typename R::Line_arc_2 Line_arc_2;
|
typedef typename R::Line_arc_2 Line_arc_2;
|
||||||
typedef typename R::Circular_arc_point_2 Circular_arc_point_2;
|
typedef typename R::Circular_arc_point_2 Circular_arc_point_2;
|
||||||
|
typedef Circular_arc_point_2 Voronoi_point;
|
||||||
typedef typename R::Segment_2 Euclidean_segment_2; //only used internally here
|
typedef typename R::Segment_2 Euclidean_segment_2; //only used internally here
|
||||||
typedef boost::variant<Circular_arc_2, Line_arc_2> Hyperbolic_segment_2;
|
typedef boost::variant<Circular_arc_2, Line_arc_2> Hyperbolic_segment_2;
|
||||||
|
|
||||||
|
|
@ -133,9 +135,8 @@ public:
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
Circular_arc_point_2 operator()(Point_2 p, Point_2 q, Point_2 r)
|
Voronoi_point operator()(Point_2 p, Point_2 q, Point_2 r)
|
||||||
{
|
{
|
||||||
std::cout << "Computing circumcenter" << std::endl;
|
|
||||||
Origin o;
|
Origin o;
|
||||||
Point_2 po = Point_2(o);
|
Point_2 po = Point_2(o);
|
||||||
Circle_2 l_inf(po, FT(1));
|
Circle_2 l_inf(po, FT(1));
|
||||||
|
|
|
||||||
|
|
@ -42,81 +42,82 @@ using std::make_pair;
|
||||||
namespace CGAL {
|
namespace CGAL {
|
||||||
|
|
||||||
|
|
||||||
template <class R>
|
|
||||||
class Circular_arc_2 {
|
|
||||||
typedef typename R::FT FT;
|
|
||||||
typedef Exact_complex<FT> Cplx;
|
|
||||||
typedef typename R::Point_2 Point;
|
|
||||||
typedef typename R::Circle_2 Circle;
|
|
||||||
typedef typename R::Orientation_2 Orientation_2;
|
|
||||||
|
|
||||||
private:
|
|
||||||
Circle _c;
|
|
||||||
Point _s, _t;
|
|
||||||
|
|
||||||
public:
|
|
||||||
Circular_arc_2() :
|
|
||||||
_c(Point(FT(0),FT(0)), FT(0)), _s(FT(0),FT(0)), _t(FT(0),FT(0)) {}
|
|
||||||
|
|
||||||
Circular_arc_2(Circle c, Point source, Point target) :
|
|
||||||
_c(c), _s(source), _t(target) {}
|
|
||||||
|
|
||||||
Circular_arc_2(Point p1, Point p2) {
|
|
||||||
Cplx p(p1), q(p2);
|
|
||||||
Cplx O(0,0);
|
|
||||||
Cplx inv;
|
|
||||||
if (p == O) {
|
|
||||||
inv = q.invert_in_unit_circle();
|
|
||||||
} else {
|
|
||||||
inv = p.invert_in_unit_circle();
|
|
||||||
}
|
|
||||||
|
|
||||||
Point ip(inv.real(), inv.imag());
|
|
||||||
|
|
||||||
_c = Circle(p1, p2, ip);
|
|
||||||
if (Orientation_2()(p1, p2, _c.center()) == LEFT_TURN) {
|
|
||||||
_s = p1;
|
|
||||||
_t = p2;
|
|
||||||
} else {
|
|
||||||
_s = p2;
|
|
||||||
_t = p1;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
Circle supporting_circle() const {
|
|
||||||
return _c;
|
|
||||||
}
|
|
||||||
|
|
||||||
Point source() const {
|
|
||||||
return _s;
|
|
||||||
}
|
|
||||||
|
|
||||||
Point target() const {
|
|
||||||
return _t;
|
|
||||||
}
|
|
||||||
|
|
||||||
FT squared_radius() const {
|
|
||||||
return _c.squared_radius();
|
|
||||||
}
|
|
||||||
|
|
||||||
Point center() const {
|
|
||||||
return _c.center();
|
|
||||||
}
|
|
||||||
|
|
||||||
Bbox_2 bbox(void) const {
|
|
||||||
return typename R::Construct_bbox_2()(*this);
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
template< class Kernel >
|
template< class Kernel >
|
||||||
class Hyperbolic_Delaunay_triangulation_traits_2 {
|
class Hyperbolic_Delaunay_triangulation_traits_2 {
|
||||||
|
|
||||||
typedef Hyperbolic_Delaunay_triangulation_traits_2<Kernel> Self;
|
typedef Hyperbolic_Delaunay_triangulation_traits_2<Kernel> Self;
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
|
||||||
|
class Circular_arc_2 {
|
||||||
|
typedef typename Kernel::FT FT;
|
||||||
|
typedef Exact_complex<FT> Cplx;
|
||||||
|
typedef typename Kernel::Point_2 Point;
|
||||||
|
typedef typename Kernel::Circle_2 Circle;
|
||||||
|
typedef typename Kernel::Orientation_2 Orientation_2;
|
||||||
|
|
||||||
|
private:
|
||||||
|
Circle _c;
|
||||||
|
Point _s, _t;
|
||||||
|
|
||||||
|
public:
|
||||||
|
Circular_arc_2() :
|
||||||
|
_c(Point(FT(0),FT(0)), FT(0)), _s(FT(0),FT(0)), _t(FT(0),FT(0)) {}
|
||||||
|
|
||||||
|
Circular_arc_2(Circle c, Point source, Point target) :
|
||||||
|
_c(c), _s(source), _t(target) {}
|
||||||
|
|
||||||
|
Circular_arc_2(Point p1, Point p2) {
|
||||||
|
Cplx p(p1), q(p2);
|
||||||
|
Cplx O(0,0);
|
||||||
|
Cplx inv;
|
||||||
|
if (p == O) {
|
||||||
|
inv = q.invert_in_unit_circle();
|
||||||
|
} else {
|
||||||
|
inv = p.invert_in_unit_circle();
|
||||||
|
}
|
||||||
|
|
||||||
|
Point ip(inv.real(), inv.imag());
|
||||||
|
|
||||||
|
_c = Circle(p1, p2, ip);
|
||||||
|
if (Orientation_2()(p1, p2, _c.center()) == LEFT_TURN) {
|
||||||
|
_s = p1;
|
||||||
|
_t = p2;
|
||||||
|
} else {
|
||||||
|
_s = p2;
|
||||||
|
_t = p1;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
Circle supporting_circle() const {
|
||||||
|
return _c;
|
||||||
|
}
|
||||||
|
|
||||||
|
Point source() const {
|
||||||
|
return _s;
|
||||||
|
}
|
||||||
|
|
||||||
|
Point target() const {
|
||||||
|
return _t;
|
||||||
|
}
|
||||||
|
|
||||||
|
FT squared_radius() const {
|
||||||
|
return _c.squared_radius();
|
||||||
|
}
|
||||||
|
|
||||||
|
Point center() const {
|
||||||
|
return _c.center();
|
||||||
|
}
|
||||||
|
|
||||||
|
Bbox_2 bbox(void) const {
|
||||||
|
return typename Kernel::Construct_bbox_2()(*this);
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
typedef typename Kernel::FT FT;
|
typedef typename Kernel::FT FT;
|
||||||
|
|
@ -124,10 +125,11 @@ public:
|
||||||
typedef typename Kernel::Kernel_base Kernel_base;
|
typedef typename Kernel::Kernel_base Kernel_base;
|
||||||
typedef typename Kernel::Point_2 Point_2;
|
typedef typename Kernel::Point_2 Point_2;
|
||||||
typedef Point_2 Point;
|
typedef Point_2 Point;
|
||||||
|
typedef Point_2 Voronoi_point;
|
||||||
typedef typename Kernel::Circle_2 Circle_2;
|
typedef typename Kernel::Circle_2 Circle_2;
|
||||||
typedef typename Kernel::Line_2 Euclidean_line_2;
|
typedef typename Kernel::Line_2 Euclidean_line_2;
|
||||||
typedef boost::variant<Circle_2,Euclidean_line_2> Euclidean_circle_or_line_2;
|
typedef boost::variant<Circle_2,Euclidean_line_2> Euclidean_circle_or_line_2;
|
||||||
typedef Circular_arc_2<Kernel> Circular_arc_2;
|
typedef Self::Circular_arc_2 Circular_arc_2;
|
||||||
typedef typename Kernel::Segment_2 Euclidean_segment_2; //only used internally here
|
typedef typename Kernel::Segment_2 Euclidean_segment_2; //only used internally here
|
||||||
typedef boost::variant<Circular_arc_2, Euclidean_segment_2> Hyperbolic_segment_2;
|
typedef boost::variant<Circular_arc_2, Euclidean_segment_2> Hyperbolic_segment_2;
|
||||||
|
|
||||||
|
|
@ -846,7 +848,7 @@ public:
|
||||||
class Construct_hyperbolic_circumcenter_2_base {
|
class Construct_hyperbolic_circumcenter_2_base {
|
||||||
public:
|
public:
|
||||||
|
|
||||||
typedef Point_2 result_type;
|
typedef Voronoi_point result_type;
|
||||||
|
|
||||||
Construct_hyperbolic_circumcenter_2_base() {}
|
Construct_hyperbolic_circumcenter_2_base() {}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue