From db6c69da3124d2a41fec4b67fbc08f8a04b4ffb9 Mon Sep 17 00:00:00 2001 From: Sylvain Pion Date: Mon, 28 Jan 2002 17:13:56 +0000 Subject: [PATCH] - Fix bug reported by Tamal : Static_filters<>'s functors copy ctors and assignment operators were empty, while they should copy the data members. --- Packages/Interval_arithmetic/changes.txt | 4 ++++ .../Interval_arithmetic/include/CGAL/Static_filters.h | 4 +++- .../CGAL/Static_filters/Coplanar_orientation_3.h | 11 +++++++++-- .../Coplanar_side_of_bounded_circle_3.h | 10 +++++++--- .../include/CGAL/Static_filters/Orientation_2.h | 9 +++++++-- .../include/CGAL/Static_filters/Orientation_3.h | 10 ++++++++-- .../CGAL/Static_filters/Side_of_oriented_circle_2.h | 10 +++++++--- .../CGAL/Static_filters/Side_of_oriented_sphere_3.h | 10 +++++++--- 8 files changed, 52 insertions(+), 16 deletions(-) diff --git a/Packages/Interval_arithmetic/changes.txt b/Packages/Interval_arithmetic/changes.txt index b2831ac5579..a19d7a0b1c2 100644 --- a/Packages/Interval_arithmetic/changes.txt +++ b/Packages/Interval_arithmetic/changes.txt @@ -1,3 +1,7 @@ +Version 4.129 on 28 January 2002 +- Fix bug reported by Tamal : Static_filters<>'s functors copy ctors and + assignment operators were empty, while they should copy the data members. + Version 4.128 on 10 January 2002 - std::abort -> CGAL_CLIB_STD::abort(). diff --git a/Packages/Interval_arithmetic/include/CGAL/Static_filters.h b/Packages/Interval_arithmetic/include/CGAL/Static_filters.h index 3c6b3fb0928..b024bcee612 100644 --- a/Packages/Interval_arithmetic/include/CGAL/Static_filters.h +++ b/Packages/Interval_arithmetic/include/CGAL/Static_filters.h @@ -146,12 +146,14 @@ public : } private: - // Bounds on fabs() of the coordinates of the Point_3s. + // Bounds on fabs() of the coordinates of the Point_2s and Point_3s. mutable double max2x, max2y; mutable double max3x, max3y, max3z; // A data member for each predicate. // Their state is related to the state of *this. + // TODO : maybe they should be separate classes, with a pointer to the + // kernel ? That way we could copy them. mutable Orientation_2 _orientation_2; mutable Orientation_3 _orientation_3; mutable Side_of_oriented_circle_2 _side_of_oriented_circle_2; diff --git a/Packages/Interval_arithmetic/include/CGAL/Static_filters/Coplanar_orientation_3.h b/Packages/Interval_arithmetic/include/CGAL/Static_filters/Coplanar_orientation_3.h index 4d830911a11..428d7b41f48 100644 --- a/Packages/Interval_arithmetic/include/CGAL/Static_filters/Coplanar_orientation_3.h +++ b/Packages/Interval_arithmetic/include/CGAL/Static_filters/Coplanar_orientation_3.h @@ -45,9 +45,16 @@ protected: // These operations are reserved to Static_filters<>, because the context of // a predicate is linked to the one of the Static_filter<> it is a member of. - SF_Coplanar_orientation_3(const SF_Coplanar_orientation_3 &) {} + SF_Coplanar_orientation_3(const SF_Coplanar_orientation_3 &s) + : oxy(s.oxy), oyz(s.oyz), oxz(s.oxz) {} - SF_Coplanar_orientation_3 & operator=(const SF_Coplanar_orientation_3 &) {} + SF_Coplanar_orientation_3 & operator=(const SF_Coplanar_orientation_3 &s) + { + oxy = s.oxy; + oyz = s.oyz; + oxz = s.oxz; + return *this; + } SF_Coplanar_orientation_3() {} diff --git a/Packages/Interval_arithmetic/include/CGAL/Static_filters/Coplanar_side_of_bounded_circle_3.h b/Packages/Interval_arithmetic/include/CGAL/Static_filters/Coplanar_side_of_bounded_circle_3.h index 18d6e7d0c4f..b68fe9f8bbd 100644 --- a/Packages/Interval_arithmetic/include/CGAL/Static_filters/Coplanar_side_of_bounded_circle_3.h +++ b/Packages/Interval_arithmetic/include/CGAL/Static_filters/Coplanar_side_of_bounded_circle_3.h @@ -64,10 +64,14 @@ protected: // These operations are reserved to Static_filters<>, because the context of // a predicate is linked to the one of the Static_filter<> it is a member of. - SF_Side_of_bounded_circle_3(const SF_Side_of_bounded_circle_3 &) {} + SF_Side_of_bounded_circle_3(const SF_Side_of_bounded_circle_3 &s) + : _static_epsilon(s._static_epsilon) {} - SF_Side_of_bounded_circle_3& operator=(const SF_Side_of_bounded_circle_3 &) - {} + SF_Side_of_bounded_circle_3& operator=(const SF_Side_of_bounded_circle_3 &s) + { + _static_epsilon = s._static_epsilon; + return *this; + } SF_Side_of_bounded_circle_3() { diff --git a/Packages/Interval_arithmetic/include/CGAL/Static_filters/Orientation_2.h b/Packages/Interval_arithmetic/include/CGAL/Static_filters/Orientation_2.h index cb86c63c4e6..5a6fd869777 100644 --- a/Packages/Interval_arithmetic/include/CGAL/Static_filters/Orientation_2.h +++ b/Packages/Interval_arithmetic/include/CGAL/Static_filters/Orientation_2.h @@ -63,9 +63,14 @@ protected: // These operations are reserved to Static_filters<>, because the context of // a predicate is linked to the one of the Static_filter<> it is a member of. - SF_Orientation_2(const SF_Orientation_2 &) {} + SF_Orientation_2(const SF_Orientation_2 &s) + : _static_epsilon(s._static_epsilon) {} - SF_Orientation_2 & operator=(const SF_Orientation_2 &) {} + SF_Orientation_2 & operator=(const SF_Orientation_2 &s) + { + _static_epsilon = s._static_epsilon; + return *this; + } SF_Orientation_2() { diff --git a/Packages/Interval_arithmetic/include/CGAL/Static_filters/Orientation_3.h b/Packages/Interval_arithmetic/include/CGAL/Static_filters/Orientation_3.h index 6492534e42e..9281a196261 100644 --- a/Packages/Interval_arithmetic/include/CGAL/Static_filters/Orientation_3.h +++ b/Packages/Interval_arithmetic/include/CGAL/Static_filters/Orientation_3.h @@ -58,9 +58,14 @@ protected: // These operations are reserved to Static_filters<>, because the context of // a predicate is linked to the one of the Static_filter<> it is a member of. - SF_Orientation_3(const SF_Orientation_3 &) {} + SF_Orientation_3(const SF_Orientation_3 &s) + : _static_epsilon(s._static_epsilon) {} - SF_Orientation_3 & operator=(const SF_Orientation_3 &) {} + SF_Orientation_3 & operator=(const SF_Orientation_3 &s) + { + _static_epsilon = s._static_epsilon; + return *this; + } SF_Orientation_3() { @@ -108,6 +113,7 @@ private: double det = det3x3_by_formula(pqx, pqy, pqz, prx, pry, prz, psx, psy, psz); + #if 1 // Fully static filter first. if (det > _static_epsilon) return POSITIVE; diff --git a/Packages/Interval_arithmetic/include/CGAL/Static_filters/Side_of_oriented_circle_2.h b/Packages/Interval_arithmetic/include/CGAL/Static_filters/Side_of_oriented_circle_2.h index 7a88c86a7dc..51f7b0491ab 100644 --- a/Packages/Interval_arithmetic/include/CGAL/Static_filters/Side_of_oriented_circle_2.h +++ b/Packages/Interval_arithmetic/include/CGAL/Static_filters/Side_of_oriented_circle_2.h @@ -53,10 +53,14 @@ protected: // These operations are reserved to Static_filters<>, because the context of // a predicate is linked to the one of the Static_filter<> it is a member of. - SF_Side_of_oriented_circle_2(const SF_Side_of_oriented_circle_2 &) {} + SF_Side_of_oriented_circle_2(const SF_Side_of_oriented_circle_2 &s) + : _static_epsilon(s._static_epsilon) {} - SF_Side_of_oriented_circle_2& operator=(const SF_Side_of_oriented_circle_2 &) - {} + SF_Side_of_oriented_circle_2& operator=(const SF_Side_of_oriented_circle_2&s) + { + _static_epsilon = s._static_epsilon; + return *this; + } SF_Side_of_oriented_circle_2() { diff --git a/Packages/Interval_arithmetic/include/CGAL/Static_filters/Side_of_oriented_sphere_3.h b/Packages/Interval_arithmetic/include/CGAL/Static_filters/Side_of_oriented_sphere_3.h index e707419c884..b9805b4cc16 100644 --- a/Packages/Interval_arithmetic/include/CGAL/Static_filters/Side_of_oriented_sphere_3.h +++ b/Packages/Interval_arithmetic/include/CGAL/Static_filters/Side_of_oriented_sphere_3.h @@ -60,10 +60,14 @@ protected: // These operations are reserved to Static_filters<>, because the context of // a predicate is linked to the one of the Static_filter<> it is a member of. - SF_Side_of_oriented_sphere_3(const SF_Side_of_oriented_sphere_3 &) {} + SF_Side_of_oriented_sphere_3(const SF_Side_of_oriented_sphere_3 &s) + : _static_epsilon(s._static_epsilon) {} - SF_Side_of_oriented_sphere_3& operator=(const SF_Side_of_oriented_sphere_3 &) - {} + SF_Side_of_oriented_sphere_3& operator=(const SF_Side_of_oriented_sphere_3&s) + { + _static_epsilon = s._static_epsilon; + return *this; + } SF_Side_of_oriented_sphere_3() {