mirror of https://github.com/CGAL/cgal
refactored some classes
* simplified Point_with_history * added second parameter (Traits) to Search_traits * made classes internal
This commit is contained in:
parent
1feea5aff6
commit
e8ca703f02
|
|
@ -36,6 +36,8 @@
|
||||||
|
|
||||||
namespace CGAL {
|
namespace CGAL {
|
||||||
|
|
||||||
|
namespace internal {
|
||||||
|
|
||||||
//////////////////////
|
//////////////////////
|
||||||
//////////////////////
|
//////////////////////
|
||||||
//Point_with_hot_pixel_history
|
//Point_with_hot_pixel_history
|
||||||
|
|
@ -43,33 +45,27 @@ namespace CGAL {
|
||||||
|
|
||||||
template<class Traits, class SAVED_OBJECT>
|
template<class Traits, class SAVED_OBJECT>
|
||||||
class Point_with_hot_pixel_history : public Traits::Point_2 {
|
class Point_with_hot_pixel_history : public Traits::Point_2 {
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
typedef typename Traits::Point_2 Base;
|
||||||
typedef typename Traits::Point_2 Point_2;
|
typedef typename Traits::Point_2 Point_2;
|
||||||
typedef typename Traits::FT NT;
|
typedef typename Traits::FT NT;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
typedef typename Traits::Point_2 Point_d;
|
|
||||||
typedef typename Traits::FT FT;
|
|
||||||
|
|
||||||
typedef typename Traits::Iso_rectangle_2 Iso_rectangle_2;
|
|
||||||
typedef typename Traits::Cartesian_const_iterator_2 Cartesian_const_iterator_2;
|
|
||||||
typedef typename Traits::Construct_cartesian_const_iterator_2 Construct_cartesian_const_iterator_2;
|
|
||||||
|
|
||||||
typedef typename Traits::Construct_min_vertex_2 Construct_min_vertex_2;
|
|
||||||
typedef typename Traits::Construct_max_vertex_2 Construct_max_vertex_2;
|
|
||||||
typedef typename Traits::Construct_iso_rectangle_2 Construct_iso_rectangle_2;
|
|
||||||
|
|
||||||
Point_2 orig;
|
Point_2 orig;
|
||||||
SAVED_OBJECT object;
|
SAVED_OBJECT object;
|
||||||
|
|
||||||
Point_with_hot_pixel_history(const Point_2& p, const Point_2& inp_orig, SAVED_OBJECT obj) : Point_2(p), orig(inp_orig), object(obj) {}
|
Point_with_hot_pixel_history(const Base& p, const Point_2& inp_orig, SAVED_OBJECT obj) : Base(p), orig(inp_orig), object(obj) {}
|
||||||
|
|
||||||
Point_with_hot_pixel_history(const Point_2& p) : Point_2(p), orig(Point_2(0, 0)) {}
|
Point_with_hot_pixel_history(const Base& p) : Base(p), orig(Point_2(0, 0)) {}
|
||||||
|
|
||||||
Point_with_hot_pixel_history() : Point_2(),orig() {}
|
Point_with_hot_pixel_history() : Base(), orig() {}
|
||||||
|
|
||||||
Point_with_hot_pixel_history(NT x, NT y) : Point_2(x, y), orig(Point_2(0, 0)) {}
|
Point_with_hot_pixel_history(NT x, NT y) : Base(x, y), orig(Point_2(0, 0)) {}
|
||||||
};
|
|
||||||
|
}; // Point_with_hot_pixel_history
|
||||||
|
|
||||||
|
|
||||||
//////////////////////
|
//////////////////////
|
||||||
|
|
@ -79,11 +75,13 @@ public:
|
||||||
//(Search traits modified to be used by the Spacial Searching kd_trees for Snap rounding)
|
//(Search traits modified to be used by the Spacial Searching kd_trees for Snap rounding)
|
||||||
//////////////////////
|
//////////////////////
|
||||||
|
|
||||||
template <class Traits >
|
template < class Traits_, class Point_ = typename Traits_::Point_2 >
|
||||||
class Search_traits_kd_tree_2 {
|
class Search_traits_kd_tree_2 {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
typedef Traits Point_d;
|
typedef Traits_ Traits;
|
||||||
|
typedef Point_ Point_d;
|
||||||
|
|
||||||
typedef typename Traits::Iso_rectangle_2 Iso_box_d;
|
typedef typename Traits::Iso_rectangle_2 Iso_box_d;
|
||||||
typedef typename Traits::Cartesian_const_iterator_2 Cartesian_const_iterator_d;
|
typedef typename Traits::Cartesian_const_iterator_2 Cartesian_const_iterator_d;
|
||||||
typedef typename Traits::Construct_cartesian_const_iterator_2 Construct_cartesian_const_iterator_d;
|
typedef typename Traits::Construct_cartesian_const_iterator_2 Construct_cartesian_const_iterator_d;
|
||||||
|
|
@ -99,7 +97,9 @@ public:
|
||||||
return Construct_cartesian_const_iterator_d();
|
return Construct_cartesian_const_iterator_d();
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
}; // Search_traits_kd_tree_2
|
||||||
|
|
||||||
|
} // namespace internal
|
||||||
|
|
||||||
/////////////////////
|
/////////////////////
|
||||||
/////////////////////
|
/////////////////////
|
||||||
|
|
@ -120,8 +120,9 @@ private:
|
||||||
typedef typename Traits::Line_2 Line_2;
|
typedef typename Traits::Line_2 Line_2;
|
||||||
typedef typename Traits::Aff_transformation_2 Transformation_2;
|
typedef typename Traits::Aff_transformation_2 Transformation_2;
|
||||||
|
|
||||||
typedef Point_with_hot_pixel_history<Traits, SAVED_OBJECT> Point_with_hot_pixel_history_saved;
|
typedef CGAL::internal::Point_with_hot_pixel_history<Traits, SAVED_OBJECT> Point_with_hot_pixel_history_saved;
|
||||||
typedef CGAL::Search_traits_kd_tree_2<Point_with_hot_pixel_history_saved> Search_traits;
|
typedef CGAL::internal::Search_traits_kd_tree_2<Traits, Point_with_hot_pixel_history_saved>
|
||||||
|
Search_traits;
|
||||||
typedef CGAL::Kd_tree<Search_traits> Kd_tree;
|
typedef CGAL::Kd_tree<Search_traits> Kd_tree;
|
||||||
typedef CGAL::Fuzzy_iso_box<Search_traits> Box;
|
typedef CGAL::Fuzzy_iso_box<Search_traits> Box;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue