diff --git a/Intersections_2/include/CGAL/Intersections_2/Line_2_Line_2.h b/Intersections_2/include/CGAL/Intersections_2/Line_2_Line_2.h index d95ddec8f2a..8d2d3e6ae0d 100644 --- a/Intersections_2/include/CGAL/Intersections_2/Line_2_Line_2.h +++ b/Intersections_2/include/CGAL/Intersections_2/Line_2_Line_2.h @@ -36,10 +36,10 @@ namespace internal { template class Line_2_Line_2_pair { public: - enum Intersection_results {NOT_COMPUTED_YET, NO_INTERSECTION, POINT, LINE}; + enum Intersection_results {NO_INTERSECTION, POINT, LINE, UNKNOWN}; Line_2_Line_2_pair(typename K::Line_2 const *line1, typename K::Line_2 const *line2) - : _line1(line1), _line2(line2), _result(NOT_COMPUTED_YET) {} + : _line1(line1), _line2(line2) {} Intersection_results intersection_type() const; @@ -48,7 +48,7 @@ public: protected: typename K::Line_2 const* _line1; typename K::Line_2 const * _line2; - mutable Intersection_results _result; + mutable Intersection_results _result = UNKNOWN; mutable typename K::Point_2 _intersection_point; }; @@ -140,7 +140,7 @@ typename Line_2_Line_2_pair::Intersection_results Line_2_Line_2_pair::intersection_type() const { typedef typename K::RT RT; - if (_result != NOT_COMPUTED_YET) + if (_result != UNKNOWN) return _result; RT nom1, nom2, denom; // The non const this pointer is used to cast away const. @@ -178,7 +178,7 @@ template typename K::Point_2 Line_2_Line_2_pair::intersection_point() const { - if (_result == NOT_COMPUTED_YET) + if (_result == UNKNOWN) intersection_type(); CGAL_kernel_assertion(_result == POINT); return _intersection_point; @@ -188,7 +188,7 @@ template typename K::Line_2 Line_2_Line_2_pair::intersection_line() const { - if (_result == NOT_COMPUTED_YET) + if (_result == UNKNOWN) intersection_type(); CGAL_kernel_assertion(_result == LINE); return *_line1; diff --git a/Intersections_2/include/CGAL/Intersections_2/Line_2_Ray_2.h b/Intersections_2/include/CGAL/Intersections_2/Line_2_Ray_2.h index eada9a07ec2..87f59d8a45a 100644 --- a/Intersections_2/include/CGAL/Intersections_2/Line_2_Ray_2.h +++ b/Intersections_2/include/CGAL/Intersections_2/Line_2_Ray_2.h @@ -35,11 +35,11 @@ namespace internal { template class Ray_2_Line_2_pair { public: - enum Intersection_results {NOT_COMPUTED_YET, NO_INTERSECTION, POINT, RAY}; + enum Intersection_results {NO_INTERSECTION, POINT, RAY, UNKNOWN}; typedef typename K::FT FT; Ray_2_Line_2_pair(typename K::Ray_2 const *ray, typename K::Line_2 const *line) - : _ray(ray), _line(line), _result(NOT_COMPUTED_YET), + : _ray(ray), _line(line), _intersection_point(K().construct_point_2_object()(ORIGIN)) {} @@ -50,7 +50,7 @@ public: protected: typename K::Ray_2 const * _ray; typename K::Line_2 const * _line; - mutable Intersection_results _result; + mutable Intersection_results _result = UNKNOWN; mutable typename K::Point_2 _intersection_point; }; @@ -117,7 +117,7 @@ template typename Ray_2_Line_2_pair::Intersection_results Ray_2_Line_2_pair::intersection_type() const { - if (_result != NOT_COMPUTED_YET) + if (_result != UNKNOWN) return _result; // The non const this pointer is used to cast away const. const typename K::Line_2 &l1 = _ray->supporting_line(); @@ -144,7 +144,7 @@ template typename K::Point_2 Ray_2_Line_2_pair::intersection_point() const { - if (_result == NOT_COMPUTED_YET) + if (_result == UNKNOWN) intersection_type(); CGAL_kernel_assertion(_result == POINT); return _intersection_point; @@ -154,7 +154,7 @@ template typename K::Ray_2 Ray_2_Line_2_pair::intersection_ray() const { - if (_result == NOT_COMPUTED_YET) + if (_result == UNKNOWN) intersection_type(); CGAL_kernel_assertion(_result == RAY); return *_ray;