rename enum

This commit is contained in:
Sébastien Loriot 2021-09-23 15:11:18 +02:00
parent fb37f69c93
commit 9b19c5faff
2 changed files with 12 additions and 12 deletions

View File

@ -36,10 +36,10 @@ namespace internal {
template <class K> template <class K>
class Line_2_Line_2_pair { class Line_2_Line_2_pair {
public: 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, Line_2_Line_2_pair(typename K::Line_2 const *line1,
typename K::Line_2 const *line2) typename K::Line_2 const *line2)
: _line1(line1), _line2(line2), _result(NOT_COMPUTED_YET) {} : _line1(line1), _line2(line2) {}
Intersection_results intersection_type() const; Intersection_results intersection_type() const;
@ -48,7 +48,7 @@ public:
protected: protected:
typename K::Line_2 const* _line1; typename K::Line_2 const* _line1;
typename K::Line_2 const * _line2; typename K::Line_2 const * _line2;
mutable Intersection_results _result; mutable Intersection_results _result = UNKNOWN;
mutable typename K::Point_2 _intersection_point; mutable typename K::Point_2 _intersection_point;
}; };
@ -140,7 +140,7 @@ typename Line_2_Line_2_pair<K>::Intersection_results
Line_2_Line_2_pair<K>::intersection_type() const Line_2_Line_2_pair<K>::intersection_type() const
{ {
typedef typename K::RT RT; typedef typename K::RT RT;
if (_result != NOT_COMPUTED_YET) if (_result != UNKNOWN)
return _result; return _result;
RT nom1, nom2, denom; RT nom1, nom2, denom;
// The non const this pointer is used to cast away const. // The non const this pointer is used to cast away const.
@ -178,7 +178,7 @@ template <class K>
typename K::Point_2 typename K::Point_2
Line_2_Line_2_pair<K>::intersection_point() const Line_2_Line_2_pair<K>::intersection_point() const
{ {
if (_result == NOT_COMPUTED_YET) if (_result == UNKNOWN)
intersection_type(); intersection_type();
CGAL_kernel_assertion(_result == POINT); CGAL_kernel_assertion(_result == POINT);
return _intersection_point; return _intersection_point;
@ -188,7 +188,7 @@ template <class K>
typename K::Line_2 typename K::Line_2
Line_2_Line_2_pair<K>::intersection_line() const Line_2_Line_2_pair<K>::intersection_line() const
{ {
if (_result == NOT_COMPUTED_YET) if (_result == UNKNOWN)
intersection_type(); intersection_type();
CGAL_kernel_assertion(_result == LINE); CGAL_kernel_assertion(_result == LINE);
return *_line1; return *_line1;

View File

@ -35,11 +35,11 @@ namespace internal {
template <class K> template <class K>
class Ray_2_Line_2_pair { class Ray_2_Line_2_pair {
public: public:
enum Intersection_results {NOT_COMPUTED_YET, NO_INTERSECTION, POINT, RAY}; enum Intersection_results {NO_INTERSECTION, POINT, RAY, UNKNOWN};
typedef typename K::FT FT; typedef typename K::FT FT;
Ray_2_Line_2_pair(typename K::Ray_2 const *ray, Ray_2_Line_2_pair(typename K::Ray_2 const *ray,
typename K::Line_2 const *line) 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)) _intersection_point(K().construct_point_2_object()(ORIGIN))
{} {}
@ -50,7 +50,7 @@ public:
protected: protected:
typename K::Ray_2 const * _ray; typename K::Ray_2 const * _ray;
typename K::Line_2 const * _line; typename K::Line_2 const * _line;
mutable Intersection_results _result; mutable Intersection_results _result = UNKNOWN;
mutable typename K::Point_2 _intersection_point; mutable typename K::Point_2 _intersection_point;
}; };
@ -117,7 +117,7 @@ template <class K>
typename Ray_2_Line_2_pair<K>::Intersection_results typename Ray_2_Line_2_pair<K>::Intersection_results
Ray_2_Line_2_pair<K>::intersection_type() const Ray_2_Line_2_pair<K>::intersection_type() const
{ {
if (_result != NOT_COMPUTED_YET) if (_result != UNKNOWN)
return _result; return _result;
// The non const this pointer is used to cast away const. // The non const this pointer is used to cast away const.
const typename K::Line_2 &l1 = _ray->supporting_line(); const typename K::Line_2 &l1 = _ray->supporting_line();
@ -144,7 +144,7 @@ template <class K>
typename K::Point_2 typename K::Point_2
Ray_2_Line_2_pair<K>::intersection_point() const Ray_2_Line_2_pair<K>::intersection_point() const
{ {
if (_result == NOT_COMPUTED_YET) if (_result == UNKNOWN)
intersection_type(); intersection_type();
CGAL_kernel_assertion(_result == POINT); CGAL_kernel_assertion(_result == POINT);
return _intersection_point; return _intersection_point;
@ -154,7 +154,7 @@ template <class K>
typename K::Ray_2 typename K::Ray_2
Ray_2_Line_2_pair<K>::intersection_ray() const Ray_2_Line_2_pair<K>::intersection_ray() const
{ {
if (_result == NOT_COMPUTED_YET) if (_result == UNKNOWN)
intersection_type(); intersection_type();
CGAL_kernel_assertion(_result == RAY); CGAL_kernel_assertion(_result == RAY);
return *_ray; return *_ray;