From e7ef521134a57ecd88f8d9b5b41e1b5330bb9811 Mon Sep 17 00:00:00 2001 From: Susan Hert Date: Wed, 7 Feb 2001 17:53:29 +0000 Subject: [PATCH] *** empty log message *** --- Packages/Cartesian_kernel/changes.txt | 2 +- .../include/CGAL/Cartesian/Segment_3.h | 2 +- .../include/CGAL/Cartesian/Tetrahedron_3.h | 6 +-- .../include/CGAL/Cartesian/Triangle_2.h | 2 +- .../include/CGAL/Cartesian/Triangle_3.h | 6 +-- .../include/CGAL/Kernel_traits_common.h | 42 +++++++++++-------- 6 files changed, 33 insertions(+), 27 deletions(-) diff --git a/Packages/Cartesian_kernel/changes.txt b/Packages/Cartesian_kernel/changes.txt index 7a2a419b5cd..edcc18aed62 100644 --- a/Packages/Cartesian_kernel/changes.txt +++ b/Packages/Cartesian_kernel/changes.txt @@ -2,7 +2,7 @@ Version 6.5 (?? ?????? 2001) - Kernel_traits_common.h shorted with the use of a macro - Several missing function object classes added - New class Cartesian_converter. -- .area() and .volume(). +- .area() .squared_area() and .volume(). Version 6.4 (25 January 2001) - Use the new file iterator_traits_pointer_specs_for_simple_cartesian_kernel.h diff --git a/Packages/Cartesian_kernel/include/CGAL/Cartesian/Segment_3.h b/Packages/Cartesian_kernel/include/CGAL/Cartesian/Segment_3.h index 1128cd9ddef..cb851bb124c 100644 --- a/Packages/Cartesian_kernel/include/CGAL/Cartesian/Segment_3.h +++ b/Packages/Cartesian_kernel/include/CGAL/Cartesian/Segment_3.h @@ -28,7 +28,7 @@ CGAL_BEGIN_NAMESPACE template < class R_ > class SegmentC3 CGAL_ADVANCED_KERNEL_PARTIAL_SPEC - : R_::Segment_handle_3 + : public R_::Segment_handle_3 { public: typedef R_ R; diff --git a/Packages/Cartesian_kernel/include/CGAL/Cartesian/Tetrahedron_3.h b/Packages/Cartesian_kernel/include/CGAL/Cartesian/Tetrahedron_3.h index 653df6c1842..6517c560fd2 100644 --- a/Packages/Cartesian_kernel/include/CGAL/Cartesian/Tetrahedron_3.h +++ b/Packages/Cartesian_kernel/include/CGAL/Cartesian/Tetrahedron_3.h @@ -171,9 +171,9 @@ TetrahedronC3::volume() const typename R::Vector_3 v1 = vertex(1)-vertex(0); typename R::Vector_3 v2 = vertex(2)-vertex(0); typename R::Vector_3 v3 = vertex(3)-vertex(0); - return CGAL_NTS abs(det3x3_by_formula(v1.x(), v1.y(), v1.z(), - v2.x(), v2.y(), v2.z(), - v3.x(), v3.y(), v3.z())/FT(6)); + return det3x3_by_formula(v1.x(), v1.y(), v1.z(), + v2.x(), v2.y(), v2.z(), + v3.x(), v3.y(), v3.z())/FT(6); } template < class R > diff --git a/Packages/Cartesian_kernel/include/CGAL/Cartesian/Triangle_2.h b/Packages/Cartesian_kernel/include/CGAL/Cartesian/Triangle_2.h index 2221cdd679b..96182622bd5 100644 --- a/Packages/Cartesian_kernel/include/CGAL/Cartesian/Triangle_2.h +++ b/Packages/Cartesian_kernel/include/CGAL/Cartesian/Triangle_2.h @@ -157,7 +157,7 @@ TriangleC2::area() const { typename R::Vector_2 v1 = vertex(1)-vertex(0); typename R::Vector_2 v2 = vertex(2)-vertex(0); - return CGAL_NTS abs(det2x2_by_formula(v1.x(), v1.y(), v2.x(), v2.y())/FT(2)); + return det2x2_by_formula(v1.x(), v1.y(), v2.x(), v2.y())/FT(2); } template < class R > diff --git a/Packages/Cartesian_kernel/include/CGAL/Cartesian/Triangle_3.h b/Packages/Cartesian_kernel/include/CGAL/Cartesian/Triangle_3.h index 2dd9e2a1155..fd0c160e021 100644 --- a/Packages/Cartesian_kernel/include/CGAL/Cartesian/Triangle_3.h +++ b/Packages/Cartesian_kernel/include/CGAL/Cartesian/Triangle_3.h @@ -78,7 +78,7 @@ public: Bbox_3 bbox() const; - FT area() const; + FT squared_area() const; }; #ifdef CGAL_CFG_TYPENAME_BUG @@ -130,12 +130,12 @@ TriangleC3::operator[](int i) const template < class R > CGAL_KERNEL_MEDIUM_INLINE typename TriangleC3::FT -TriangleC3::area() const +TriangleC3::squared_area() const { typename R::Vector_3 v1 = vertex(1)-vertex(0); typename R::Vector_3 v2 = vertex(2)-vertex(0); typename R::Vector_3 v3 = cross_product(v1, v2); - return CGAL_NTS sqrt(v3.squared_length())/FT(2); + return (v3.squared_length())/FT(4); } template < class R > diff --git a/Packages/Cartesian_kernel/include/CGAL/Kernel_traits_common.h b/Packages/Cartesian_kernel/include/CGAL/Kernel_traits_common.h index 5d8b1a2be69..6b1f7501ecf 100644 --- a/Packages/Cartesian_kernel/include/CGAL/Kernel_traits_common.h +++ b/Packages/Cartesian_kernel/include/CGAL/Kernel_traits_common.h @@ -116,6 +116,7 @@ CGAL_Kernel_obj(Intersect_2, intersect_2_object) typedef CGALi::Call_y_at_x_to_get Compute_y_at_x_2; typedef CGALi::Call_squared_length_to_get Compute_squared_length_2; +typedef CGALi::Call_area_to_get Compute_area_2; typedef CGALi::Equal Equal_2; typedef CGALi::Equal_x Equal_x_2; typedef CGALi::Equal_y Equal_y_2; @@ -130,7 +131,8 @@ typedef CGALi::Compare_xy Compare_xy_2; typedef CGALi::Compare_y_at_x Compare_y_at_x_2; CGAL_Kernel_obj(Compute_y_at_x_2, compute_y_at_x_2_object) -CGAL_Kernel_obj(Compute_squared_length_2, Compute_squared_length_2_object) +CGAL_Kernel_obj(Compute_squared_length_2, compute_squared_length_2_object) +CGAL_Kernel_obj(Compute_area_2, compute_area_2_object) CGAL_Kernel_obj(Equal_2, equal_2_object) CGAL_Kernel_obj(Equal_x_2, equal_x_2_object) CGAL_Kernel_obj(Equal_y_2, equal_y_2_object) @@ -307,25 +309,29 @@ CGAL_Kernel_obj(Assign_3, assign_3_object) CGAL_Kernel_obj(Intersect_3, intersect_3_object) -typedef CGALi::Call_squared_length_to_get Compute_squared_length_3; -typedef CGALi::Equal Equal_3; -typedef CGALi::Equal_x Equal_x_3; -typedef CGALi::Equal_y Equal_y_3; -typedef CGALi::Equal_z Equal_z_3; -typedef CGALi::Equal_xy Equal_xy_3; -typedef CGALi::Equal_xyz Equal_xyz_3; -typedef CGALi::Less_x Less_x_3; -typedef CGALi::Less_y Less_y_3; -typedef CGALi::Less_z Less_z_3; -typedef CGAL::p_Less_xy Less_xy_3; -typedef CGALi::Less_xyz Less_xyz_3; -typedef CGALi::Compare_x Compare_x_3; -typedef CGALi::Compare_y Compare_y_3; -typedef CGALi::Compare_z Compare_z_3; -typedef CGALi::Compare_xy Compare_xy_3; -typedef CGALi::Compare_xyz Compare_xyz_3; +typedef CGALi::Call_squared_length_to_get Compute_squared_length_3; +typedef CGALi::Call_squared_area_to_get Compute_squared_area_3; +typedef CGALi::Call_volume_to_get Compute_volume_3; +typedef CGALi::Equal Equal_3; +typedef CGALi::Equal_x Equal_x_3; +typedef CGALi::Equal_y Equal_y_3; +typedef CGALi::Equal_z Equal_z_3; +typedef CGALi::Equal_xy Equal_xy_3; +typedef CGALi::Equal_xyz Equal_xyz_3; +typedef CGALi::Less_x Less_x_3; +typedef CGALi::Less_y Less_y_3; +typedef CGALi::Less_z Less_z_3; +typedef CGAL::p_Less_xy Less_xy_3; +typedef CGALi::Less_xyz Less_xyz_3; +typedef CGALi::Compare_x Compare_x_3; +typedef CGALi::Compare_y Compare_y_3; +typedef CGALi::Compare_z Compare_z_3; +typedef CGALi::Compare_xy Compare_xy_3; +typedef CGALi::Compare_xyz Compare_xyz_3; CGAL_Kernel_obj(Compute_squared_length_3, compute_squared_length_3_object) +CGAL_Kernel_obj(Compute_squared_area_3, compute_squared_area_3_object) +CGAL_Kernel_obj(Compute_volume_3, compute_volume_3_object) CGAL_Kernel_obj(Equal_3, equal_3_object) CGAL_Kernel_obj(Equal_x_3, equal_x_3_object) CGAL_Kernel_obj(Equal_y_3, equal_y_3_object)