diff --git a/.gitattributes b/.gitattributes index d05ba2c01d5..2152ca932f2 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1275,6 +1275,7 @@ Circular_kernel_2/demo/Circular_kernel_2/help/sweeper.jpeg -text svneol=unset#im Circular_kernel_2/demo/Circular_kernel_2/help/trash.jpeg -text svneol=unset#image/jpeg Circular_kernel_2/doc_tex/Circular_kernel_2/fig/Boolean_operation.png -text Circular_kernel_2/doc_tex/Circular_kernel_2/fig/Boolean_operation_detail.png -text +Circular_kernel_2/examples/Circular_kernel_2/functor_has_on.cpp -text Circular_kernel_2/include/CGAL/Circular_kernel_intersections.h -text Circular_kernel_3/demo/Circular_kernel_3/images/button_axis.gif -text svneol=unset#image/gif Circular_kernel_3/demo/Circular_kernel_3/images/button_light.gif -text svneol=unset#image/gif diff --git a/Circular_kernel_2/examples/Circular_kernel_2/functor_has_on.cpp b/Circular_kernel_2/examples/Circular_kernel_2/functor_has_on.cpp new file mode 100644 index 00000000000..0886269d882 --- /dev/null +++ b/Circular_kernel_2/examples/Circular_kernel_2/functor_has_on.cpp @@ -0,0 +1,24 @@ +#include +#include + +typedef CGAL::Exact_circular_kernel_2 Circular_k; + +typedef CGAL::Point_2 Point_2; +typedef CGAL::Circular_arc_2 Circular_arc_2; + +int main() +{ + int n = 0; + Circular_arc_2 c = Circular_arc_2(Point_2(10,0), Point_2(5,5), Point_2(0, 0)); + for(int i = 1; i <= 5; i++) { + for(int j = 1; j <= 10; j++) { + Point_2 p = Point_2(i, j); + if(Circular_k().has_on_2_object()(c,p)) n++; + } + } + std::cout << "There are " << n << " points in the 10x5 grid on the circular" + << std::endl + << " arc with endpoints (0,0), (10,0) defined on the superior half plane" + << std::endl; + return 0; +}; diff --git a/Circular_kernel_2/examples/Circular_kernel_2/intersecting_arcs.cpp b/Circular_kernel_2/examples/Circular_kernel_2/intersecting_arcs.cpp index 2c68c41e11c..db9448e123d 100644 --- a/Circular_kernel_2/examples/Circular_kernel_2/intersecting_arcs.cpp +++ b/Circular_kernel_2/examples/Circular_kernel_2/intersecting_arcs.cpp @@ -6,7 +6,6 @@ typedef CGAL::Exact_circular_kernel_2 Circular_k; typedef CGAL::Point_2 Point_2; typedef CGAL::Circle_2 Circle_2; typedef CGAL::Circular_arc_2 Circular_arc_2; -typedef CGAL::Line_arc_2 Line_arc_2; template double prob_2() { diff --git a/Circular_kernel_2/include/CGAL/Circular_arc_point_2.h b/Circular_kernel_2/include/CGAL/Circular_arc_point_2.h index 0d9cbf0c16e..5397b93d320 100644 --- a/Circular_kernel_2/include/CGAL/Circular_arc_point_2.h +++ b/Circular_kernel_2/include/CGAL/Circular_arc_point_2.h @@ -140,9 +140,10 @@ struct Filtered_bbox_circular_kernel_2; template < typename CK > class Circular_arc_point_2 < Filtered_bbox_circular_kernel_2 < CK > > { + typedef Filtered_bbox_circular_kernel_2 < CK > BK; typedef typename CK::FT FT; typedef typename CK::RT RT; - typedef typename CK::Point_2 Point_2; + typedef typename BK::Point_2 Point_2; typedef typename CK::Line_2 Line_2; typedef typename CK::Circle_2 Circle_2; typedef typename CK::Circular_arc_point_2 Rcircular_arc_point_2; @@ -160,9 +161,13 @@ public: {} Circular_arc_point_2(const Root_for_circles_2_2 & np) - : P_point(np),bb(NULL) + : P_point(np), bb(NULL) {} + Circular_arc_point_2(const Point_2 & p) + : P_point(p), bb(NULL) + {} + Circular_arc_point_2(const Rcircular_arc_point_2 & p) : P_point(p),bb(NULL) {}