diff --git a/Packages/Cartesian_kernel/changes.txt b/Packages/Cartesian_kernel/changes.txt index 35eff841ade..93b51240bc1 100644 --- a/Packages/Cartesian_kernel/changes.txt +++ b/Packages/Cartesian_kernel/changes.txt @@ -1,3 +1,6 @@ +Version 6.51 (22 January 2002) +- Classes and funtion return type only refer to R::... + Version 6.50 (9 January 2002) - Update compare_y_at_x. diff --git a/Packages/Cartesian_kernel/include/CGAL/Cartesian.h b/Packages/Cartesian_kernel/include/CGAL/Cartesian.h index 5cd0d3ae659..c0a93178203 100644 --- a/Packages/Cartesian_kernel/include/CGAL/Cartesian.h +++ b/Packages/Cartesian_kernel/include/CGAL/Cartesian.h @@ -231,14 +231,11 @@ struct Cartesian typedef CGAL::Handle_for > Vector_handle_2; typedef CGAL::Handle_for > Direction_handle_2; typedef CGAL::Handle_for > Line_handle_2; - typedef CGAL::Handle_for > Ray_handle_2; - typedef CGAL::Handle_for > Segment_handle_2; - typedef CGAL::Handle_for > + typedef CGAL::Handle_for > Ray_handle_2; + typedef CGAL::Handle_for > Segment_handle_2; + typedef CGAL::Handle_for > Circle_handle_2; - typedef CGAL::Handle_for > Triangle_handle_2; + typedef CGAL::Handle_for > Triangle_handle_2; typedef CGAL::Handle_for > Iso_rectangle_handle_2; typedef CGAL::Handle_for_virtual< Aff_transformation_rep_baseC2 > Aff_transformation_handle_2; @@ -246,21 +243,15 @@ struct Cartesian typedef CGAL::Handle_for > Point_handle_3; typedef CGAL::Handle_for > Vector_handle_3; typedef CGAL::Handle_for > Direction_handle_3; - typedef CGAL::Handle_for > + typedef CGAL::Handle_for > Line_handle_3; typedef CGAL::Handle_for > Plane_handle_3; - typedef CGAL::Handle_for > Ray_handle_3; - typedef CGAL::Handle_for > Segment_handle_3; - typedef CGAL::Handle_for > - Sphere_handle_3; - typedef CGAL::Handle_for > Triangle_handle_3; - typedef CGAL::Handle_for > Tetrahedron_handle_3; - typedef CGAL::Handle_for > Iso_cuboid_handle_3; + typedef CGAL::Handle_for > Ray_handle_3; + typedef CGAL::Handle_for > Segment_handle_3; + typedef CGAL::Handle_for > Sphere_handle_3; + typedef CGAL::Handle_for > Triangle_handle_3; + typedef CGAL::Handle_for > Tetrahedron_handle_3; + typedef CGAL::Handle_for > Iso_cuboid_handle_3; typedef CGAL::Handle_for_virtual< Aff_transformation_rep_baseC3 > Aff_transformation_handle_3; diff --git a/Packages/Cartesian_kernel/include/CGAL/Cartesian/Aff_transformation_2.h b/Packages/Cartesian_kernel/include/CGAL/Cartesian/Aff_transformation_2.h index dcf0d786521..0930b6e2d44 100644 --- a/Packages/Cartesian_kernel/include/CGAL/Cartesian/Aff_transformation_2.h +++ b/Packages/Cartesian_kernel/include/CGAL/Cartesian/Aff_transformation_2.h @@ -49,10 +49,11 @@ class Aff_transformationC2 CGAL_ADVANCED_KERNEL_PARTIAL_SPEC typedef typename R_::FT FT; typedef Aff_transformation_rep_baseC2 Aff_t_base; - typedef typename R_::Kernel_base::Point_2 Point_2; - typedef typename R_::Kernel_base::Vector_2 Vector_2; - typedef typename R_::Kernel_base::Direction_2 Direction_2; - typedef typename R_::Kernel_base::Line_2 Line_2; + typedef typename R_::Point_2 Point_2; + typedef typename R_::Vector_2 Vector_2; + typedef typename R_::Direction_2 Direction_2; + typedef typename R_::Line_2 Line_2; + typedef typename R_::Aff_transformation_2 Aff_transformation_2; public: typedef R_ R; @@ -153,7 +154,7 @@ public: operator()(const Line_2 &l) const { return transform(l); } - Aff_transformationC2 inverse() const { return Ptr()->inverse(); } + Aff_transformation_2 inverse() const { return Ptr()->inverse(); } bool is_even() const { return Ptr()->is_even(); } bool is_odd() const { return ! (Ptr()->is_even()); } @@ -163,7 +164,7 @@ public: FT m(int i, int j) const { return cartesian(i,j); } FT hm(int i, int j) const { return cartesian(i,j); } - Aff_transformationC2 operator*(const Aff_transformationC2 &t) const + Aff_transformation_2 operator*(const Aff_transformationC2 &t) const { return (*Ptr()) * (*t.Ptr()); } diff --git a/Packages/Cartesian_kernel/include/CGAL/Cartesian/Aff_transformation_3.h b/Packages/Cartesian_kernel/include/CGAL/Cartesian/Aff_transformation_3.h index 42e3108dc34..b704a709c34 100644 --- a/Packages/Cartesian_kernel/include/CGAL/Cartesian/Aff_transformation_3.h +++ b/Packages/Cartesian_kernel/include/CGAL/Cartesian/Aff_transformation_3.h @@ -48,15 +48,16 @@ class Aff_transformationC3 CGAL_ADVANCED_KERNEL_PARTIAL_SPEC friend class PlaneC3; // FIXME: why ? #endif + typedef typename R_::FT FT; + typedef Aff_transformation_rep_baseC3 Aff_t_base; + + typedef typename R_::Point_3 Point_3; + typedef typename R_::Vector_3 Vector_3; + typedef typename R_::Direction_3 Direction_3; + typedef typename R_::Plane_3 Plane_3; + typedef typename R_::Aff_transformation_3 Aff_transformation_3; public: typedef R_ R; - typedef typename R::FT FT; - typedef Aff_transformation_rep_baseC3 Aff_t_base; - - typedef typename R::Kernel_base::Point_3 Point_3; - typedef typename R::Kernel_base::Vector_3 Vector_3; - typedef typename R::Kernel_base::Direction_3 Direction_3; - typedef typename R::Kernel_base::Plane_3 Plane_3; Aff_transformationC3() { @@ -152,7 +153,7 @@ public: operator()(const Plane_3& p) const { return transform(p); } // FIXME : not compiled by the test-suite ! - Aff_transformationC3 inverse() const { return Ptr()->inverse(); } + Aff_transformation_3 inverse() const { return Ptr()->inverse(); } bool is_even() const { return Ptr()->is_even(); } bool is_odd() const { return ! (Ptr()->is_even()); } @@ -162,11 +163,11 @@ public: FT m(int i, int j) const { return cartesian(i,j); } FT hm(int i, int j) const { return cartesian(i,j); } - Aff_transformationC3 operator*(const Aff_transformationC3 &t) const + Aff_transformation_3 operator*(const Aff_transformationC3 &t) const { return (*Ptr()) * (*t.Ptr()); } protected: - Aff_transformationC3 transpose() const { return Ptr()->transpose(); } + Aff_transformation_3 transpose() const { return Ptr()->transpose(); } }; diff --git a/Packages/Cartesian_kernel/include/CGAL/Cartesian/Aff_transformation_rep_2.h b/Packages/Cartesian_kernel/include/CGAL/Cartesian/Aff_transformation_rep_2.h index 31f374560c1..74a2e4d3802 100644 --- a/Packages/Cartesian_kernel/include/CGAL/Cartesian/Aff_transformation_rep_2.h +++ b/Packages/Cartesian_kernel/include/CGAL/Cartesian/Aff_transformation_rep_2.h @@ -31,12 +31,11 @@ class Aff_transformation_rep_baseC2 : public Ref_counted_virtual { public: - typedef typename R::FT FT; - - typedef typename R::Kernel_base::Point_2 Point_2; - typedef typename R::Kernel_base::Vector_2 Vector_2; - typedef typename R::Kernel_base::Direction_2 Direction_2; - typedef typename R::Kernel_base::Aff_transformation_2 Aff_transformation_2; + typedef typename R::FT FT; + typedef typename R::Point_2 Point_2; + typedef typename R::Vector_2 Vector_2; + typedef typename R::Direction_2 Direction_2; + typedef typename R::Aff_transformation_2 Aff_transformation_2; virtual ~Aff_transformation_rep_baseC2() {} @@ -166,7 +165,7 @@ friend class Scaling_repC2; } private: - FT t11, t12, t13; // FIXME : use an array instead ? + FT t11, t12, t13; FT t21, t22, t23; }; @@ -178,7 +177,7 @@ template < class R > CGAL_KERNEL_LARGE_INLINE typename Aff_transformation_repC2::Aff_transformation_2 Aff_transformation_repC2:: -inverse() const // FIXME : construction +inverse() const { FT det = FT(1) / (t11 * t22 - t12 * t21); return Aff_transformation_2( @@ -199,7 +198,7 @@ template < class R > CGAL_KERNEL_LARGE_INLINE typename Aff_transformation_repC2::Aff_transformation_2 Aff_transformation_repC2:: -compose(const Aff_transformation_repC2 &t) const // FIXME : construction +compose(const Aff_transformation_repC2 &t) const { return Aff_transformation_2(t.t11*t11 + t.t12*t21, t.t11*t12 + t.t12*t22, @@ -213,7 +212,7 @@ template < class R > CGAL_KERNEL_LARGE_INLINE typename Aff_transformation_repC2::Aff_transformation_2 Aff_transformation_repC2:: -compose(const Translation_repC2 &t) const // FIXME : construction +compose(const Translation_repC2 &t) const { return Aff_transformation_2(t11, t12, @@ -227,7 +226,7 @@ template < class R > CGAL_KERNEL_LARGE_INLINE typename Aff_transformation_repC2::Aff_transformation_2 Aff_transformation_repC2:: -compose(const Rotation_repC2 &t) const // FIXME : construction +compose(const Rotation_repC2 &t) const { return Aff_transformation_2(t.cosinus_*t11 - t.sinus_*t21, t.cosinus_*t12 - t.sinus_*t22, @@ -241,7 +240,7 @@ template < class R > CGAL_KERNEL_LARGE_INLINE typename Aff_transformation_repC2::Aff_transformation_2 Aff_transformation_repC2:: -compose(const Scaling_repC2 &t) const // FIXME : construction +compose(const Scaling_repC2 &t) const { return Aff_transformation_2(t.scalefactor_ * t11, t.scalefactor_ * t12, diff --git a/Packages/Cartesian_kernel/include/CGAL/Cartesian/Aff_transformation_rep_3.h b/Packages/Cartesian_kernel/include/CGAL/Cartesian/Aff_transformation_rep_3.h index f310f664168..ffa8c5ab569 100644 --- a/Packages/Cartesian_kernel/include/CGAL/Cartesian/Aff_transformation_rep_3.h +++ b/Packages/Cartesian_kernel/include/CGAL/Cartesian/Aff_transformation_rep_3.h @@ -31,12 +31,11 @@ class Aff_transformation_rep_baseC3 : public Ref_counted_virtual { public: - typedef typename R::FT FT; - - typedef typename R::Kernel_base::Point_3 Point_3; - typedef typename R::Kernel_base::Vector_3 Vector_3; - typedef typename R::Kernel_base::Direction_3 Direction_3; - typedef typename R::Kernel_base::Aff_transformation_3 Aff_transformation_3; + typedef typename R::FT FT; + typedef typename R::Point_3 Point_3; + typedef typename R::Vector_3 Vector_3; + typedef typename R::Direction_3 Direction_3; + typedef typename R::Aff_transformation_3 Aff_transformation_3; virtual ~Aff_transformation_rep_baseC3(){} diff --git a/Packages/Cartesian_kernel/include/CGAL/Cartesian/Circle_2.h b/Packages/Cartesian_kernel/include/CGAL/Cartesian/Circle_2.h index d25065ea60f..657fa95affb 100644 --- a/Packages/Cartesian_kernel/include/CGAL/Cartesian/Circle_2.h +++ b/Packages/Cartesian_kernel/include/CGAL/Cartesian/Circle_2.h @@ -30,15 +30,14 @@ template class CircleC2 CGAL_ADVANCED_KERNEL_PARTIAL_SPEC : public R_::Circle_handle_2 { - typedef typename R_::FT FT; + typedef typename R_::FT FT; + typedef typename R_::Circle_2 Circle_2; + typedef typename R_::Point_2 Point_2; + typedef typename R_::Aff_transformation_2 Aff_transformation_2; typedef typename R_::Circle_handle_2 base; typedef typename base::element_type rep; - typedef typename R_::Kernel_base::Point_2 Point_2; - typedef typename R_::Kernel_base::Vector_2 Vector_2; - typedef typename R_::Kernel_base::Aff_transformation_2 Aff_transformation_2; - public: typedef R_ R; @@ -68,9 +67,7 @@ public: if (p != q) { Point_2 center = midpoint(p, q); - FT squared_radius = squared_distance(p, center); - - initialize_with(rep(center, squared_radius, orient)); + initialize_with(rep(center, squared_distance(p, center), orient)); } else initialize_with(rep(p, FT(0), orient)); } @@ -81,9 +78,7 @@ public: CGAL_kernel_precondition( orient != COLLINEAR); Point_2 center = circumcenter(p, q, r); - FT squared_radius = squared_distance(p, center); - - initialize_with(rep(center, squared_radius, orient)); + initialize_with(rep(center, squared_distance(p, center), orient)); } bool operator==(const CircleC2 &s) const; @@ -104,9 +99,9 @@ public: return Ptr()->third; } - CircleC2 opposite() const; + Circle_2 opposite() const; - CircleC2 orthogonal_transform(const Aff_transformation_2 &t) const; + Circle_2 orthogonal_transform(const Aff_transformation_2 &t) const; Oriented_side oriented_side(const Point_2 &p) const; Bounded_side bounded_side(const Point_2 &p) const; @@ -161,7 +156,7 @@ CGAL_KERNEL_INLINE Bounded_side CircleC2:: bounded_side(const typename CircleC2::Point_2 &p) const -{ // FIXME : predicate +{ return Bounded_side(CGAL_NTS compare(squared_radius(), squared_distance(center(),p))); } @@ -171,8 +166,7 @@ inline bool CircleC2:: has_on_boundary(const typename CircleC2::Point_2 &p) const -{ // FIXME: predicate - // return squared_distance(center(), p) == squared_radius(); +{ return bounded_side(p) == ON_BOUNDARY; } @@ -182,8 +176,6 @@ bool CircleC2:: has_on_bounded_side(const typename CircleC2::Point_2 &p) const { - // FIXME: predicate - // return squared_distance(center(),p) < squared_radius(); return bounded_side(p) == ON_BOUNDED_SIDE; } @@ -193,8 +185,6 @@ bool CircleC2:: has_on_unbounded_side(const typename CircleC2::Point_2 &p) const { - // FIXME: predicate - // return squared_distance(center(),p) > squared_radius(); return bounded_side(p) == ON_UNBOUNDED_SIDE; } @@ -225,13 +215,12 @@ inline bool CircleC2::is_degenerate() const { - // FIXME: predicate return CGAL_NTS is_zero(squared_radius()); } template < class R > inline -CircleC2 +typename CircleC2::Circle_2 CircleC2::opposite() const { return CircleC2(center(), @@ -254,11 +243,11 @@ CircleC2::bbox() const // FIXME : to_interval() template < class R > CGAL_KERNEL_INLINE -CircleC2 +typename CircleC2::Circle_2 CircleC2::orthogonal_transform (const typename CircleC2::Aff_transformation_2 &t) const -{ // FIXME : construction - Vector_2 vec(FT(1), FT(0) ); // unit vector +{ + typename R::Vector_2 vec(FT(1), FT(0) ); // unit vector vec = vec.transform(t); // transformed FT sq_scale = vec.squared_length(); // squared scaling factor diff --git a/Packages/Cartesian_kernel/include/CGAL/Cartesian/Data_accessor_2.h b/Packages/Cartesian_kernel/include/CGAL/Cartesian/Data_accessor_2.h index e52278005c0..8829b28e6f7 100644 --- a/Packages/Cartesian_kernel/include/CGAL/Cartesian/Data_accessor_2.h +++ b/Packages/Cartesian_kernel/include/CGAL/Cartesian/Data_accessor_2.h @@ -31,7 +31,7 @@ class Data_accessorC2 CGAL_ADVANCED_KERNEL_PARTIAL_SPEC public: // Min_ellipse_2 wants FT public... typedef typename R_::FT FT; - typedef typename R_::Kernel_base::Point_2 Point; + typedef typename R_::Point_2 Point; typedef R_ R; diff --git a/Packages/Cartesian_kernel/include/CGAL/Cartesian/Direction_2.h b/Packages/Cartesian_kernel/include/CGAL/Cartesian/Direction_2.h index 0ada32638ef..7a36614c45b 100644 --- a/Packages/Cartesian_kernel/include/CGAL/Cartesian/Direction_2.h +++ b/Packages/Cartesian_kernel/include/CGAL/Cartesian/Direction_2.h @@ -28,18 +28,18 @@ template < class R_ > class DirectionC2 CGAL_ADVANCED_KERNEL_PARTIAL_SPEC : public R_::Direction_handle_2 { - typedef typename R_::FT FT; + typedef typename R_::FT FT; + typedef typename R_::Point_2 Point_2; + typedef typename R_::Vector_2 Vector_2; + typedef typename R_::Line_2 Line_2; + typedef typename R_::Ray_2 Ray_2; + typedef typename R_::Segment_2 Segment_2; + typedef typename R_::Direction_2 Direction_2; + typedef typename R_::Aff_transformation_2 Aff_transformation_2; typedef typename R_::Direction_handle_2 base; typedef typename base::element_type rep; - typedef typename R_::Kernel_base::Point_2 Point_2; - typedef typename R_::Kernel_base::Vector_2 Vector_2; - typedef typename R_::Kernel_base::Line_2 Line_2; - typedef typename R_::Kernel_base::Ray_2 Ray_2; - typedef typename R_::Kernel_base::Segment_2 Segment_2; - typedef typename R_::Kernel_base::Aff_transformation_2 Aff_transformation_2; - public: typedef R_ R; @@ -71,14 +71,15 @@ public: const DirectionC2 &d2) const; Vector_2 to_vector() const; + Vector_2 vector() const { return to_vector(); } - DirectionC2 perpendicular(const Orientation &o) const; - DirectionC2 transform(const Aff_transformation_2 &t) const + Direction_2 perpendicular(const Orientation &o) const; + Direction_2 transform(const Aff_transformation_2 &t) const { return t.transform(*this); } - DirectionC2 operator-() const; + Direction_2 operator-() const; const FT & delta(int i) const; const FT & dx() const @@ -168,14 +169,14 @@ inline typename DirectionC2::Vector_2 DirectionC2::to_vector() const { - return Vector_2(*this); + return Vector_2(dx(), dy()); } template < class R > CGAL_KERNEL_MEDIUM_INLINE -DirectionC2 +typename DirectionC2::Direction_2 DirectionC2::perpendicular(const Orientation &o) const -{ // FIXME : construction +{ CGAL_kernel_precondition(o != COLLINEAR); if (o == COUNTERCLOCKWISE) return DirectionC2(-dy(), dx()); @@ -185,9 +186,9 @@ DirectionC2::perpendicular(const Orientation &o) const template < class R > inline -DirectionC2 +typename DirectionC2::Direction_2 DirectionC2::operator-() const -{ // FIXME : construction +{ return DirectionC2(-dx(), -dy()); } diff --git a/Packages/Cartesian_kernel/include/CGAL/Cartesian/Direction_3.h b/Packages/Cartesian_kernel/include/CGAL/Cartesian/Direction_3.h index c450688dc6a..9db46eed66c 100644 --- a/Packages/Cartesian_kernel/include/CGAL/Cartesian/Direction_3.h +++ b/Packages/Cartesian_kernel/include/CGAL/Cartesian/Direction_3.h @@ -29,16 +29,16 @@ class DirectionC3 CGAL_ADVANCED_KERNEL_PARTIAL_SPEC : public R_::Direction_handle_3 { typedef typename R_::FT FT; + typedef typename R_::Vector_3 Vector_3; + typedef typename R_::Line_3 Line_3; + typedef typename R_::Ray_3 Ray_3; + typedef typename R_::Segment_3 Segment_3; + typedef typename R_::Direction_3 Direction_3; + typedef typename R_::Aff_transformation_3 Aff_transformation_3; typedef typename R_::Direction_handle_3 base; typedef typename base::element_type rep; - typedef typename R_::Kernel_base::Vector_3 Vector_3; - typedef typename R_::Kernel_base::Line_3 Line_3; - typedef typename R_::Kernel_base::Ray_3 Ray_3; - typedef typename R_::Kernel_base::Segment_3 Segment_3; - typedef typename R_::Kernel_base::Aff_transformation_3 Aff_transformation_3; - public: typedef R_ R; @@ -64,12 +64,14 @@ public: bool operator!=(const DirectionC3 &d) const; Vector_3 to_vector() const; - DirectionC3 transform(const Aff_transformation_3 &t) const + Vector_3 vector() const { return to_vector(); } + + Direction_3 transform(const Aff_transformation_3 &t) const { return t.transform(*this); } - DirectionC3 operator-() const; + Direction_3 operator-() const; const FT & delta(int i) const; const FT & dx() const @@ -130,14 +132,14 @@ inline typename DirectionC3::Vector_3 DirectionC3::to_vector() const { - return Vector_3(*this); + return Vector_3(dx(), dy(), dz()); } template < class R > inline -DirectionC3 +typename DirectionC3::Direction_3 DirectionC3::operator-() const -{ // FIXME : construction +{ return DirectionC3(-dx(), -dy(), -dz()); } diff --git a/Packages/Cartesian_kernel/include/CGAL/Cartesian/Iso_cuboid_3.h b/Packages/Cartesian_kernel/include/CGAL/Cartesian/Iso_cuboid_3.h index 8739a05d8f7..0514bba4923 100644 --- a/Packages/Cartesian_kernel/include/CGAL/Cartesian/Iso_cuboid_3.h +++ b/Packages/Cartesian_kernel/include/CGAL/Cartesian/Iso_cuboid_3.h @@ -31,13 +31,13 @@ class Iso_cuboidC3 CGAL_ADVANCED_KERNEL_PARTIAL_SPEC : public R_::Iso_cuboid_handle_3 { typedef typename R_::FT FT; + typedef typename R_::Iso_cuboid_3 Iso_cuboid_3; + typedef typename R_::Point_3 Point_3; + typedef typename R_::Aff_transformation_3 Aff_transformation_3; typedef typename R_::Iso_cuboid_handle_3 base; typedef typename base::element_type rep; - typedef typename R_::Kernel_base::Point_3 Point_3; - typedef typename R_::Kernel_base::Aff_transformation_3 Aff_transformation_3; - public: typedef R_ R; @@ -45,7 +45,7 @@ public: : base(rep()) {} Iso_cuboidC3(const Point_3 &p, const Point_3 &q) - { // FIXME : construction + { FT minx, maxx, miny, maxy, minz, maxz; if (p.x() < q.x()) { minx = p.x(); maxx = q.x(); } else { minx = q.x(); maxx = p.x(); } @@ -92,7 +92,7 @@ public: Point_3 vertex(int i) const; Point_3 operator[](int i) const; - Iso_cuboidC3 transform(const Aff_transformation_3 &t) const + Iso_cuboid_3 transform(const Aff_transformation_3 &t) const { return Iso_cuboidC3(t.transform(min()), t.transform(max())); } diff --git a/Packages/Cartesian_kernel/include/CGAL/Cartesian/Iso_rectangle_2.h b/Packages/Cartesian_kernel/include/CGAL/Cartesian/Iso_rectangle_2.h index 03a4c859a56..ee173dc8320 100644 --- a/Packages/Cartesian_kernel/include/CGAL/Cartesian/Iso_rectangle_2.h +++ b/Packages/Cartesian_kernel/include/CGAL/Cartesian/Iso_rectangle_2.h @@ -28,14 +28,14 @@ template class Iso_rectangleC2 CGAL_ADVANCED_KERNEL_PARTIAL_SPEC : public R_::Iso_rectangle_handle_2 { - typedef typename R_::FT FT; + typedef typename R_::FT FT; + typedef typename R_::Point_2 Point_2; + typedef typename R_::Iso_rectangle_2 Iso_rectangle_2; + typedef typename R_::Aff_transformation_2 Aff_transformation_2; typedef typename R_::Iso_rectangle_handle_2 base; typedef typename base::element_type rep; - typedef typename R_::Point_2 Point_2; - typedef typename R_::Kernel_base::Aff_transformation_2 Aff_transformation_2; - public: typedef R_ R; @@ -43,7 +43,7 @@ public: : base(rep()) {} Iso_rectangleC2(const Point_2 &p, const Point_2 &q) - { // FIXME : construction + { FT minx, maxx, miny, maxy; if (p.x() < q.x()) { minx = p.x(); maxx = q.x(); } else { minx = q.x(); maxx = p.x(); } @@ -85,7 +85,7 @@ public: Point_2 vertex(int i) const; Point_2 operator[](int i) const; - Iso_rectangleC2 transform(const Aff_transformation_2 &t) const + Iso_rectangle_2 transform(const Aff_transformation_2 &t) const { // FIXME : We need a precondition like this!!! // CGAL_kernel_precondition(t.is_axis_preserving()); diff --git a/Packages/Cartesian_kernel/include/CGAL/Cartesian/Line_2.h b/Packages/Cartesian_kernel/include/CGAL/Cartesian/Line_2.h index 52920438ad7..f5c49c0dd11 100644 --- a/Packages/Cartesian_kernel/include/CGAL/Cartesian/Line_2.h +++ b/Packages/Cartesian_kernel/include/CGAL/Cartesian/Line_2.h @@ -28,17 +28,17 @@ template < class R_ > class LineC2 CGAL_ADVANCED_KERNEL_PARTIAL_SPEC : public R_::Line_handle_2 { - typedef typename R_::FT FT; + typedef typename R_::FT FT; + typedef typename R_::Point_2 Point_2; + typedef typename R_::Direction_2 Direction_2; + typedef typename R_::Ray_2 Ray_2; + typedef typename R_::Segment_2 Segment_2; + typedef typename R_::Line_2 Line_2; + typedef typename R_::Aff_transformation_2 Aff_transformation_2; typedef typename R_::Line_handle_2 base; typedef typename base::element_type rep; - typedef typename R_::Kernel_base::Point_2 Point_2; - typedef typename R_::Kernel_base::Direction_2 Direction_2; - typedef typename R_::Kernel_base::Ray_2 Ray_2; - typedef typename R_::Kernel_base::Segment_2 Segment_2; - typedef typename R_::Kernel_base::Aff_transformation_2 Aff_transformation_2; - public: typedef R_ R; @@ -79,8 +79,8 @@ public: FT x_at_y(const FT &y) const; FT y_at_x(const FT &x) const; - LineC2 perpendicular(const Point_2 &p) const; - LineC2 opposite() const; + Line_2 perpendicular(const Point_2 &p) const; + Line_2 opposite() const; Point_2 point(int i) const; Point_2 point() const; @@ -98,7 +98,7 @@ public: bool is_vertical() const; bool is_degenerate() const; - LineC2 transform(const Aff_transformation_2 &t) const + Line_2 transform(const Aff_transformation_2 &t) const { return LineC2(t.transform(point(0)), t.transform(direction())); @@ -165,7 +165,7 @@ LineC2::y_at_x(const typename LineC2::FT &x) const template < class R > inline -LineC2 +typename LineC2::Line_2 LineC2:: perpendicular(const typename LineC2::Point_2 &p) const { @@ -174,9 +174,9 @@ perpendicular(const typename LineC2::Point_2 &p) const template < class R > inline -LineC2 +typename LineC2::Line_2 LineC2::opposite() const -{ // FIXME : construction +{ return LineC2( -a(), -b(), -c() ); } @@ -209,7 +209,7 @@ template < class R > inline typename LineC2::Direction_2 LineC2::direction() const -{ // FIXME : construction +{ return Direction_2( b(), -a() ); } diff --git a/Packages/Cartesian_kernel/include/CGAL/Cartesian/Line_3.h b/Packages/Cartesian_kernel/include/CGAL/Cartesian/Line_3.h index 9e478f14081..f327a1e4af5 100644 --- a/Packages/Cartesian_kernel/include/CGAL/Cartesian/Line_3.h +++ b/Packages/Cartesian_kernel/include/CGAL/Cartesian/Line_3.h @@ -28,32 +28,32 @@ template < class R_ > class LineC3 CGAL_ADVANCED_KERNEL_PARTIAL_SPEC : public R_::Line_handle_3 { - typedef typename R_::FT FT; + typedef typename R_::FT FT; + typedef typename R_::Point_3 Point_3; + typedef typename R_::Vector_3 Vector_3; + typedef typename R_::Direction_3 Direction_3; + typedef typename R_::Plane_3 Plane_3; + typedef typename R_::Ray_3 Ray_3; + typedef typename R_::Line_3 Line_3; + typedef typename R_::Segment_3 Segment_3; + typedef typename R_::Aff_transformation_3 Aff_transformation_3; typedef typename R_::Line_handle_3 base; typedef typename base::element_type rep; - typedef typename R_::Kernel_base::Point_3 Point_3; - typedef typename R_::Kernel_base::Vector_3 Vector_3; - typedef typename R_::Kernel_base::Direction_3 Direction_3; - typedef typename R_::Kernel_base::Plane_3 Plane_3; - typedef typename R_::Kernel_base::Ray_3 Ray_3; - typedef typename R_::Kernel_base::Segment_3 Segment_3; - typedef typename R_::Kernel_base::Aff_transformation_3 Aff_transformation_3; - public: typedef R_ R; LineC3() : base(rep()) {} - LineC3(const Point_3 &p, const Point_3 &q) // FIXME : construction + LineC3(const Point_3 &p, const Point_3 &q) : base(rep(p, (q-p).direction())) {} - LineC3(const Segment_3 &s) // FIXME : construction + LineC3(const Segment_3 &s) : base(rep(s.start(), (s.end() - s.start()).direction())) {} - LineC3(const Ray_3 &r) // FIXME : construction + LineC3(const Ray_3 &r) : base(rep(r.start(), (r.point(1) - r.start()).direction())) {} LineC3(const Point_3 &p, const Direction_3 &d) @@ -63,7 +63,7 @@ public: bool operator!=(const LineC3 &l) const; Plane_3 perpendicular_plane(const Point_3 &p) const; - LineC3 opposite() const; + Line_3 opposite() const; const Point_3 & point() const { @@ -81,7 +81,7 @@ public: bool has_on(const Point_3 &p) const; bool is_degenerate() const; - LineC3 transform(const Aff_transformation_3 &t) const + Line_3 transform(const Aff_transformation_3 &t) const { return LineC3(t.transform(point()), t.transform(direction())); } @@ -128,7 +128,7 @@ perpendicular_plane(const typename LineC3::Point_3 &p) const template < class R > inline -LineC3 +typename LineC3::Line_3 LineC3::opposite() const { return LineC3(point(), -direction()); diff --git a/Packages/Cartesian_kernel/include/CGAL/Cartesian/Plane_3.h b/Packages/Cartesian_kernel/include/CGAL/Cartesian/Plane_3.h index 4732743ac53..9105d79344d 100644 --- a/Packages/Cartesian_kernel/include/CGAL/Cartesian/Plane_3.h +++ b/Packages/Cartesian_kernel/include/CGAL/Cartesian/Plane_3.h @@ -28,20 +28,20 @@ template class PlaneC3 CGAL_ADVANCED_KERNEL_PARTIAL_SPEC : public R_::Plane_handle_3 { - typedef typename R_::FT FT; + typedef typename R_::FT FT; + typedef typename R_::Point_2 Point_2; + typedef typename R_::Point_3 Point_3; + typedef typename R_::Vector_3 Vector_3; + typedef typename R_::Direction_3 Direction_3; + typedef typename R_::Line_3 Line_3; + typedef typename R_::Ray_3 Ray_3; + typedef typename R_::Segment_3 Segment_3; + typedef typename R_::Plane_3 Plane_3; + typedef typename R_::Aff_transformation_3 Aff_transformation_3; typedef typename R_::Plane_handle_3 base; typedef typename base::element_type rep; - typedef typename R_::Kernel_base::Point_2 Point_2; - typedef typename R_::Kernel_base::Point_3 Point_3; - typedef typename R_::Kernel_base::Vector_3 Vector_3; - typedef typename R_::Kernel_base::Direction_3 Direction_3; - typedef typename R_::Kernel_base::Line_3 Line_3; - typedef typename R_::Kernel_base::Ray_3 Ray_3; - typedef typename R_::Kernel_base::Segment_3 Segment_3; - typedef typename R_::Kernel_base::Aff_transformation_3 Aff_transformation_3; - public: typedef R_ R; @@ -92,7 +92,7 @@ public: } Line_3 perpendicular_line(const Point_3 &p) const; - PlaneC3 opposite() const; + Plane_3 opposite() const; Point_3 point() const; Point_3 projection(const Point_3 &p) const; @@ -106,7 +106,7 @@ public: Point_2 to_2d(const Point_3 &p) const; Point_3 to_3d(const Point_2 &p) const; - PlaneC3 transform(const Aff_transformation_3 &t) const + Plane_3 transform(const Aff_transformation_3 &t) const { if (t.is_even()) return PlaneC3(t.transform(point()), @@ -200,7 +200,7 @@ PlaneC3::orthogonal_direction() const template < class R > typename PlaneC3::Vector_3 PlaneC3::base1() const -{ // FIXME : construction +{ if ( CGAL_NTS is_zero(a()) ) // parallel to x-axis return Vector_3(FT(1), FT(0), FT(0)); @@ -216,7 +216,7 @@ PlaneC3::base1() const template < class R > typename PlaneC3::Vector_3 PlaneC3::base2() const -{ // FIXME : construction +{ return cross_product(orthogonal_vector(), base1()); } @@ -224,7 +224,7 @@ template < class R > typename PlaneC3::Point_3 PlaneC3:: to_plane_basis(const typename PlaneC3::Point_3 &p) const -{ // FIXME : construction +{ FT alpha, beta, gamma; solve(base1(), base2(), orthogonal_vector(), p - point(), @@ -237,7 +237,7 @@ template < class R > typename PlaneC3::Point_2 PlaneC3:: to_2d(const typename PlaneC3::Point_3 &p) const -{ // FIXME : construction +{ FT alpha, beta, gamma; solve(base1(), base2(), orthogonal_vector(), p - point(), @@ -251,7 +251,7 @@ inline typename PlaneC3::Point_3 PlaneC3:: to_3d(const typename PlaneC3::Point_2 &p) const -{ // FIXME : construction +{ return point() + p.x() * base1() + p.y() * base2(); } @@ -266,9 +266,9 @@ perpendicular_line(const typename PlaneC3::Point_3 &p) const template < class R > inline -PlaneC3 +typename PlaneC3::Plane_3 PlaneC3::opposite() const -{ // FIXME : construction +{ return PlaneC3(-a(), -b(), -c(), -d()); } diff --git a/Packages/Cartesian_kernel/include/CGAL/Cartesian/Point_2.h b/Packages/Cartesian_kernel/include/CGAL/Cartesian/Point_2.h index fa94b3f764a..1bb31e5dc5c 100644 --- a/Packages/Cartesian_kernel/include/CGAL/Cartesian/Point_2.h +++ b/Packages/Cartesian_kernel/include/CGAL/Cartesian/Point_2.h @@ -31,14 +31,14 @@ template < class R_ > class PointC2 CGAL_ADVANCED_KERNEL_PARTIAL_SPEC : public R_::Point_handle_2 { - typedef typename R_::FT FT; + typedef typename R_::FT FT; + typedef typename R_::Vector_2 Vector_2; + typedef typename R_::Point_2 Point_2; + typedef typename R_::Aff_transformation_2 Aff_transformation_2; typedef typename R_::Point_handle_2 base; typedef typename base::element_type rep; - typedef typename R_::Kernel_base::Vector_2 Vector_2; - typedef typename R_::Kernel_base::Aff_transformation_2 Aff_transformation_2; - public: typedef R_ R; @@ -109,7 +109,7 @@ public: Bbox_2 bbox() const; - PointC2 transform(const Aff_transformation_2 &t) const + Point_2 transform(const Aff_transformation_2 &t) const { return t.transform(*this); } diff --git a/Packages/Cartesian_kernel/include/CGAL/Cartesian/Point_3.h b/Packages/Cartesian_kernel/include/CGAL/Cartesian/Point_3.h index cd4c1f888fd..fddbd601795 100644 --- a/Packages/Cartesian_kernel/include/CGAL/Cartesian/Point_3.h +++ b/Packages/Cartesian_kernel/include/CGAL/Cartesian/Point_3.h @@ -32,13 +32,12 @@ class PointC3 CGAL_ADVANCED_KERNEL_PARTIAL_SPEC : public R_::Point_handle_3 { typedef typename R_::FT FT; + typedef typename R_::Vector_3 Vector_3; + typedef typename R_::Aff_transformation_3 Aff_transformation_3; typedef typename R_::Point_handle_3 base; typedef typename base::element_type rep; - typedef typename R_::Kernel_base::Vector_3 Vector_3; - typedef typename R_::Kernel_base::Aff_transformation_3 Aff_transformation_3; - public: typedef R_ R; diff --git a/Packages/Cartesian_kernel/include/CGAL/Cartesian/Ray_2.h b/Packages/Cartesian_kernel/include/CGAL/Cartesian/Ray_2.h index 8ee018d1216..4fc5584f464 100644 --- a/Packages/Cartesian_kernel/include/CGAL/Cartesian/Ray_2.h +++ b/Packages/Cartesian_kernel/include/CGAL/Cartesian/Ray_2.h @@ -28,16 +28,16 @@ template < class R_ > class RayC2 CGAL_ADVANCED_KERNEL_PARTIAL_SPEC : public R_::Ray_handle_2 { - typedef typename R_::FT FT; + typedef typename R_::FT FT; + typedef typename R_::Point_2 Point_2; + typedef typename R_::Direction_2 Direction_2; + typedef typename R_::Line_2 Line_2; + typedef typename R_::Ray_2 Ray_2; + typedef typename R_::Aff_transformation_2 Aff_transformation_2; typedef typename R_::Ray_handle_2 base; typedef typename base::element_type rep; - typedef typename R_::Kernel_base::Point_2 Point_2; - typedef typename R_::Kernel_base::Direction_2 Direction_2; - typedef typename R_::Kernel_base::Line_2 Line_2; - typedef typename R_::Kernel_base::Aff_transformation_2 Aff_transformation_2; - public: typedef R_ R; @@ -66,9 +66,9 @@ public: Direction_2 direction() const; Line_2 supporting_line() const; - RayC2 opposite() const; + Ray_2 opposite() const; - RayC2 transform(const Aff_transformation_2 &t) const + Ray_2 transform(const Aff_transformation_2 &t) const { return RayC2(t.transform(source()), t.transform(second_point())); } @@ -139,7 +139,7 @@ RayC2::supporting_line() const template < class R > inline -RayC2 +typename RayC2::Ray_2 RayC2::opposite() const { return RayC2( source(), - direction() ); diff --git a/Packages/Cartesian_kernel/include/CGAL/Cartesian/Ray_3.h b/Packages/Cartesian_kernel/include/CGAL/Cartesian/Ray_3.h index ab5f89e9695..ea1f6b0e07f 100644 --- a/Packages/Cartesian_kernel/include/CGAL/Cartesian/Ray_3.h +++ b/Packages/Cartesian_kernel/include/CGAL/Cartesian/Ray_3.h @@ -28,16 +28,16 @@ template < class R_ > class RayC3 CGAL_ADVANCED_KERNEL_PARTIAL_SPEC : public R_::Ray_handle_3 { - typedef typename R_::FT FT; + typedef typename R_::FT FT; + typedef typename R_::Point_3 Point_3; + typedef typename R_::Direction_3 Direction_3; + typedef typename R_::Line_3 Line_3; + typedef typename R_::Ray_3 Ray_3; + typedef typename R_::Aff_transformation_3 Aff_transformation_3; typedef typename R_::Ray_handle_3 base; typedef typename base::element_type rep; - typedef typename R_::Kernel_base::Point_3 Point_3; - typedef typename R_::Kernel_base::Direction_3 Direction_3; - typedef typename R_::Kernel_base::Line_3 Line_3; - typedef typename R_::Kernel_base::Aff_transformation_3 Aff_transformation_3; - public: typedef R_ R; @@ -66,9 +66,9 @@ public: Direction_3 direction() const; Line_3 supporting_line() const; - RayC3 opposite() const; + Ray_3 opposite() const; - RayC3 transform(const Aff_transformation_3 &t) const + Ray_3 transform(const Aff_transformation_3 &t) const { return RayC3(t.transform(source()), t.transform(second_point())); } @@ -137,7 +137,7 @@ RayC3::supporting_line() const template < class R > inline -RayC3 +typename RayC3::Ray_3 RayC3::opposite() const { return RayC3( source(), - direction() ); diff --git a/Packages/Cartesian_kernel/include/CGAL/Cartesian/Segment_2.h b/Packages/Cartesian_kernel/include/CGAL/Cartesian/Segment_2.h index b879618a327..1ef626c9089 100644 --- a/Packages/Cartesian_kernel/include/CGAL/Cartesian/Segment_2.h +++ b/Packages/Cartesian_kernel/include/CGAL/Cartesian/Segment_2.h @@ -30,17 +30,16 @@ template < class R_ > class SegmentC2 CGAL_ADVANCED_KERNEL_PARTIAL_SPEC : public R_::Segment_handle_2 { - typedef typename R_::FT FT; + typedef typename R_::FT FT; + typedef typename R_::Point_2 Point_2; + typedef typename R_::Direction_2 Direction_2; + typedef typename R_::Line_2 Line_2; + typedef typename R_::Segment_2 Segment_2; + typedef typename R_::Aff_transformation_2 Aff_transformation_2; typedef typename R_::Segment_handle_2 base; typedef typename base::element_type rep; - typedef typename R_::Kernel_base::Point_2 Point_2; - typedef typename R_::Kernel_base::Vector_2 Vector_2; - typedef typename R_::Kernel_base::Direction_2 Direction_2; - typedef typename R_::Kernel_base::Line_2 Line_2; - typedef typename R_::Kernel_base::Aff_transformation_2 Aff_transformation_2; - public: typedef R_ R; @@ -80,8 +79,8 @@ public: Direction_2 direction() const; Line_2 supporting_line() const; - SegmentC2 opposite() const; - SegmentC2 transform(const Aff_transformation_2 &t) const + Segment_2 opposite() const; + Segment_2 transform(const Aff_transformation_2 &t) const { return SegmentC2(t.transform(source()), t.transform(target())); } @@ -194,7 +193,7 @@ SegmentC2::supporting_line() const template < class R > inline -SegmentC2 +typename SegmentC2::Segment_2 SegmentC2::opposite() const { return SegmentC2(target(), source()); diff --git a/Packages/Cartesian_kernel/include/CGAL/Cartesian/Segment_3.h b/Packages/Cartesian_kernel/include/CGAL/Cartesian/Segment_3.h index 7fe3f983fe1..dea4cdca125 100644 --- a/Packages/Cartesian_kernel/include/CGAL/Cartesian/Segment_3.h +++ b/Packages/Cartesian_kernel/include/CGAL/Cartesian/Segment_3.h @@ -28,16 +28,16 @@ template < class R_ > class SegmentC3 CGAL_ADVANCED_KERNEL_PARTIAL_SPEC : public R_::Segment_handle_3 { - typedef typename R_::FT FT; + typedef typename R_::FT FT; + typedef typename R_::Point_3 Point_3; + typedef typename R_::Direction_3 Direction_3; + typedef typename R_::Line_3 Line_3; + typedef typename R_::Segment_3 Segment_3; + typedef typename R_::Aff_transformation_3 Aff_transformation_3; typedef typename R_::Segment_handle_3 base; typedef typename base::element_type rep; - typedef typename R_::Kernel_base::Point_3 Point_3; - typedef typename R_::Kernel_base::Direction_3 Direction_3; - typedef typename R_::Kernel_base::Line_3 Line_3; - typedef typename R_::Kernel_base::Aff_transformation_3 Aff_transformation_3; - public: typedef R_ R; @@ -75,8 +75,8 @@ public: Direction_3 direction() const; Line_3 supporting_line() const; - SegmentC3 opposite() const; - SegmentC3 transform(const Aff_transformation_3 &t) const + Segment_3 opposite() const; + Segment_3 transform(const Aff_transformation_3 &t) const { return SegmentC3(t.transform(source()), t.transform(target())); } @@ -189,7 +189,7 @@ SegmentC3::supporting_line() const template < class R > inline -SegmentC3 +typename SegmentC3::Segment_3 SegmentC3::opposite() const { return SegmentC3(target(), source()); diff --git a/Packages/Cartesian_kernel/include/CGAL/Cartesian/Sphere_3.h b/Packages/Cartesian_kernel/include/CGAL/Cartesian/Sphere_3.h index e81fda9938a..ef094d5a7e9 100644 --- a/Packages/Cartesian_kernel/include/CGAL/Cartesian/Sphere_3.h +++ b/Packages/Cartesian_kernel/include/CGAL/Cartesian/Sphere_3.h @@ -28,15 +28,15 @@ template class SphereC3 CGAL_ADVANCED_KERNEL_PARTIAL_SPEC : public R_::Sphere_handle_3 { - typedef typename R_::FT FT; + typedef typename R_::FT FT; + typedef typename R_::Point_3 Point_3; + typedef typename R_::Vector_3 Vector_3; + typedef typename R_::Sphere_3 Sphere_3; + typedef typename R_::Aff_transformation_3 Aff_transformation_3; typedef typename R_::Sphere_handle_3 base; typedef typename base::element_type rep; - typedef typename R_::Kernel_base::Point_3 Point_3; - typedef typename R_::Kernel_base::Vector_3 Vector_3; - typedef typename R_::Kernel_base::Aff_transformation_3 Aff_transformation_3; - public: typedef R_ R; @@ -113,7 +113,7 @@ public: return Ptr()->third; } - SphereC3 orthogonal_transform(const Aff_transformation_3 &t) const + Sphere_3 orthogonal_transform(const Aff_transformation_3 &t) const { // FIXME: precond: t.is_orthogonal() (*UNDEFINED*) Vector_3 vec(FT(1), FT(0)); // unit vector @@ -130,7 +130,7 @@ public: bool is_degenerate() const; // Returns a circle with opposite orientation - SphereC3 opposite() const; + Sphere_3 opposite() const; Oriented_side oriented_side(const Point_3 &p) const; //! precond: ! x.is_degenerate() (when available) @@ -268,8 +268,8 @@ is_degenerate() const template < class R > inline -SphereC3 SphereC3:: -opposite() const +typename SphereC3::Sphere_3 +SphereC3::opposite() const { return SphereC3(center(), squared_radius(), CGAL::opposite(orientation()) ); diff --git a/Packages/Cartesian_kernel/include/CGAL/Cartesian/Tetrahedron_3.h b/Packages/Cartesian_kernel/include/CGAL/Cartesian/Tetrahedron_3.h index d06b89c9653..2a814cf1fcd 100644 --- a/Packages/Cartesian_kernel/include/CGAL/Cartesian/Tetrahedron_3.h +++ b/Packages/Cartesian_kernel/include/CGAL/Cartesian/Tetrahedron_3.h @@ -32,15 +32,15 @@ template class TetrahedronC3 CGAL_ADVANCED_KERNEL_PARTIAL_SPEC : public R_::Tetrahedron_handle_3 { - typedef typename R_::FT FT; + typedef typename R_::FT FT; + typedef typename R_::Point_3 Point_3; + typedef typename R_::Plane_3 Plane_3; + typedef typename R_::Tetrahedron_3 Tetrahedron_3; + typedef typename R_::Aff_transformation_3 Aff_transformation_3; typedef typename R_::Tetrahedron_handle_3 base; typedef typename base::element_type rep; - typedef typename R_::Kernel_base::Point_3 Point_3; - typedef typename R_::Kernel_base::Plane_3 Plane_3; - typedef typename R_::Kernel_base::Aff_transformation_3 Aff_transformation_3; - public: typedef R_ R; @@ -59,7 +59,7 @@ public: Bbox_3 bbox() const; - TetrahedronC3 transform(const Aff_transformation_3 &t) const + Tetrahedron_3 transform(const Aff_transformation_3 &t) const { return TetrahedronC3(t.transform(vertex(0)), t.transform(vertex(1)), diff --git a/Packages/Cartesian_kernel/include/CGAL/Cartesian/Triangle_2.h b/Packages/Cartesian_kernel/include/CGAL/Cartesian/Triangle_2.h index b15de566e95..1059b7b9e25 100644 --- a/Packages/Cartesian_kernel/include/CGAL/Cartesian/Triangle_2.h +++ b/Packages/Cartesian_kernel/include/CGAL/Cartesian/Triangle_2.h @@ -30,15 +30,15 @@ template class TriangleC2 CGAL_ADVANCED_KERNEL_PARTIAL_SPEC : public R_::Triangle_handle_2 { - typedef typename R_::FT FT; + typedef typename R_::FT FT; + typedef typename R_::Point_2 Point_2; + typedef typename R_::Vector_2 Vector_2; + typedef typename R_::Triangle_2 Triangle_2; + typedef typename R_::Aff_transformation_2 Aff_transformation_2; typedef typename R_::Triangle_handle_2 base; typedef typename base::element_type rep; - typedef typename R_::Kernel_base::Point_2 Point_2; - typedef typename R_::Kernel_base::Vector_2 Vector_2; - typedef typename R_::Kernel_base::Aff_transformation_2 Aff_transformation_2; - public: typedef R_ R; @@ -54,8 +54,8 @@ public: const Point_2 & vertex(int i) const; const Point_2 & operator[](int i) const; - TriangleC2 opposite() const; - TriangleC2 transform(const Aff_transformation_2 &t) const + Triangle_2 opposite() const; + Triangle_2 transform(const Aff_transformation_2 &t) const { return TriangleC2(t.transform(vertex(0)), t.transform(vertex(1)), @@ -258,9 +258,8 @@ TriangleC2::bbox() const template < class R > inline -TriangleC2 -TriangleC2:: -opposite() const +typename TriangleC2::Triangle_2 +TriangleC2::opposite() const { return TriangleC2(vertex(0), vertex(2), vertex(1)); } diff --git a/Packages/Cartesian_kernel/include/CGAL/Cartesian/Triangle_3.h b/Packages/Cartesian_kernel/include/CGAL/Cartesian/Triangle_3.h index 9108762df1d..2dca0078b9b 100644 --- a/Packages/Cartesian_kernel/include/CGAL/Cartesian/Triangle_3.h +++ b/Packages/Cartesian_kernel/include/CGAL/Cartesian/Triangle_3.h @@ -28,16 +28,16 @@ template class TriangleC3 CGAL_ADVANCED_KERNEL_PARTIAL_SPEC : public R_::Triangle_handle_3 { - typedef typename R_::FT FT; + typedef typename R_::FT FT; + typedef typename R_::Point_3 Point_3; + typedef typename R_::Vector_3 Vector_3; + typedef typename R_::Plane_3 Plane_3; + typedef typename R_::Triangle_3 Triangle_3; + typedef typename R_::Aff_transformation_3 Aff_transformation_3; typedef typename R_::Triangle_handle_3 base; typedef typename base::element_type rep; - typedef typename R_::Kernel_base::Point_3 Point_3; - typedef typename R_::Kernel_base::Vector_3 Vector_3; - typedef typename R_::Kernel_base::Plane_3 Plane_3; - typedef typename R_::Kernel_base::Aff_transformation_3 Aff_transformation_3; - public: typedef R_ R; @@ -52,7 +52,7 @@ public: Plane_3 supporting_plane() const; - TriangleC3 transform(const Aff_transformation_3 &t) const + Triangle_3 transform(const Aff_transformation_3 &t) const { return TriangleC3(t.transform(vertex(0)), t.transform(vertex(1)), diff --git a/Packages/Cartesian_kernel/include/CGAL/Cartesian/Vector_2.h b/Packages/Cartesian_kernel/include/CGAL/Cartesian/Vector_2.h index e44db0dc76d..0c711331662 100644 --- a/Packages/Cartesian_kernel/include/CGAL/Cartesian/Vector_2.h +++ b/Packages/Cartesian_kernel/include/CGAL/Cartesian/Vector_2.h @@ -28,15 +28,15 @@ template < class R_ > class VectorC2 CGAL_ADVANCED_KERNEL_PARTIAL_SPEC : public R_::Vector_handle_2 { - typedef typename R_::FT FT; + typedef typename R_::FT FT; + typedef typename R_::Point_2 Point_2; + typedef typename R_::Direction_2 Direction_2; + typedef typename R_::Vector_2 Vector_2; + typedef typename R_::Aff_transformation_2 Aff_transformation_2; typedef typename R_::Vector_handle_2 base; typedef typename base::element_type rep; - typedef typename R_::Kernel_base::Point_2 Point_2; - typedef typename R_::Kernel_base::Direction_2 Direction_2; - typedef typename R_::Kernel_base::Aff_transformation_2 Aff_transformation_2; - public: typedef R_ R; @@ -102,16 +102,16 @@ public: return 2; } - VectorC2 operator+(const VectorC2 &w) const; - VectorC2 operator-(const VectorC2 &w) const; - VectorC2 operator-() const; + Vector_2 operator+(const VectorC2 &w) const; + Vector_2 operator-(const VectorC2 &w) const; + Vector_2 operator-() const; FT operator*(const VectorC2 &w) const; FT squared_length() const; - VectorC2 operator/(const FT &c) const; + Vector_2 operator/(const FT &c) const; Direction_2 direction() const; - VectorC2 perpendicular(const Orientation &o) const; - VectorC2 transform(const Aff_transformation_2 &t) const + Vector_2 perpendicular(const Orientation &o) const; + Vector_2 transform(const Aff_transformation_2 &t) const { return t.transform(*this); } @@ -182,7 +182,7 @@ VectorC2::homogeneous(int i) const template < class R > CGAL_KERNEL_INLINE -VectorC2 +typename VectorC2::Vector_2 VectorC2::operator+(const VectorC2 &w) const { return VectorC2(x() + w.x(), y() + w.y()); @@ -190,7 +190,7 @@ VectorC2::operator+(const VectorC2 &w) const template < class R > CGAL_KERNEL_INLINE -VectorC2 +typename VectorC2::Vector_2 VectorC2::operator-(const VectorC2 &w) const { return VectorC2(x() - w.x(), y() - w.y()); @@ -198,7 +198,7 @@ VectorC2::operator-(const VectorC2 &w) const template < class R > CGAL_KERNEL_INLINE -VectorC2 +typename VectorC2::Vector_2 VectorC2::operator-() const { return VectorC2(-x(), -y()); @@ -222,7 +222,7 @@ VectorC2::squared_length() const template < class R > CGAL_KERNEL_INLINE -VectorC2 +typename VectorC2::Vector_2 VectorC2:: operator/(const typename VectorC2::FT &c) const { @@ -239,7 +239,7 @@ VectorC2::direction() const template < class R > CGAL_KERNEL_MEDIUM_INLINE -VectorC2 +typename VectorC2::Vector_2 VectorC2::perpendicular(const Orientation &o) const { CGAL_kernel_precondition( o != COLLINEAR ); diff --git a/Packages/Cartesian_kernel/include/CGAL/Cartesian/Vector_3.h b/Packages/Cartesian_kernel/include/CGAL/Cartesian/Vector_3.h index cf3f20b1cb4..753a35a4c0b 100644 --- a/Packages/Cartesian_kernel/include/CGAL/Cartesian/Vector_3.h +++ b/Packages/Cartesian_kernel/include/CGAL/Cartesian/Vector_3.h @@ -28,15 +28,15 @@ template < class R_ > class VectorC3 CGAL_ADVANCED_KERNEL_PARTIAL_SPEC : public R_::Vector_handle_3 { - typedef typename R_::FT FT; + typedef typename R_::FT FT; + typedef typename R_::Point_3 Point_3; + typedef typename R_::Vector_3 Vector_3; + typedef typename R_::Direction_3 Direction_3; + typedef typename R_::Aff_transformation_3 Aff_transformation_3; typedef typename R_::Vector_handle_3 base; typedef typename base::element_type rep; - typedef typename R_::Kernel_base::Point_3 Point_3; - typedef typename R_::Kernel_base::Direction_3 Direction_3; - typedef typename R_::Kernel_base::Aff_transformation_3 Aff_transformation_3; - public: typedef R_ R; @@ -111,14 +111,14 @@ public: return 3; } - VectorC3 operator+(const VectorC3 &w) const; - VectorC3 operator-(const VectorC3 &w) const; - VectorC3 operator-() const; - VectorC3 operator/(const FT &c) const; + Vector_3 operator+(const VectorC3 &w) const; + Vector_3 operator-(const VectorC3 &w) const; + Vector_3 operator-() const; + Vector_3 operator/(const FT &c) const; FT operator*(const VectorC3 &w) const; FT squared_length() const; Direction_3 direction() const; - VectorC3 transform(const Aff_transformation_3 &t) const + Vector_3 transform(const Aff_transformation_3 &t) const { return t.transform(*this); } @@ -192,7 +192,7 @@ VectorC3::homogeneous(int i) const template < class R > inline -VectorC3 +typename VectorC3::Vector_3 VectorC3:: operator+(const VectorC3 &w) const { @@ -201,7 +201,7 @@ operator+(const VectorC3 &w) const template < class R > inline -VectorC3 +typename VectorC3::Vector_3 VectorC3::operator-(const VectorC3 &w) const { return VectorC3(x() - w.x(), y() - w.y(), z() - w.z()); @@ -209,10 +209,10 @@ VectorC3::operator-(const VectorC3 &w) const template < class R > inline -VectorC3 +typename VectorC3::Vector_3 VectorC3::operator-() const { - return VectorC3(-x(), -y(), -z()); + return Vector_3(-x(), -y(), -z()); } template < class R > @@ -233,7 +233,7 @@ VectorC3::squared_length() const template < class R > inline -VectorC3 +typename VectorC3::Vector_3 VectorC3:: operator/(const typename VectorC3::FT &c) const { diff --git a/Packages/Cartesian_kernel/include/CGAL/Cartesian/global_operators_2.h b/Packages/Cartesian_kernel/include/CGAL/Cartesian/global_operators_2.h index b986cc30241..ae0e63e6387 100644 --- a/Packages/Cartesian_kernel/include/CGAL/Cartesian/global_operators_2.h +++ b/Packages/Cartesian_kernel/include/CGAL/Cartesian/global_operators_2.h @@ -26,23 +26,23 @@ CGAL_BEGIN_NAMESPACE template < class R > inline -PointC2 +typename R::Point_2 operator+(const PointC2 &p, const VectorC2 &v) -{ // FIXME : construction +{ return PointC2(p.x() + v.x(), p.y() + v.y()); } template < class R > inline -PointC2 +typename R::Point_2 operator-(const PointC2 &p, const VectorC2 &v) -{ // FIXME : construction +{ return PointC2(p.x() - v.x(), p.y() - v.y()); } template < class R > inline -PointC2 +typename R::Point_2 operator+(const Origin &, const VectorC2 &v) { return PointC2(v); @@ -50,23 +50,23 @@ operator+(const Origin &, const VectorC2 &v) template < class R > inline -PointC2 +typename R::Point_2 operator-(const Origin &, const VectorC2 &v) -{ // FIXME : construction +{ return PointC2(-v); } template < class R > inline -VectorC2 +typename R::Vector_2 operator-(const PointC2 &p, const PointC2 &q) -{ // FIXME : construction +{ return VectorC2(p.x() - q.x(), p.y() - q.y()); } template < class R > inline -VectorC2 +typename R::Vector_2 operator-(const PointC2 &p, const Origin &) { return VectorC2(p); @@ -74,32 +74,25 @@ operator-(const PointC2 &p, const Origin &) template < class R > inline -VectorC2 +typename R::Vector_2 operator-(const Origin &, const PointC2 &p) -{ // FIXME : construction +{ return VectorC2(-p.x(), -p.y()); } -#ifdef __SUNPRO_CC -template < class FT, class R > -CGAL_KERNEL_INLINE -VectorC2 -operator*(const FT &c, const VectorC2 &w) -#else template < class R > CGAL_KERNEL_INLINE -VectorC2 +typename R::Vector_2 operator*(const typename R::FT &c, const VectorC2 &w) -#endif -{ // FIXME : construction +{ return VectorC2(c * w.x(), c * w.y()); } template < class R > CGAL_KERNEL_INLINE -VectorC2 +typename R::Vector_2 operator*(const VectorC2 &w, const typename R::FT &c) -{ // FIXME : construction +{ return VectorC2(c * w.x(), c * w.y()); } diff --git a/Packages/Cartesian_kernel/include/CGAL/Cartesian/global_operators_3.h b/Packages/Cartesian_kernel/include/CGAL/Cartesian/global_operators_3.h index 3236a420279..6413b5e1a2a 100644 --- a/Packages/Cartesian_kernel/include/CGAL/Cartesian/global_operators_3.h +++ b/Packages/Cartesian_kernel/include/CGAL/Cartesian/global_operators_3.h @@ -26,23 +26,23 @@ CGAL_BEGIN_NAMESPACE template < class R > inline -PointC3 +typename R::Point_3 operator+(const PointC3 &p, const VectorC3 &v) -{ // FIXME : construction +{ return PointC3(p.x() + v.x(), p.y() + v.y(), p.z() + v.z()); } template < class R > inline -PointC3 +typename R::Point_3 operator-(const PointC3 &p, const VectorC3 &v) -{ // FIXME : construction +{ return PointC3(p.x() - v.x(), p.y() - v.y(), p.z() - v.z()); } template < class R > inline -PointC3 +typename R::Point_3 operator+(const Origin &, const VectorC3 &v) { return PointC3(v); @@ -50,7 +50,7 @@ operator+(const Origin &, const VectorC3 &v) template < class R > inline -PointC3 +typename R::Point_3 operator-(const Origin &, const VectorC3 &v) { return PointC3(-v); @@ -58,15 +58,15 @@ operator-(const Origin &, const VectorC3 &v) template < class R > inline -VectorC3 +typename R::Vector_3 operator-(const PointC3 &p, const PointC3 &q) -{ // FIXME : construction +{ return VectorC3(p.x() - q.x(), p.y() - q.y(), p.z() - q.z()); } template < class R > inline -VectorC3 +typename R::Vector_3 operator-(const PointC3 &p, const Origin &) { return VectorC3(p); @@ -74,32 +74,25 @@ operator-(const PointC3 &p, const Origin &) template < class R > inline -VectorC3 +typename R::Vector_3 operator-(const Origin &, const PointC3 &p) -{ // FIXME : construction +{ return VectorC3(-p.x(), -p.y(), -p.z()); } -#ifdef __SUNPRO_CC -template < class FT, class R > -CGAL_KERNEL_INLINE -VectorC3 -operator*(const FT &c, const VectorC3 &w) -#else template < class R > CGAL_KERNEL_INLINE -VectorC3 +typename R::Vector_3 operator*(const typename R::FT &c, const VectorC3 &w) -#endif -{ // FIXME : construction +{ return VectorC3(c * w.x(), c * w.y(), c * w.z()); } template < class R > CGAL_KERNEL_INLINE -VectorC3 +typename R::Vector_3 operator*(const VectorC3 &w, const typename R::FT &c) -{ // FIXME : construction +{ return VectorC3(c * w.x(), c * w.y(), c * w.z()); } diff --git a/Packages/Cartesian_kernel/include/CGAL/Cartesian/vector_constructions_3.h b/Packages/Cartesian_kernel/include/CGAL/Cartesian/vector_constructions_3.h index 0b09c638e9c..489fd8f876f 100644 --- a/Packages/Cartesian_kernel/include/CGAL/Cartesian/vector_constructions_3.h +++ b/Packages/Cartesian_kernel/include/CGAL/Cartesian/vector_constructions_3.h @@ -28,7 +28,7 @@ CGAL_BEGIN_NAMESPACE template < class R > -VectorC3 +typename VectorC3::Vector_3 cross_product(const VectorC3 &v, const VectorC3 &w) { diff --git a/Packages/Cartesian_kernel/include/CGAL/Simple_cartesian.h b/Packages/Cartesian_kernel/include/CGAL/Simple_cartesian.h index 80e7effb927..5b8927863a6 100644 --- a/Packages/Cartesian_kernel/include/CGAL/Simple_cartesian.h +++ b/Packages/Cartesian_kernel/include/CGAL/Simple_cartesian.h @@ -241,16 +241,13 @@ struct Simple_cartesian Direction_handle_2; typedef CGAL::Simple_Handle_for > Line_handle_2; - typedef CGAL::Simple_Handle_for > + typedef CGAL::Simple_Handle_for > Ray_handle_2; - typedef CGAL::Simple_Handle_for > + typedef CGAL::Simple_Handle_for > Segment_handle_2; - typedef CGAL::Simple_Handle_for > + typedef CGAL::Simple_Handle_for > Circle_handle_2; - typedef CGAL::Simple_Handle_for > + typedef CGAL::Simple_Handle_for > Triangle_handle_2; typedef CGAL::Simple_Handle_for > Iso_rectangle_handle_2; @@ -263,26 +260,21 @@ struct Simple_cartesian Vector_handle_3; typedef CGAL::Simple_Handle_for > Direction_handle_3; - typedef CGAL::Simple_Handle_for > + typedef CGAL::Simple_Handle_for > Line_handle_3; typedef CGAL::Simple_Handle_for > Plane_handle_3; - typedef CGAL::Simple_Handle_for > + typedef CGAL::Simple_Handle_for > Ray_handle_3; - typedef CGAL::Simple_Handle_for > + typedef CGAL::Simple_Handle_for > Segment_handle_3; - typedef CGAL::Simple_Handle_for > + typedef CGAL::Simple_Handle_for > Sphere_handle_3; - typedef CGAL::Simple_Handle_for > + typedef CGAL::Simple_Handle_for > Triangle_handle_3; - typedef CGAL::Simple_Handle_for > + typedef CGAL::Simple_Handle_for > Tetrahedron_handle_3; - typedef CGAL::Simple_Handle_for > + typedef CGAL::Simple_Handle_for > Iso_cuboid_handle_3; typedef CGAL::Handle_for_virtual< Aff_transformation_rep_baseC3 > Aff_transformation_handle_3; diff --git a/Packages/H2/changes.txt b/Packages/H2/changes.txt index db79acb0307..f77a8bdc076 100644 --- a/Packages/H2/changes.txt +++ b/Packages/H2/changes.txt @@ -1,3 +1,6 @@ +2.59 (22 January 2002) +- Classes and funtion return type only refer to R::... + 2.58 (9 January 2002) - just resubmit... diff --git a/Packages/H2/include/CGAL/Homogeneous/Aff_transformationH2.h b/Packages/H2/include/CGAL/Homogeneous/Aff_transformationH2.h index eb659a69c23..3334735ede6 100644 --- a/Packages/H2/include/CGAL/Homogeneous/Aff_transformationH2.h +++ b/Packages/H2/include/CGAL/Homogeneous/Aff_transformationH2.h @@ -45,9 +45,9 @@ class Aff_transformation_rep_baseH2 : public Ref_counted_virtual public: typedef typename R::RT RT; typedef typename R::FT FT; - typedef typename R::Kernel_base::Point_2 Point_2; - typedef typename R::Kernel_base::Vector_2 Vector_2; - typedef typename R::Kernel_base::Direction_2 Direction_2; + typedef typename R::Point_2 Point_2; + typedef typename R::Vector_2 Vector_2; + typedef typename R::Direction_2 Direction_2; virtual ~Aff_transformation_rep_baseH2(){} @@ -73,9 +73,9 @@ class Aff_transformation_repH2 : public Aff_transformation_rep_baseH2 public: typedef typename R::RT RT; typedef typename R::FT FT; - typedef typename R::Kernel_base::Point_2 Point_2; - typedef typename R::Kernel_base::Vector_2 Vector_2; - typedef typename R::Kernel_base::Direction_2 Direction_2; + typedef typename R::Point_2 Point_2; + typedef typename R::Vector_2 Vector_2; + typedef typename R::Direction_2 Direction_2; Aff_transformation_repH2() {} @@ -109,20 +109,12 @@ class Aff_transformation_repH2 : public Aff_transformation_rep_baseH2 virtual Direction_2 transform(const Direction_2& dir) const { - const RT RT0(0); - if ( g > RT0 ) - { + if ( g > RT(0) ) return Direction_2( a * dir.x() + b * dir.y(), d * dir.x() + e * dir.y() ); - } - else if ( g < RT0 ) - { + else return - Direction_2(a * dir.x() + b * dir.y(), d * dir.x() + e * dir.y() ); - } - return Direction_2( a * dir.x() + b * dir.y(), - d * dir.x() + e * dir.y(), - g ); } virtual Aff_transformationH2 @@ -173,9 +165,9 @@ class Identity_repH2 : public Aff_transformation_rep_baseH2 public: typedef typename R::RT RT; typedef typename R::FT FT; - typedef typename R::Kernel_base::Point_2 Point_2; - typedef typename R::Kernel_base::Vector_2 Vector_2; - typedef typename R::Kernel_base::Direction_2 Direction_2; + typedef typename R::Point_2 Point_2; + typedef typename R::Vector_2 Vector_2; + typedef typename R::Direction_2 Direction_2; Identity_repH2() {} @@ -228,9 +220,9 @@ class Translation_repH2 : public Aff_transformation_rep_baseH2 public: typedef typename R::RT RT; typedef typename R::FT FT; - typedef typename R::Kernel_base::Point_2 Point_2; - typedef typename R::Kernel_base::Vector_2 Vector_2; - typedef typename R::Kernel_base::Direction_2 Direction_2; + typedef typename R::Point_2 Point_2; + typedef typename R::Vector_2 Vector_2; + typedef typename R::Direction_2 Direction_2; Translation_repH2() {} @@ -283,9 +275,9 @@ class Rotation_repH2 : public Aff_transformation_rep_baseH2 public: typedef typename R::RT RT; typedef typename R::FT FT; - typedef typename R::Kernel_base::Point_2 Point_2; - typedef typename R::Kernel_base::Vector_2 Vector_2; - typedef typename R::Kernel_base::Direction_2 Direction_2; + typedef typename R::Point_2 Point_2; + typedef typename R::Vector_2 Vector_2; + typedef typename R::Direction_2 Direction_2; Rotation_repH2() { @@ -359,9 +351,9 @@ class Scaling_repH2 : public Aff_transformation_rep_baseH2 public: typedef typename R::RT RT; typedef typename R::FT FT; - typedef typename R::Kernel_base::Point_2 Point_2; - typedef typename R::Kernel_base::Vector_2 Vector_2; - typedef typename R::Kernel_base::Direction_2 Direction_2; + typedef typename R::Point_2 Point_2; + typedef typename R::Vector_2 Vector_2; + typedef typename R::Direction_2 Direction_2; Scaling_repH2() {} @@ -430,10 +422,10 @@ class Reflection_repH2 : public Aff_transformation_rep_baseH2 public: typedef typename R::RT RT; typedef typename R::FT FT; - typedef typename R::Kernel_base::Point_2 Point_2; - typedef typename R::Kernel_base::Vector_2 Vector_2; - typedef typename R::Kernel_base::Direction_2 Direction_2; - typedef typename R::Kernel_base::Line_2 Line_2; + typedef typename R::Point_2 Point_2; + typedef typename R::Vector_2 Vector_2; + typedef typename R::Direction_2 Direction_2; + typedef typename R::Line_2 Line_2; Reflection_repH2(const Line_2& l_) : l(l_) {} @@ -506,10 +498,10 @@ class Aff_transformationH2 { typedef typename R_::FT FT; typedef typename R_::RT RT; - typedef typename R_::Kernel_base::Point_2 Point_2; - typedef typename R_::Kernel_base::Vector_2 Vector_2; - typedef typename R_::Kernel_base::Direction_2 Direction_2; - typedef typename R_::Kernel_base::Line_2 Line_2; + typedef typename R_::Point_2 Point_2; + typedef typename R_::Vector_2 Vector_2; + typedef typename R_::Direction_2 Direction_2; + typedef typename R_::Line_2 Line_2; public: typedef R_ R; diff --git a/Packages/H2/include/CGAL/Homogeneous/CircleH2.h b/Packages/H2/include/CGAL/Homogeneous/CircleH2.h index 1b3d4947b1f..eb1ff3f2b3c 100644 --- a/Packages/H2/include/CGAL/Homogeneous/CircleH2.h +++ b/Packages/H2/include/CGAL/Homogeneous/CircleH2.h @@ -31,12 +31,10 @@ template class CircleH2 : public R_::Circle_handle_2 { - typedef typename R_::FT FT; - typedef typename R_::RT RT; - typedef typename R_::Kernel_base::Point_2 Point_2; - typedef typename R_::Kernel_base::Vector_2 Vector_2; - typedef typename R_::Kernel_base::Aff_transformation_2 - Aff_transformation_2; + typedef typename R_::FT FT; + typedef typename R_::RT RT; + typedef typename R_::Point_2 Point_2; + typedef typename R_::Aff_transformation_2 Aff_transformation_2; typedef typename R_::Circle_handle_2 Circle_handle_2_; typedef typename Circle_handle_2_::element_type Circle_ref_2; @@ -290,7 +288,7 @@ CircleH2 CircleH2:: orthogonal_transform(const typename CircleH2::Aff_transformation_2& t) const { - Vector_2 vec( RT(1), RT(0) ); // unit vector + typename R::Vector_2 vec( RT(1), RT(0) ); // unit vector vec = vec.transform(t); // transformed FT sq_scale = FT( vec*vec ); // squared scaling factor diff --git a/Packages/H2/include/CGAL/Homogeneous/Data_accessorH2.h b/Packages/H2/include/CGAL/Homogeneous/Data_accessorH2.h index 03ab47b69ea..4dc299f2ab8 100644 --- a/Packages/H2/include/CGAL/Homogeneous/Data_accessorH2.h +++ b/Packages/H2/include/CGAL/Homogeneous/Data_accessorH2.h @@ -32,7 +32,7 @@ class Data_accessorH2 public: typedef typename R::FT FT; typedef typename R::RT RT; - typedef typename R::Kernel_base::Point_2 Point_2; + typedef typename R::Point_2 Point_2; RT get_hx( const Point_2 & p) const { return( p.hx()); } RT get_hy( const Point_2 & p) const { return( p.hy()); } diff --git a/Packages/H2/include/CGAL/Homogeneous/DirectionH2.h b/Packages/H2/include/CGAL/Homogeneous/DirectionH2.h index 1921775264b..016fc36b50d 100644 --- a/Packages/H2/include/CGAL/Homogeneous/DirectionH2.h +++ b/Packages/H2/include/CGAL/Homogeneous/DirectionH2.h @@ -29,14 +29,14 @@ template < class R_ > class DirectionH2 : public R_::Direction_handle_2 { - typedef typename R_::FT FT; - typedef typename R_::RT RT; - typedef typename R_::Kernel_base::Point_2 Point_2; - typedef typename R_::Kernel_base::Vector_2 Vector_2; - typedef typename R_::Kernel_base::Line_2 Line_2; - typedef typename R_::Kernel_base::Ray_2 Ray_2; - typedef typename R_::Kernel_base::Segment_2 Segment_2; - typedef typename R_::Kernel_base::Aff_transformation_2 Aff_transformation_2; + typedef typename R_::FT FT; + typedef typename R_::RT RT; + typedef typename R_::Point_2 Point_2; + typedef typename R_::Vector_2 Vector_2; + typedef typename R_::Line_2 Line_2; + typedef typename R_::Ray_2 Ray_2; + typedef typename R_::Segment_2 Segment_2; + typedef typename R_::Aff_transformation_2 Aff_transformation_2; typedef typename R_::Direction_handle_2 Direction_handle_2_; typedef typename Direction_handle_2_::element_type Direction_ref_2; @@ -68,6 +68,8 @@ public: DirectionH2(const RT& x, const RT& y) : Direction_handle_2_ ( Direction_ref_2( x, y, RT(1) )) {} + // TODO Not documented : should not exist , not used. + // we should also change Threetuple -> Twotuple DirectionH2(const RT& x, const RT& y, const RT& w ) { if (w > RT(0) ) @@ -88,6 +90,7 @@ public: DirectionH2 operator-() const; Vector_2 to_vector() const; + Vector_2 vector() const { return to_vector(); } const RT & x() const { return Ptr()->e0; }; const RT & y() const { return Ptr()->e1; }; @@ -215,7 +218,7 @@ template CGAL_KERNEL_INLINE typename DirectionH2::Vector_2 DirectionH2::to_vector() const -{ return Vector_2(*this); } +{ return Vector_2(dx(), dy(), typename R::RT(1)); } #ifndef CGAL_NO_OSTREAM_INSERT_DIRECTIONH2 diff --git a/Packages/H2/include/CGAL/Homogeneous/Iso_rectangleH2.h b/Packages/H2/include/CGAL/Homogeneous/Iso_rectangleH2.h index a3d4afd7b8c..314678dc884 100644 --- a/Packages/H2/include/CGAL/Homogeneous/Iso_rectangleH2.h +++ b/Packages/H2/include/CGAL/Homogeneous/Iso_rectangleH2.h @@ -29,10 +29,10 @@ template class Iso_rectangleH2 : public R_::Iso_rectangle_handle_2 { - typedef typename R_::FT FT; - typedef typename R_::RT RT; - typedef typename R_::Point_2 Point_2; - typedef typename R_::Kernel_base::Aff_transformation_2 Aff_transformation_2; + typedef typename R_::FT FT; + typedef typename R_::RT RT; + typedef typename R_::Point_2 Point_2; + typedef typename R_::Aff_transformation_2 Aff_transformation_2; typedef typename R_::Iso_rectangle_handle_2 Iso_rectangle_handle_2_; typedef typename Iso_rectangle_handle_2_::element_type Iso_rectangle_ref_2; diff --git a/Packages/H2/include/CGAL/Homogeneous/LineH2.h b/Packages/H2/include/CGAL/Homogeneous/LineH2.h index 8c7c6053c63..16c830e0c8c 100644 --- a/Packages/H2/include/CGAL/Homogeneous/LineH2.h +++ b/Packages/H2/include/CGAL/Homogeneous/LineH2.h @@ -30,15 +30,14 @@ template < class R_ > class LineH2 : public R_::Line_handle_2 { - typedef typename R_::FT FT; - typedef typename R_::RT RT; - typedef typename R_::Kernel_base::Point_2 Point_2; - typedef typename R_::Kernel_base::Vector_2 Vector_2; - typedef typename R_::Kernel_base::Direction_2 Direction_2; - typedef typename R_::Kernel_base::Segment_2 Segment_2; - typedef typename R_::Kernel_base::Ray_2 Ray_2; - typedef typename R_::Kernel_base::Aff_transformation_2 - Aff_transformation_2; + typedef typename R_::FT FT; + typedef typename R_::RT RT; + typedef typename R_::Point_2 Point_2; + typedef typename R_::Vector_2 Vector_2; + typedef typename R_::Direction_2 Direction_2; + typedef typename R_::Segment_2 Segment_2; + typedef typename R_::Ray_2 Ray_2; + typedef typename R_::Aff_transformation_2 Aff_transformation_2; typedef typename R_::Line_handle_2 Line_handle_2_; typedef typename Line_handle_2_::element_type Line_ref_2; @@ -141,7 +140,7 @@ CGAL_KERNEL_INLINE LineH2::LineH2(const typename LineH2::Point_2& p, const typename LineH2::Direction_2& d) { - Point_2 q = p + Vector_2(d); + Point_2 q = p + d.to_vector(); initialize_with( Line_ref_2 ( p.hy()*q.hw() - p.hw()*q.hy(), p.hw()*q.hx() - p.hx()*q.hw(), diff --git a/Packages/H2/include/CGAL/Homogeneous/PointH2.h b/Packages/H2/include/CGAL/Homogeneous/PointH2.h index 6a370f67921..1aa67fa156f 100644 --- a/Packages/H2/include/CGAL/Homogeneous/PointH2.h +++ b/Packages/H2/include/CGAL/Homogeneous/PointH2.h @@ -32,11 +32,11 @@ template < class R_ > class PointH2 : public R_::Point_handle_2 { - typedef typename R_::FT FT; - typedef typename R_::RT RT; - typedef typename R_::Kernel_base::Vector_2 Vector_2; - typedef typename R_::Kernel_base::Direction_2 Direction_2; - typedef typename R_::Kernel_base::Aff_transformation_2 Aff_transformation_2; + typedef typename R_::FT FT; + typedef typename R_::RT RT; + typedef typename R_::Vector_2 Vector_2; + typedef typename R_::Direction_2 Direction_2; + typedef typename R_::Aff_transformation_2 Aff_transformation_2; typedef typename R_::Point_handle_2 Point_handle_2_; typedef typename Point_handle_2_::element_type Point_ref_2; diff --git a/Packages/H2/include/CGAL/Homogeneous/RayH2.h b/Packages/H2/include/CGAL/Homogeneous/RayH2.h index bb1d74aa833..1e272e6e9a1 100644 --- a/Packages/H2/include/CGAL/Homogeneous/RayH2.h +++ b/Packages/H2/include/CGAL/Homogeneous/RayH2.h @@ -30,14 +30,13 @@ template < class R_ > class RayH2 : public R_::Ray_handle_2 { - typedef typename R_::FT FT; - typedef typename R_::RT RT; - typedef typename R_::Kernel_base::Point_2 Point_2; - typedef typename R_::Kernel_base::Direction_2 Direction_2; - typedef typename R_::Kernel_base::Line_2 Line_2; - typedef typename R_::Kernel_base::Vector_2 Vector_2; - typedef typename R_::Kernel_base::Aff_transformation_2 - Aff_transformation_2; + typedef typename R_::FT FT; + typedef typename R_::RT RT; + typedef typename R_::Point_2 Point_2; + typedef typename R_::Direction_2 Direction_2; + typedef typename R_::Line_2 Line_2; + typedef typename R_::Vector_2 Vector_2; + typedef typename R_::Aff_transformation_2 Aff_transformation_2; typedef typename R_::Ray_handle_2 Ray_handle_2_; typedef typename Ray_handle_2_::element_type Ray_ref_2; diff --git a/Packages/H2/include/CGAL/Homogeneous/SegmentH2.h b/Packages/H2/include/CGAL/Homogeneous/SegmentH2.h index 7077d93fcdf..696f18dff55 100644 --- a/Packages/H2/include/CGAL/Homogeneous/SegmentH2.h +++ b/Packages/H2/include/CGAL/Homogeneous/SegmentH2.h @@ -31,12 +31,12 @@ template < class R_ > class SegmentH2 : public R_::Segment_handle_2 { - typedef typename R_::FT FT; - typedef typename R_::RT RT; - typedef typename R_::Kernel_base::Point_2 Point_2; - typedef typename R_::Kernel_base::Line_2 Line_2; - typedef typename R_::Kernel_base::Direction_2 Direction_2; - typedef typename R_::Kernel_base::Aff_transformation_2 Aff_transformation_2; + typedef typename R_::FT FT; + typedef typename R_::RT RT; + typedef typename R_::Point_2 Point_2; + typedef typename R_::Line_2 Line_2; + typedef typename R_::Direction_2 Direction_2; + typedef typename R_::Aff_transformation_2 Aff_transformation_2; typedef typename R_::Segment_handle_2 Segment_handle_2_; typedef typename Segment_handle_2_::element_type Segment_ref_2; diff --git a/Packages/H2/include/CGAL/Homogeneous/TriangleH2.h b/Packages/H2/include/CGAL/Homogeneous/TriangleH2.h index 93991982efc..9368f631dbb 100644 --- a/Packages/H2/include/CGAL/Homogeneous/TriangleH2.h +++ b/Packages/H2/include/CGAL/Homogeneous/TriangleH2.h @@ -30,12 +30,11 @@ template class TriangleH2 : public R_::Triangle_handle_2 { - typedef typename R_::FT FT; - typedef typename R_::RT RT; - typedef typename R_::Kernel_base::Point_2 Point_2; - typedef typename R_::Kernel_base::Vector_2 Vector_2; - typedef typename R_::Kernel_base::Aff_transformation_2 - Aff_transformation_2; + typedef typename R_::FT FT; + typedef typename R_::RT RT; + typedef typename R_::Point_2 Point_2; + typedef typename R_::Vector_2 Vector_2; + typedef typename R_::Aff_transformation_2 Aff_transformation_2; typedef typename R_::Triangle_handle_2 Triangle_handle_2_; typedef typename Triangle_handle_2_::element_type Triangle_ref_2; diff --git a/Packages/H2/include/CGAL/Homogeneous/VectorH2.h b/Packages/H2/include/CGAL/Homogeneous/VectorH2.h index 92c1cd44d1c..7e3d0981f25 100644 --- a/Packages/H2/include/CGAL/Homogeneous/VectorH2.h +++ b/Packages/H2/include/CGAL/Homogeneous/VectorH2.h @@ -32,11 +32,12 @@ template < class R_ > class VectorH2 : public R_::Vector_handle_2 { - typedef typename R_::FT FT; - typedef typename R_::RT RT; - typedef typename R_::Kernel_base::Point_2 Point_2; - typedef typename R_::Kernel_base::Direction_2 Direction_2; - typedef typename R_::Kernel_base::Aff_transformation_2 Aff_transformation_2; + typedef typename R_::FT FT; + typedef typename R_::RT RT; + typedef typename R_::Point_2 Point_2; + typedef typename R_::Direction_2 Direction_2; + typedef typename R_::Vector_2 Vector_2; + typedef typename R_::Aff_transformation_2 Aff_transformation_2; typedef typename R_::Vector_handle_2 Vector_handle_2_; typedef typename Vector_handle_2_::element_type Vector_ref_2; @@ -47,9 +48,6 @@ public: VectorH2() : Vector_handle_2_ ( Vector_ref_2()) {} - VectorH2(const VectorH2& v) - : Vector_handle_2_ (v) {} - VectorH2(const Point_2& a, const Point_2& b) : Vector_handle_2_ (b-a) {} @@ -85,18 +83,17 @@ public: int dimension() const; Direction_2 direction() const; - VectorH2 transform(const Aff_transformation_2& t ) const; - VectorH2 perpendicular(const Orientation& o ) const; + Vector_2 transform(const Aff_transformation_2& t ) const; + Vector_2 perpendicular(const Orientation& o ) const; FT operator*( const VectorH2& v) const; - VectorH2 operator-() const; - VectorH2 opposite() const; + Vector_2 operator-() const; + Vector_2 opposite() const; // undocumented: VectorH2(const Direction_2 & dir) : Vector_handle_2_ ( dir) {} -protected: VectorH2(const Point_2 & p) : Vector_handle_2_ ( p) {} }; @@ -176,19 +173,19 @@ VectorH2::direction() const template < class R > inline -VectorH2 +typename VectorH2::Vector_2 VectorH2::operator-() const { return VectorH2(- hx(), - hy(), hw() ); } template < class R > inline -VectorH2 +typename VectorH2::Vector_2 VectorH2::opposite() const { return VectorH2(- hx(), - hy(), hw() ); } template CGAL_KERNEL_INLINE -VectorH2 +typename VectorH2::Vector_2 operator+(const VectorH2& u, const VectorH2& v) { return VectorH2( u.hx()*v.hw() + v.hx()*u.hw(), @@ -198,7 +195,7 @@ operator+(const VectorH2& u, const VectorH2& v) template CGAL_KERNEL_INLINE -VectorH2 +typename VectorH2::Vector_2 operator-(const VectorH2& u, const VectorH2& v) { return VectorH2( u.hx()*v.hw() - v.hx()*u.hw(), @@ -218,27 +215,34 @@ VectorH2::operator*(const VectorH2& v) const template CGAL_KERNEL_INLINE -VectorH2 +typename R::Vector_2 operator/(const VectorH2& v, const typename R::RT& f) { return VectorH2( v.hx(), v.hy(), v.hw()*f ); } template CGAL_KERNEL_INLINE -VectorH2 +typename VectorH2::Vector_2 +operator/(const VectorH2& v, const typename R::FT& f) +{ return VectorH2( v.hx()*f.denominator(), v.hy()*f.denominator(), + v.hw()*f.numerator() ); } + +template +CGAL_KERNEL_INLINE +typename R::Vector_2 operator*(const VectorH2& v, const typename R::RT& f) { return VectorH2( v.hx()*f, v.hy()*f, v.hw() ); } -#ifdef __SUNPRO_CC -template -CGAL_KERNEL_INLINE -VectorH2 -operator*(const RT& f, const VectorH2& v) -#else template CGAL_KERNEL_INLINE -VectorH2 +typename VectorH2::Vector_2 +operator*(const VectorH2& v, const typename R::FT& f) +{ return VectorH2( v.hx()*f.numerator(), v.hy()*f.numerator(), + v.hw()*f.denominator() ); } + +template +CGAL_KERNEL_INLINE +typename VectorH2::Vector_2 operator*(const typename R::RT& f, const VectorH2& v) -#endif { return VectorH2( v.hx()*f, v.hy()*f, v.hw() ); } template @@ -249,50 +253,49 @@ origin_plus_vector(const VectorH2& v) template inline -PointH2 +typename R::Point_2 operator+(const Origin&, const VectorH2& v) { return origin_plus_vector( v ); } template inline -PointH2 +typename R::Point_2 origin_minus_vector(const VectorH2& v) { return PointH2( v.opposite() ); } template inline -PointH2 +typename R::Point_2 operator-(const Origin&, const VectorH2& v) { return origin_minus_vector( v ); } template inline -VectorH2 +typename VectorH2::Vector_2 point_minus_origin(const PointH2& p) { return VectorH2( p ); } template inline -VectorH2 +typename VectorH2::Vector_2 operator-(const PointH2& p, const Origin&) { return point_minus_origin( p ); } template inline -VectorH2 +typename VectorH2::Vector_2 origin_minus_point(const PointH2& p) { return VectorH2( p ).opposite(); } template inline -VectorH2 +typename VectorH2::Vector_2 operator-(const Origin&, const PointH2& p) { return origin_minus_point( p ); } - template CGAL_KERNEL_INLINE -PointH2 +typename R::Point_2 operator+(const PointH2& p, const VectorH2& v) { return PointH2( p.hx()*v.hw() + v.hx()*p.hw(), @@ -302,7 +305,7 @@ operator+(const PointH2& p, const VectorH2& v) template CGAL_KERNEL_INLINE -PointH2 +typename R::Point_2 operator-(const PointH2& p, const VectorH2& v) { return PointH2( p.hx()*v.hw() - v.hx()*p.hw(), @@ -312,7 +315,7 @@ operator-(const PointH2& p, const VectorH2& v) template CGAL_KERNEL_INLINE -VectorH2 +typename VectorH2::Vector_2 operator-(const PointH2& p, const PointH2& q) { return VectorH2( p.hx()*q.hw() - q.hx()*p.hw(), @@ -326,7 +329,7 @@ operator-(const PointH2& p, const PointH2& q) template < class R > CGAL_KERNEL_INLINE -VectorH2 +typename VectorH2::Vector_2 VectorH2::perpendicular(const Orientation& o) const { CGAL_kernel_precondition(o != COLLINEAR); @@ -342,7 +345,7 @@ VectorH2::perpendicular(const Orientation& o) const template < class R > inline -VectorH2 +typename VectorH2::Vector_2 VectorH2:: transform(const typename VectorH2::Aff_transformation_2& t) const { return t.transform(*this); } diff --git a/Packages/H2/include/CGAL/Homogeneous/homogeneous_rep.h b/Packages/H2/include/CGAL/Homogeneous/homogeneous_rep.h index 6fb6f4db0fa..855aacde0ac 100644 --- a/Packages/H2/include/CGAL/Homogeneous/homogeneous_rep.h +++ b/Packages/H2/include/CGAL/Homogeneous/homogeneous_rep.h @@ -157,14 +157,14 @@ class Homogeneous typedef CGAL::Handle_for< Threetuple > Point_handle_2; typedef CGAL::Handle_for< Threetuple > Vector_handle_2; typedef CGAL::Handle_for< Threetuple > Direction_handle_2; - typedef CGAL::Handle_for< Twotuple > Ray_handle_2; - typedef CGAL::Handle_for< Threetuple > Triangle_handle_2; - typedef CGAL::Handle_for< triple > + typedef CGAL::Handle_for< Twotuple > Ray_handle_2; + typedef CGAL::Handle_for< Threetuple > Triangle_handle_2; + typedef CGAL::Handle_for< triple > Circle_handle_2; typedef CGAL::Handle_for< Twotuple > Iso_rectangle_handle_2; typedef CGAL::Handle_for< Threetuple > Line_handle_2; - typedef CGAL::Handle_for< Twotuple > Segment_handle_2; + typedef CGAL::Handle_for< Twotuple > Segment_handle_2; typedef CGAL::Handle_for_virtual< Aff_transformation_rep_baseH2 > Aff_transformation_handle_2; @@ -172,16 +172,14 @@ class Homogeneous typedef CGAL::Handle_for< Fourtuple > Vector_handle_3; typedef CGAL::Handle_for< Fourtuple > Direction_handle_3; typedef CGAL::Handle_for< Fourtuple > Plane_handle_3; - typedef CGAL::Handle_for< std::pair > - Ray_handle_3; - typedef CGAL::Handle_for< std::pair > - Line_handle_3; - typedef CGAL::Handle_for< triple > + typedef CGAL::Handle_for< std::pair > Ray_handle_3; + typedef CGAL::Handle_for< std::pair > Line_handle_3; + typedef CGAL::Handle_for< triple > Sphere_handle_3; - typedef CGAL::Handle_for< Fourtuple > Tetrahedron_handle_3; - typedef CGAL::Handle_for< Twotuple > Segment_handle_3; - typedef CGAL::Handle_for< Threetuple > Triangle_handle_3; - typedef CGAL::Handle_for< Twotuple > Iso_cuboid_handle_3; + typedef CGAL::Handle_for< Fourtuple > Tetrahedron_handle_3; + typedef CGAL::Handle_for< Twotuple > Segment_handle_3; + typedef CGAL::Handle_for< Threetuple > Triangle_handle_3; + typedef CGAL::Handle_for< Twotuple > Iso_cuboid_handle_3; typedef CGAL::Handle_for_virtual< Aff_transformation_rep_baseH3 > Aff_transformation_handle_3; diff --git a/Packages/H2/include/CGAL/Homogeneous/simple_homogeneous_rep.h b/Packages/H2/include/CGAL/Homogeneous/simple_homogeneous_rep.h index 748a7c74ffc..be94552fb6e 100644 --- a/Packages/H2/include/CGAL/Homogeneous/simple_homogeneous_rep.h +++ b/Packages/H2/include/CGAL/Homogeneous/simple_homogeneous_rep.h @@ -157,15 +157,14 @@ class Simple_homogeneous typedef CGAL::Simple_Handle_for< Threetuple > Point_handle_2; typedef CGAL::Simple_Handle_for< Threetuple > Vector_handle_2; typedef CGAL::Simple_Handle_for< Threetuple > Direction_handle_2; - typedef CGAL::Simple_Handle_for< Twotuple > Ray_handle_2; - typedef CGAL::Simple_Handle_for< Threetuple > - Triangle_handle_2; - typedef CGAL::Simple_Handle_for< triple > + typedef CGAL::Simple_Handle_for< Twotuple > Ray_handle_2; + typedef CGAL::Simple_Handle_for< Threetuple > Triangle_handle_2; + typedef CGAL::Simple_Handle_for< triple > Circle_handle_2; typedef CGAL::Simple_Handle_for< Twotuple > Iso_rectangle_handle_2; typedef CGAL::Simple_Handle_for< Threetuple > Line_handle_2; - typedef CGAL::Simple_Handle_for< Twotuple > Segment_handle_2; + typedef CGAL::Simple_Handle_for< Twotuple > Segment_handle_2; typedef CGAL::Handle_for_virtual< Aff_transformation_rep_baseH2 > Aff_transformation_handle_2; @@ -173,19 +172,16 @@ class Simple_homogeneous typedef CGAL::Simple_Handle_for< Fourtuple > Vector_handle_3; typedef CGAL::Simple_Handle_for< Fourtuple > Direction_handle_3; typedef CGAL::Simple_Handle_for< Fourtuple > Plane_handle_3; - typedef CGAL::Simple_Handle_for > + typedef CGAL::Simple_Handle_for > Ray_handle_3; - typedef CGAL::Simple_Handle_for > + typedef CGAL::Simple_Handle_for > Line_handle_3; - typedef CGAL::Simple_Handle_for< triple > + typedef CGAL::Simple_Handle_for< triple > Sphere_handle_3; - typedef CGAL::Simple_Handle_for< Fourtuple > - Tetrahedron_handle_3; - typedef CGAL::Simple_Handle_for< Twotuple > Segment_handle_3; - typedef CGAL::Simple_Handle_for< Threetuple > - Triangle_handle_3; - typedef CGAL::Simple_Handle_for< Twotuple > - Iso_cuboid_handle_3; + typedef CGAL::Simple_Handle_for< Fourtuple > Tetrahedron_handle_3; + typedef CGAL::Simple_Handle_for< Twotuple > Segment_handle_3; + typedef CGAL::Simple_Handle_for< Threetuple > Triangle_handle_3; + typedef CGAL::Simple_Handle_for< Twotuple > Iso_cuboid_handle_3; typedef CGAL::Handle_for_virtual< Aff_transformation_rep_baseH3 > Aff_transformation_handle_3; diff --git a/Packages/H3/changes.txt b/Packages/H3/changes.txt index 0870d43c30b..cb96c92d9a3 100644 --- a/Packages/H3/changes.txt +++ b/Packages/H3/changes.txt @@ -1,3 +1,6 @@ +2.44 (22 January 2002) +- Classes and funtion return type only refer to R::... + 2.43 (4 January 2002) - Replace the small helper *rep classes by std::pair and triple. - Tetrahedron_3.orientation() is not cached anymore. diff --git a/Packages/H3/include/CGAL/Homogeneous/Aff_transformationH3.h b/Packages/H3/include/CGAL/Homogeneous/Aff_transformationH3.h index 242938c0ea5..610224b54da 100644 --- a/Packages/H3/include/CGAL/Homogeneous/Aff_transformationH3.h +++ b/Packages/H3/include/CGAL/Homogeneous/Aff_transformationH3.h @@ -48,11 +48,11 @@ public: typedef R_ R; typedef typename R::FT FT; typedef typename R::RT RT; - typedef typename R::Kernel_base::Point_3 Point_3; - typedef typename R::Kernel_base::Vector_3 Vector_3; - typedef typename R::Kernel_base::Direction_3 Direction_3; - typedef typename R::Kernel_base::Plane_3 Plane_3; - typedef typename R::Kernel_base::Aff_transformation_3 Aff_transformation_3; + typedef typename R::Point_3 Point_3; + typedef typename R::Vector_3 Vector_3; + typedef typename R::Direction_3 Direction_3; + typedef typename R::Plane_3 Plane_3; + typedef typename R::Aff_transformation_3 Aff_transformation_3; virtual ~Aff_transformation_rep_baseH3(){} @@ -68,10 +68,10 @@ public: virtual Plane_3 transform(const Plane_3&) const = 0; - virtual Aff_transformationH3 + virtual Aff_transformation_3 inverse() const = 0; - virtual Aff_transformationH3 + virtual Aff_transformation_3 transpose() const = 0; virtual Aff_transformation_repH3 @@ -92,11 +92,11 @@ class Aff_transformation_repH3 : public Aff_transformation_rep_baseH3 { typedef typename R_::FT FT; typedef typename R_::RT RT; - typedef typename R_::Kernel_base::Point_3 Point_3; - typedef typename R_::Kernel_base::Vector_3 Vector_3; - typedef typename R_::Kernel_base::Direction_3 Direction_3; - typedef typename R_::Kernel_base::Plane_3 Plane_3; - typedef typename R_::Kernel_base::Aff_transformation_3 Aff_transformation_3; + typedef typename R_::Point_3 Point_3; + typedef typename R_::Vector_3 Vector_3; + typedef typename R_::Direction_3 Direction_3; + typedef typename R_::Plane_3 Plane_3; + typedef typename R_::Aff_transformation_3 Aff_transformation_3; public: typedef R_ R; @@ -165,11 +165,11 @@ class Identity_repH3 : public Aff_transformation_rep_baseH3 { typedef typename R_::RT RT; typedef typename R_::FT FT; - typedef typename R_::Kernel_base::Point_3 Point_3; - typedef typename R_::Kernel_base::Vector_3 Vector_3; - typedef typename R_::Kernel_base::Direction_3 Direction_3; - typedef typename R_::Kernel_base::Plane_3 Plane_3; - typedef typename R_::Kernel_base::Aff_transformation_3 Aff_transformation_3; + typedef typename R_::Point_3 Point_3; + typedef typename R_::Vector_3 Vector_3; + typedef typename R_::Direction_3 Direction_3; + typedef typename R_::Plane_3 Plane_3; + typedef typename R_::Aff_transformation_3 Aff_transformation_3; public: typedef R_ R; @@ -225,11 +225,11 @@ class Translation_repH3 : public Aff_transformation_rep_baseH3 { typedef typename R_::FT FT; typedef typename R_::RT RT; - typedef typename R_::Kernel_base::Point_3 Point_3; - typedef typename R_::Kernel_base::Vector_3 Vector_3; - typedef typename R_::Kernel_base::Direction_3 Direction_3; - typedef typename R_::Kernel_base::Plane_3 Plane_3; - typedef typename R_::Kernel_base::Aff_transformation_3 Aff_transformation_3; + typedef typename R_::Point_3 Point_3; + typedef typename R_::Vector_3 Vector_3; + typedef typename R_::Direction_3 Direction_3; + typedef typename R_::Plane_3 Plane_3; + typedef typename R_::Aff_transformation_3 Aff_transformation_3; public: typedef R_ R; @@ -278,12 +278,13 @@ private: template < class R_ > class Aff_transformationH3 : public R_::Aff_transformation_handle_3 { - typedef typename R_::RT RT; - typedef typename R_::FT FT; - typedef typename R_::Kernel_base::Point_3 Point_3; - typedef typename R_::Kernel_base::Vector_3 Vector_3; - typedef typename R_::Kernel_base::Direction_3 Direction_3; - typedef typename R_::Kernel_base::Plane_3 Plane_3; + typedef typename R_::RT RT; + typedef typename R_::FT FT; + typedef typename R_::Point_3 Point_3; + typedef typename R_::Vector_3 Vector_3; + typedef typename R_::Direction_3 Direction_3; + typedef typename R_::Plane_3 Plane_3; + typedef typename R_::Aff_transformation_3 Aff_transformation_3; public: typedef R_ R; @@ -323,7 +324,7 @@ public: Plane_3 transform(const Plane_3& pl) const; - Aff_transformationH3 + Aff_transformation_3 inverse() const; Aff_transformationH3 @@ -399,17 +400,14 @@ typename Aff_transformation_repH3::Direction_3 Aff_transformation_repH3:: transform(const typename Aff_transformation_repH3::Direction_3& d) const { - Vector_3 v( d.to_vector() ); - return Direction_3(t00 * v.hx() + t01 * v.hy() + t02 * v.hz(), - t10 * v.hx() + t11 * v.hy() + t12 * v.hz(), - t20 * v.hx() + t21 * v.hy() + t22 * v.hz(), - t33 * v.hw() ); - -/* - return Direction_3( t00 * d.hx() + t01 * d.hy() + t02 * d.hz(), - t10 * d.hx() + t11 * d.hy() + t12 * d.hz(), - t20 * d.hx() + t21 * d.hy() + t22 * d.hz() ); -*/ + if (t33 > RT(0)) + return Direction_3(t00 * d.hx() + t01 * d.hy() + t02 * d.hz(), + t10 * d.hx() + t11 * d.hy() + t12 * d.hz(), + t20 * d.hx() + t21 * d.hy() + t22 * d.hz()); + else + return - Direction_3(t00 * d.hx() + t01 * d.hy() + t02 * d.hz(), + t10 * d.hx() + t11 * d.hy() + t12 * d.hz(), + t20 * d.hx() + t21 * d.hy() + t22 * d.hz()); } template < class R > @@ -840,7 +838,7 @@ transform(const typename Aff_transformationH3::Plane_3& pl) const template < class R > inline -Aff_transformationH3 +typename Aff_transformationH3::Aff_transformation_3 Aff_transformationH3::inverse() const { return Ptr()->inverse(); } diff --git a/Packages/H3/include/CGAL/Homogeneous/DirectionH3.h b/Packages/H3/include/CGAL/Homogeneous/DirectionH3.h index abd204c8caf..f497890e6bd 100644 --- a/Packages/H3/include/CGAL/Homogeneous/DirectionH3.h +++ b/Packages/H3/include/CGAL/Homogeneous/DirectionH3.h @@ -29,15 +29,14 @@ template < class R_ > class DirectionH3 : public R_::Direction_handle_3 { - typedef typename R_::RT RT; - typedef typename R_::FT FT; - - typedef typename R_::Kernel_base::Point_3 Point_3; - typedef typename R_::Kernel_base::Vector_3 Vector_3; - typedef typename R_::Kernel_base::Segment_3 Segment_3; - typedef typename R_::Kernel_base::Line_3 Line_3; - typedef typename R_::Kernel_base::Ray_3 Ray_3; - typedef typename R_::Kernel_base::Aff_transformation_3 Aff_transformation_3; + typedef typename R_::RT RT; + typedef typename R_::FT FT; + typedef typename R_::Point_3 Point_3; + typedef typename R_::Vector_3 Vector_3; + typedef typename R_::Segment_3 Segment_3; + typedef typename R_::Line_3 Line_3; + typedef typename R_::Ray_3 Ray_3; + typedef typename R_::Aff_transformation_3 Aff_transformation_3; typedef typename R_::Direction_handle_3 Direction_handle_3_; typedef typename Direction_handle_3_::element_type Direction_ref_3; @@ -63,6 +62,7 @@ class DirectionH3 DirectionH3(const Segment_3 & s ) : Direction_handle_3_(s.direction()) {} + // the fourth argument is not documented. Should go away ? DirectionH3(const RT& x, const RT& y, const RT& z, const RT& w = RT(1) ) { @@ -83,6 +83,7 @@ class DirectionH3 bool operator!=( const DirectionH3& d) const; Vector_3 to_vector() const; + Vector_3 vector() const { return to_vector(); } const RT & dx() const { return Ptr()->e0; } const RT & dy() const { return Ptr()->e1; } @@ -150,7 +151,7 @@ template inline typename DirectionH3::Vector_3 DirectionH3::to_vector() const -{ return Vector_3(*this); } +{ return Vector_3(dx(), dy(), dz(), RT(1)); } template CGAL_KERNEL_INLINE diff --git a/Packages/H3/include/CGAL/Homogeneous/Iso_cuboidH3.h b/Packages/H3/include/CGAL/Homogeneous/Iso_cuboidH3.h index 3b4e0dff0f1..dbde2d82b24 100644 --- a/Packages/H3/include/CGAL/Homogeneous/Iso_cuboidH3.h +++ b/Packages/H3/include/CGAL/Homogeneous/Iso_cuboidH3.h @@ -32,10 +32,10 @@ template class Iso_cuboidH3 : public R_::Iso_cuboid_handle_3 { - typedef typename R_::RT RT; - typedef typename R_::FT FT; - typedef typename R_::Kernel_base::Point_3 Point_3; - typedef typename R_::Kernel_base::Aff_transformation_3 Aff_transformation_3; + typedef typename R_::RT RT; + typedef typename R_::FT FT; + typedef typename R_::Point_3 Point_3; + typedef typename R_::Aff_transformation_3 Aff_transformation_3; public: typedef R_ R; diff --git a/Packages/H3/include/CGAL/Homogeneous/LineH3.h b/Packages/H3/include/CGAL/Homogeneous/LineH3.h index d6d0bd33667..6b262aa6867 100644 --- a/Packages/H3/include/CGAL/Homogeneous/LineH3.h +++ b/Packages/H3/include/CGAL/Homogeneous/LineH3.h @@ -30,15 +30,15 @@ template < class R_ > class LineH3 : public R_::Line_handle_3 { - typedef typename R_::RT RT; - typedef typename R_::FT FT; - typedef typename R_::Kernel_base::Point_3 Point_3; - typedef typename R_::Kernel_base::Segment_3 Segment_3; - typedef typename R_::Kernel_base::Ray_3 Ray_3; - typedef typename R_::Kernel_base::Direction_3 Direction_3; - typedef typename R_::Kernel_base::Plane_3 Plane_3; - typedef typename R_::Kernel_base::Vector_3 Vector_3; - typedef typename R_::Kernel_base::Aff_transformation_3 Aff_transformation_3; + typedef typename R_::RT RT; + typedef typename R_::FT FT; + typedef typename R_::Point_3 Point_3; + typedef typename R_::Segment_3 Segment_3; + typedef typename R_::Ray_3 Ray_3; + typedef typename R_::Direction_3 Direction_3; + typedef typename R_::Plane_3 Plane_3; + typedef typename R_::Vector_3 Vector_3; + typedef typename R_::Aff_transformation_3 Aff_transformation_3; typedef typename R_::Line_handle_3 Line_handle_3_; typedef typename Line_handle_3_::element_type Line_ref_3; diff --git a/Packages/H3/include/CGAL/Homogeneous/PlaneH3.h b/Packages/H3/include/CGAL/Homogeneous/PlaneH3.h index 7033cafa474..3f722bac992 100644 --- a/Packages/H3/include/CGAL/Homogeneous/PlaneH3.h +++ b/Packages/H3/include/CGAL/Homogeneous/PlaneH3.h @@ -30,16 +30,17 @@ template < class R_ > class PlaneH3 : public R_::Plane_handle_3 { - typedef typename R_::RT RT; - typedef typename R_::FT FT; - typedef typename R_::Kernel_base::Point_2 Point_2; - typedef typename R_::Kernel_base::Point_3 Point_3; - typedef typename R_::Kernel_base::Vector_3 Vector_3; - typedef typename R_::Kernel_base::Line_3 Line_3; - typedef typename R_::Kernel_base::Segment_3 Segment_3; - typedef typename R_::Kernel_base::Ray_3 Ray_3; - typedef typename R_::Kernel_base::Direction_3 Direction_3; - typedef typename R_::Kernel_base::Aff_transformation_3 Aff_transformation_3; + typedef typename R_::RT RT; + typedef typename R_::FT FT; + typedef typename R_::Point_2 Point_2; + typedef typename R_::Point_3 Point_3; + typedef typename R_::Vector_3 Vector_3; + typedef typename R_::Line_3 Line_3; + typedef typename R_::Segment_3 Segment_3; + typedef typename R_::Ray_3 Ray_3; + typedef typename R_::Direction_3 Direction_3; + typedef typename R_::Plane_3 Plane_3; + typedef typename R_::Aff_transformation_3 Aff_transformation_3; typedef typename R_::Plane_handle_3 Plane_handle_3_; typedef typename Plane_handle_3_::element_type Plane_ref_3; @@ -50,9 +51,7 @@ class PlaneH3 PlaneH3() : Plane_handle_3_(Plane_ref_3()) {} - PlaneH3(const Point_3&, - const Point_3&, - const Point_3& ); + PlaneH3(const Point_3&, const Point_3&, const Point_3& ); PlaneH3(const RT& a, const RT& b, const RT& c, const RT& d ); PlaneH3(const Point_3&, const Ray_3& ); @@ -74,7 +73,7 @@ class PlaneH3 bool operator!=( const PlaneH3& ) const; Line_3 perpendicular_line(const Point_3& ) const; - PlaneH3 opposite() const; // plane with opposite orientation + Plane_3 opposite() const; // plane with opposite orientation Point_3 projection(const Point_3& ) const; Point_3 point() const; // same point on the plane @@ -95,7 +94,7 @@ class PlaneH3 bool is_degenerate() const; - PlaneH3 transform(const Aff_transformation_3& ) const; + Plane_3 transform(const Aff_transformation_3& ) const; Aff_transformation_3 transform_to_2d() const; Point_2 to_2d(const Point_3& ) const; @@ -184,20 +183,20 @@ PlaneH3::operator!=(const PlaneH3& l) const template < class R > CGAL_KERNEL_INLINE PlaneH3::PlaneH3(const typename PlaneH3::Point_3& p, - const typename PlaneH3::Point_3& q, - const typename PlaneH3::Point_3& r) + const typename PlaneH3::Point_3& q, + const typename PlaneH3::Point_3& r) { new_rep(p,q,r); } template < class R > CGAL_KERNEL_INLINE PlaneH3::PlaneH3(const RT& a, const RT& b, - const RT& c, const RT& d) + const RT& c, const RT& d) { new_rep(a,b,c,d); } template < class R > CGAL_KERNEL_INLINE PlaneH3::PlaneH3(const typename PlaneH3::Point_3& p , - const typename PlaneH3::Line_3& l) + const typename PlaneH3::Line_3& l) { new_rep(p, l.point(0), l.point(1) ); } template < class R > @@ -292,7 +291,7 @@ PlaneH3::perpendicular_line(const typename PlaneH3::Point_3& p) const template < class R > CGAL_KERNEL_INLINE -PlaneH3 +typename R::Plane_3 PlaneH3::opposite() const { return PlaneH3(-a(), -b(), -c(), -d() ); } @@ -388,7 +387,7 @@ PlaneH3::orthogonal_vector() const { return Vector_3(a(), b(), c() ); } template < class R > -PlaneH3 +typename R::Plane_3 PlaneH3::transform(const typename PlaneH3::Aff_transformation_3& t) const { return t.transform(*this); diff --git a/Packages/H3/include/CGAL/Homogeneous/PointH3.h b/Packages/H3/include/CGAL/Homogeneous/PointH3.h index 5bd2ad048ae..462a3b24d0b 100644 --- a/Packages/H3/include/CGAL/Homogeneous/PointH3.h +++ b/Packages/H3/include/CGAL/Homogeneous/PointH3.h @@ -33,11 +33,11 @@ template < class R_ > class PointH3 : public R_::Point_handle_3 { - typedef typename R_::RT RT; - typedef typename R_::FT FT; - typedef typename R_::Kernel_base::Vector_3 Vector_3; - typedef typename R_::Kernel_base::Direction_3 Direction_3; - typedef typename R_::Kernel_base::Aff_transformation_3 Aff_transformation_3; + typedef typename R_::RT RT; + typedef typename R_::FT FT; + typedef typename R_::Vector_3 Vector_3; + typedef typename R_::Direction_3 Direction_3; + typedef typename R_::Aff_transformation_3 Aff_transformation_3; typedef typename R_::Point_handle_3 Point_handle_3_; typedef typename Point_handle_3_::element_type Point_ref_3; diff --git a/Packages/H3/include/CGAL/Homogeneous/RayH3.h b/Packages/H3/include/CGAL/Homogeneous/RayH3.h index 8a478dbb0e3..3d1b111a360 100644 --- a/Packages/H3/include/CGAL/Homogeneous/RayH3.h +++ b/Packages/H3/include/CGAL/Homogeneous/RayH3.h @@ -30,12 +30,12 @@ template < class R_ > class RayH3 : public R_::Ray_handle_3 { - typedef typename R_::RT RT; - typedef typename R_::FT FT; - typedef typename R_::Kernel_base::Point_3 Point_3; - typedef typename R_::Kernel_base::Line_3 Line_3; - typedef typename R_::Kernel_base::Direction_3 Direction_3; - typedef typename R_::Kernel_base::Aff_transformation_3 Aff_transformation_3; + typedef typename R_::RT RT; + typedef typename R_::FT FT; + typedef typename R_::Point_3 Point_3; + typedef typename R_::Line_3 Line_3; + typedef typename R_::Direction_3 Direction_3; + typedef typename R_::Aff_transformation_3 Aff_transformation_3; typedef typename R_::Ray_handle_3 Ray_handle_3_; typedef typename Ray_handle_3_::element_type Ray_ref_3; diff --git a/Packages/H3/include/CGAL/Homogeneous/SegmentH3.h b/Packages/H3/include/CGAL/Homogeneous/SegmentH3.h index fbe7ceda7d1..6684c0c9386 100644 --- a/Packages/H3/include/CGAL/Homogeneous/SegmentH3.h +++ b/Packages/H3/include/CGAL/Homogeneous/SegmentH3.h @@ -30,12 +30,12 @@ template < class R_ > class SegmentH3 : public R_::Segment_handle_3 { - typedef typename R_::RT RT; - typedef typename R_::FT FT; - typedef typename R_::Kernel_base::Point_3 Point_3; - typedef typename R_::Kernel_base::Direction_3 Direction_3; - typedef typename R_::Kernel_base::Line_3 Line_3; - typedef typename R_::Kernel_base::Aff_transformation_3 Aff_transformation_3; + typedef typename R_::RT RT; + typedef typename R_::FT FT; + typedef typename R_::Point_3 Point_3; + typedef typename R_::Direction_3 Direction_3; + typedef typename R_::Line_3 Line_3; + typedef typename R_::Aff_transformation_3 Aff_transformation_3; typedef typename R_::Segment_handle_3 Segment_handle_3_; typedef typename Segment_handle_3_::element_type Segment_ref_3; diff --git a/Packages/H3/include/CGAL/Homogeneous/SphereH3.h b/Packages/H3/include/CGAL/Homogeneous/SphereH3.h index 2f199094972..f1489ee8d1b 100644 --- a/Packages/H3/include/CGAL/Homogeneous/SphereH3.h +++ b/Packages/H3/include/CGAL/Homogeneous/SphereH3.h @@ -30,10 +30,10 @@ template class SphereH3 : public R_::Sphere_handle_3 { - typedef typename R_::RT RT; - typedef typename R_::FT FT; - typedef typename R_::Kernel_base::Point_3 Point_3; - typedef typename R_::Kernel_base::Aff_transformation_3 Aff_transformation_3; + typedef typename R_::RT RT; + typedef typename R_::FT FT; + typedef typename R_::Point_3 Point_3; + typedef typename R_::Aff_transformation_3 Aff_transformation_3; typedef typename R_::Sphere_handle_3 Sphere_handle_3_; typedef typename Sphere_handle_3_::element_type Sphere_ref_3; diff --git a/Packages/H3/include/CGAL/Homogeneous/TetrahedronH3.h b/Packages/H3/include/CGAL/Homogeneous/TetrahedronH3.h index 2d87c4b80fd..391d21e7270 100644 --- a/Packages/H3/include/CGAL/Homogeneous/TetrahedronH3.h +++ b/Packages/H3/include/CGAL/Homogeneous/TetrahedronH3.h @@ -33,11 +33,11 @@ template < class R_ > class TetrahedronH3 : public R_::Tetrahedron_handle_3 { - typedef typename R_::RT RT; - typedef typename R_::FT FT; - typedef typename R_::Kernel_base::Point_3 Point_3; - typedef typename R_::Kernel_base::Vector_3 Vector_3; - typedef typename R_::Kernel_base::Aff_transformation_3 Aff_transformation_3; + typedef typename R_::RT RT; + typedef typename R_::FT FT; + typedef typename R_::Point_3 Point_3; + typedef typename R_::Vector_3 Vector_3; + typedef typename R_::Aff_transformation_3 Aff_transformation_3; typedef typename R_::Tetrahedron_handle_3 Tetrahedron_handle_3_; typedef typename Tetrahedron_handle_3_::element_type Tetrahedron_ref_3; diff --git a/Packages/H3/include/CGAL/Homogeneous/TriangleH3.h b/Packages/H3/include/CGAL/Homogeneous/TriangleH3.h index 399d411901d..0a33bef35c3 100644 --- a/Packages/H3/include/CGAL/Homogeneous/TriangleH3.h +++ b/Packages/H3/include/CGAL/Homogeneous/TriangleH3.h @@ -30,14 +30,14 @@ template < class R_ > class TriangleH3 : public R_::Triangle_handle_3 { - typedef typename R_::RT RT; - typedef typename R_::FT FT; - typedef typename R_::Kernel_base::Point_3 Point_3; - typedef typename R_::Kernel_base::Plane_3 Plane_3; - typedef typename R_::Kernel_base::Vector_3 Vector_3; - typedef typename R_::Kernel_base::Segment_3 Segment_3; - typedef typename R_::Kernel_base::Tetrahedron_3 Tetrahedron_3; - typedef typename R_::Kernel_base::Aff_transformation_3 Aff_transformation_3; + typedef typename R_::RT RT; + typedef typename R_::FT FT; + typedef typename R_::Point_3 Point_3; + typedef typename R_::Plane_3 Plane_3; + typedef typename R_::Vector_3 Vector_3; + typedef typename R_::Segment_3 Segment_3; + typedef typename R_::Tetrahedron_3 Tetrahedron_3; + typedef typename R_::Aff_transformation_3 Aff_transformation_3; typedef typename R_::Triangle_handle_3 Triangle_handle_3_; typedef typename Triangle_handle_3_::element_type Triangle_ref_3; diff --git a/Packages/H3/include/CGAL/Homogeneous/VectorH3.h b/Packages/H3/include/CGAL/Homogeneous/VectorH3.h index 59621a27db5..8d9a3a3d20a 100644 --- a/Packages/H3/include/CGAL/Homogeneous/VectorH3.h +++ b/Packages/H3/include/CGAL/Homogeneous/VectorH3.h @@ -31,11 +31,12 @@ template < class R_ > class VectorH3 : public R_::Vector_handle_3 { - typedef typename R_::RT RT; - typedef typename R_::FT FT; - typedef typename R_::Kernel_base::Point_3 Point_3; - typedef typename R_::Kernel_base::Direction_3 Direction_3; - typedef typename R_::Kernel_base::Aff_transformation_3 Aff_transformation_3; + typedef typename R_::RT RT; + typedef typename R_::FT FT; + typedef typename R_::Point_3 Point_3; + typedef typename R_::Direction_3 Direction_3; + typedef typename R_::Vector_3 Vector_3; + typedef typename R_::Aff_transformation_3 Aff_transformation_3; typedef typename R_::Vector_handle_3 Vector_handle_3_; typedef typename Vector_handle_3_::element_type Vector_ref_3; @@ -78,13 +79,10 @@ public: int dimension() const { return 3; }; - Direction_3 - direction() const; - VectorH3 - transform(const Aff_transformation_3& t ) const; + Direction_3 direction() const; + Vector_3 transform(const Aff_transformation_3& t ) const; - VectorH3 - operator-() const; + Vector_3 operator-() const; bool operator==( const VectorH3& v) const; bool operator!=( const VectorH3& v) const; @@ -109,7 +107,7 @@ VectorH3::VectorH3(const RT& x, const RT& y, const RT& z, const RT& w) template < class R > CGAL_KERNEL_INLINE -typename VectorH3::FT +typename R::FT VectorH3::cartesian(int i) const { CGAL_kernel_precondition(i == 0 || i == 1 || i == 2); @@ -123,7 +121,7 @@ VectorH3::cartesian(int i) const template < class R > CGAL_KERNEL_INLINE -const typename VectorH3::RT & +const typename R::RT & VectorH3::homogeneous(int i) const { CGAL_kernel_precondition(i == 0 || i == 1 || i == 2 || i == 3); @@ -138,7 +136,7 @@ VectorH3::homogeneous(int i) const template < class R > inline -typename VectorH3::Direction_3 +typename R::Direction_3 VectorH3::direction() const { return Direction_3(*this); } @@ -160,19 +158,19 @@ VectorH3::operator!=( const VectorH3& v) const template < class R > inline -typename VectorH3::FT +typename R::FT VectorH3::operator[](int i) const { return cartesian(i); } template < class R > CGAL_KERNEL_INLINE -VectorH3 +typename R::Vector_3 VectorH3::operator-() const -{ return VectorH3( - hx(), - hy(), -hz(), hw() ); } +{ return Vector_3( - hx(), - hy(), -hz(), hw() ); } template CGAL_KERNEL_INLINE -VectorH3 +typename R::Vector_3 operator+(const VectorH3& u, const VectorH3& v) { return VectorH3(u.hx()*v.hw() + v.hx()*u.hw(), @@ -183,7 +181,7 @@ operator+(const VectorH3& u, const VectorH3& v) template CGAL_KERNEL_INLINE -VectorH3 +typename R::Vector_3 operator-(const VectorH3& u, const VectorH3& v) { return VectorH3(u.hx()*v.hw() - v.hx()*u.hw(), @@ -194,7 +192,7 @@ operator-(const VectorH3& u, const VectorH3& v) template CGAL_KERNEL_INLINE -typename VectorH3::FT +typename R::FT VectorH3::operator*(const VectorH3& v) const { typedef typename R::RT RT; @@ -207,32 +205,39 @@ VectorH3::operator*(const VectorH3& v) const template CGAL_KERNEL_INLINE -VectorH3 +typename R::Vector_3 operator/(const VectorH3& v, const typename R::RT& f) { return VectorH3( v.hx(), v.hy(), v.hz(), v.hw()*f ); } template CGAL_KERNEL_INLINE -VectorH3 +typename VectorH3::Vector_3 +operator/(const VectorH3& v, const typename R::FT& f) +{ return VectorH3( v.hx()*f.denominator(), v.hy()*f.denominator(), + v.hz()*f.denominator(), v.hw()*f.numerator() ); } + +template +CGAL_KERNEL_INLINE +typename R::Vector_3 operator*(const VectorH3& v, const typename R::RT& f) { return VectorH3( v.hx()*f, v.hy()*f, v.hz()*f, v.hw() ); } -#ifdef __SUNPRO_CC -template -CGAL_KERNEL_INLINE -VectorH3 -operator*(const RT& f, const VectorH3& v) -#else template CGAL_KERNEL_INLINE -VectorH3 +typename VectorH3::Vector_3 +operator*(const VectorH3& v, const typename R::FT& f) +{ return VectorH3( v.hx()*f.numerator(), v.hy()*f.numerator(), + v.hz()*f.numerator(), v.hw()*f.denominator() ); } + +template +CGAL_KERNEL_INLINE +typename R::Vector_3 operator*(const typename R::RT& f, const VectorH3& v) -#endif { return VectorH3( v.hx()*f, v.hy()*f, v.hz()*f, v.hw() ); } template CGAL_KERNEL_INLINE -VectorH3 +typename R::Vector_3 cross_product(const VectorH3& a, const VectorH3& b) { return VectorH3(a.hy()*b.hz() - a.hz()*b.hy(), @@ -243,31 +248,31 @@ cross_product(const VectorH3& a, const VectorH3& b) template inline -PointH3 +typename R::Point_3 operator+(const Origin& , const VectorH3& v) { return PointH3( v ); } template inline -PointH3 +typename R::Point_3 operator-(const Origin& , const VectorH3& v) { return PointH3(-v ); } template inline -VectorH3 +typename R::Vector_3 operator-(const PointH3& p, const Origin& ) { return VectorH3( p ); } template inline -VectorH3 +typename R::Vector_3 operator-(const Origin& , const PointH3& p) { return - VectorH3( p ); } template CGAL_KERNEL_INLINE -PointH3 +typename R::Point_3 operator+(const PointH3& p, const VectorH3& v) { return PointH3(p.hx()*v.hw() + v.hx()*p.hw(), @@ -278,7 +283,7 @@ operator+(const PointH3& p, const VectorH3& v) template CGAL_KERNEL_INLINE -PointH3 +typename R::Point_3 operator-(const PointH3& p, const VectorH3& v) { return PointH3( p.hx()*v.hw() - v.hx()*p.hw(), @@ -289,10 +294,10 @@ operator-(const PointH3& p, const VectorH3& v) template CGAL_KERNEL_INLINE -VectorH3 +typename R::Vector_3 operator-(const PointH3& p, const PointH3& q) { - return PointH3( p.hx()*q.hw() - q.hx()*p.hw(), + return VectorH3(p.hx()*q.hw() - q.hx()*p.hw(), p.hy()*q.hw() - q.hy()*p.hw(), p.hz()*q.hw() - q.hz()*p.hw(), p.hw()*q.hw() ); @@ -304,7 +309,7 @@ operator-(const PointH3& p, const PointH3& q) template < class R > inline -VectorH3 +typename R::Vector_3 VectorH3:: transform(const typename VectorH3::Aff_transformation_3&t ) const { return t.transform(*this); }