diff --git a/Packages/H2/changes.txt b/Packages/H2/changes.txt index d248d54a531..64133f058f4 100644 --- a/Packages/H2/changes.txt +++ b/Packages/H2/changes.txt @@ -1,3 +1,6 @@ +2.41 (? October 2001) +- Replace Handle/Rep by Handle_for/Ref_counted. + 2.40 (5 October 2001) - Cleanup use of ptr in AffH2. - Use New_delete_allocator. diff --git a/Packages/H2/include/CGAL/homogeneous_rep.h b/Packages/H2/include/CGAL/homogeneous_rep.h index 4e165949d6d..0dd67c8b76a 100644 --- a/Packages/H2/include/CGAL/homogeneous_rep.h +++ b/Packages/H2/include/CGAL/homogeneous_rep.h @@ -23,7 +23,6 @@ #define CGAL_HOMOGENEOUS_REP_H #include -#include #include #include #include @@ -98,7 +97,9 @@ class Homogeneous_base typedef CGAL::Handle_for< Segment_repH3 > Segment_handle_3; typedef CGAL::Handle_for< Threetuple< PointH3 > > Triangle_handle_3; typedef CGAL::Handle_for< Twotuple > > Iso_cuboid_handle_3; - typedef CGAL::Handle Aff_transformation_handle_3; + typedef CGAL::Handle_for< Aff_transformation_rep_baseH3, + New_delete_allocator< Aff_transformation_rep_baseH3 > > + Aff_transformation_handle_3; }; diff --git a/Packages/H2/include/CGAL/simple_homogeneous_rep.h b/Packages/H2/include/CGAL/simple_homogeneous_rep.h index 82731682ffb..315992537de 100644 --- a/Packages/H2/include/CGAL/simple_homogeneous_rep.h +++ b/Packages/H2/include/CGAL/simple_homogeneous_rep.h @@ -23,7 +23,6 @@ #define CGAL_SIMPLE_HOMOGENEOUS_REP_H #include -#include #include #include #include @@ -118,7 +117,9 @@ class Simple_homogeneous_base Triangle_handle_3; typedef CGAL::Simple_Handle_for< Simple_Twotuple > > Iso_cuboid_handle_3; - typedef CGAL::Handle Aff_transformation_handle_3; + typedef CGAL::Handle_for< Aff_transformation_rep_baseH3, + New_delete_allocator< Aff_transformation_rep_baseH3 > > + Aff_transformation_handle_3; }; template > diff --git a/Packages/H3/changes.txt b/Packages/H3/changes.txt index 587a1dea6b6..387de87a689 100644 --- a/Packages/H3/changes.txt +++ b/Packages/H3/changes.txt @@ -1,3 +1,6 @@ +2.37 (? October 2001) +- Replace Handle/Rep by Handle_for/Ref_counted. + 2.36 (2 October 2001) - Access functions of objects (like .x() ) now return const references. diff --git a/Packages/H3/include/CGAL/Aff_transformationH3.h b/Packages/H3/include/CGAL/Aff_transformationH3.h index 9810d4f0aa0..775ad420548 100644 --- a/Packages/H3/include/CGAL/Aff_transformationH3.h +++ b/Packages/H3/include/CGAL/Aff_transformationH3.h @@ -42,7 +42,7 @@ _general_transformation_composition ( Aff_transformation_repH3 r); template -class Aff_transformation_rep_baseH3 : public Rep +class Aff_transformation_rep_baseH3 : public Ref_counted // abstract base class of aff transformation representations { public: @@ -91,7 +91,8 @@ public: typedef typename R::FT FT; typedef typename R::RT RT; - Aff_transformation_repH3(); + Aff_transformation_repH3() {} + Aff_transformation_repH3( const RT& m00, const RT& m01, const RT& m02, const RT& m03, const RT& m10, const RT& m11, const RT& m12, const RT& m13, @@ -211,8 +212,6 @@ public: typedef typename R::FT FT; typedef typename R::RT RT; - Translation_repH3(); - Translation_repH3( const VectorH3& v); virtual ~Translation_repH3() {} @@ -255,7 +254,7 @@ private: }; template < class R_ > -class Aff_transformationH3 : public Handle +class Aff_transformationH3 : public R_::Aff_transformation_handle_3 { public: typedef R_ R; @@ -264,8 +263,6 @@ public: Aff_transformationH3(); - Aff_transformationH3(const Aff_transformationH3& tbc); - // Identity Aff_transformationH3(const Identity_transformation&); @@ -287,8 +284,6 @@ public: const RT& m20, const RT& m21, const RT& m22, const RT& m33); - ~Aff_transformationH3(); - PointH3 transform(const PointH3& p) const; @@ -315,39 +310,25 @@ public: FT cartesian(int i, int j) const - { return ptr()->cartesian(i,j); } + { return Ptr()->cartesian(i,j); } RT homogeneous(int i, int j) const - { return ptr()->homogeneous(i,j); } + { return Ptr()->homogeneous(i,j); } FT m(int i, int j) const - { return ptr()->cartesian(i,j); } + { return Ptr()->cartesian(i,j); } RT hm(int i, int j) const - { return ptr()->homogeneous(i,j); } - -// protected: - Aff_transformation_rep_baseH3* ptr() const; + { return Ptr()->homogeneous(i,j); } }; #ifdef CGAL_CFG_TYPENAME_BUG #define typename #endif -template < class R > -CGAL_KERNEL_CTOR_INLINE -Aff_transformation_repH3::Aff_transformation_repH3() -#ifdef INITIALIZE_AFF_TRANSFORMATIONS - : t00(RT(1)), t01(RT(0)), t02(RT(0)), t03(RT(0)), - t10(RT(0)), t11(RT(1)), t12(RT(0)), t13(RT(0)), - t20(RT(0)), t21(RT(0)), t22(RT(1)), t23(RT(0)), - t33(RT(1)) -#endif // INITIALIZE_AFF_TRANSFORMATIONS -{} - template < class R > CGAL_KERNEL_CTOR_INLINE Aff_transformation_repH3::Aff_transformation_repH3( @@ -584,16 +565,6 @@ Identity_repH3::general_form() const RT1 ); } -// not used (default ctor in Aff_transformationH3 -// calls default ctor of Aff_transformation_repH3 ) -template < class R > -inline -Translation_repH3::Translation_repH3() -#ifdef INITIALIZE_AFF_TRANSFORMATIONS - : tv( VectorH3( RT(0), RT(0) )) -#endif // INITIALIZE_AFF_TRANSFORMATIONS -{} - template < class R > inline Translation_repH3::Translation_repH3( const VectorH3& v) @@ -749,26 +720,19 @@ _general_transformation_composition( template < class R > CGAL_KERNEL_CTOR_INLINE Aff_transformationH3::Aff_transformationH3() -{ PTR = new Aff_transformation_repH3(); } - -template < class R > -CGAL_KERNEL_CTOR_INLINE -Aff_transformationH3:: -Aff_transformationH3( const Aff_transformationH3& tbc) - : Handle(tbc) -{} +{ initialize_with(Aff_transformation_repH3()); } template < class R > CGAL_KERNEL_CTOR_INLINE Aff_transformationH3:: Aff_transformationH3(const Identity_transformation&) -{ PTR = new Identity_repH3(); } +{ initialize_with(Identity_repH3()); } template < class R > CGAL_KERNEL_CTOR_INLINE Aff_transformationH3:: Aff_transformationH3(const Translation&, const VectorH3& v) -{ PTR = new Translation_repH3( v ); } +{ initialize_with(Translation_repH3( v )); } template < class R > CGAL_KERNEL_CTOR_INLINE @@ -776,10 +740,10 @@ Aff_transformationH3:: Aff_transformationH3(const Scaling&, const RT& num, const RT& den) { const RT RT0(0); - PTR = new Aff_transformation_repH3(num, RT0, RT0, RT0, + initialize_with(Aff_transformation_repH3(num, RT0, RT0, RT0, RT0, num, RT0, RT0, RT0, RT0, num, RT0, - den ); + den )); } template < class R > @@ -791,10 +755,10 @@ Aff_transformationH3( const RT& m20, const RT& m21, const RT& m22, const RT& m23, const RT& m33) { - PTR = new Aff_transformation_repH3(m00, m01, m02, m03, + initialize_with(Aff_transformation_repH3(m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, - m33 ); + m33 )); } template < class R > @@ -807,72 +771,61 @@ Aff_transformationH3( const RT& m33) { const RT RT0 = RT(0); - PTR = new Aff_transformation_repH3(m00, m01, m02, RT0, + initialize_with(Aff_transformation_repH3(m00, m01, m02, RT0, m10, m11, m12, RT0, m20, m21, m22, RT0, - m33 ); + m33 )); } -template < class R > -inline -Aff_transformation_rep_baseH3* -Aff_transformationH3::ptr() const -{ return static_cast*>(PTR); } - -template < class R > -inline -Aff_transformationH3::~Aff_transformationH3() -{} - template < class R > inline PointH3 Aff_transformationH3::transform(const PointH3& p) const -{ return ptr()->transform(p); } +{ return Ptr()->transform(p); } template < class R > inline VectorH3 Aff_transformationH3::transform(const VectorH3& v) const -{ return ptr()->transform(v); } +{ return Ptr()->transform(v); } template < class R > inline DirectionH3 Aff_transformationH3:: transform(const DirectionH3& d) const -{ return ptr()->transform(d); } +{ return Ptr()->transform(d); } template < class R > inline PlaneH3 Aff_transformationH3:: transform(const PlaneH3& pl) const -{ return ptr()->transform(pl); } +{ return Ptr()->transform(pl); } template < class R > inline Aff_transformationH3 Aff_transformationH3::inverse() const -{ return ptr()->inverse(); } +{ return Ptr()->inverse(); } template < class R > inline Aff_transformationH3 Aff_transformationH3::transpose() const -{ return ptr()->transpose(); } +{ return Ptr()->transpose(); } template < class R > inline bool Aff_transformationH3::is_even() const -{ return ptr()->is_even(); } +{ return Ptr()->is_even(); } template < class R > inline bool Aff_transformationH3::is_odd() const -{ return ( ! (ptr()->is_even() )); } +{ return ( ! (Ptr()->is_even() )); } template < class R > CGAL_KERNEL_INLINE @@ -881,8 +834,8 @@ operator*(const Aff_transformationH3& left_argument, const Aff_transformationH3& right_argument ) { return _general_transformation_composition( - left_argument.ptr() ->general_form(), - right_argument.ptr()->general_form() ); + left_argument.Ptr() ->general_form(), + right_argument.Ptr()->general_form() ); } template < class R > @@ -891,7 +844,7 @@ operator<< ( std::ostream & out, const Aff_transformationH3& t) { typename R::RT RT0(0); - Aff_transformation_repH3 r = t.ptr()->general_form(); + Aff_transformation_repH3 r = t.Ptr()->general_form(); return out << "| "<< r.t00 <<' '<< r.t01 <<' '<< r.t02 <<' '<< r.t03 << " |\n" << "| "<< r.t10 <<' '<< r.t11 <<' '<< r.t12 <<' '<< r.t13 << " |\n" diff --git a/Packages/H3/include/CGAL/PointH3.h b/Packages/H3/include/CGAL/PointH3.h index 2a56b41efee..e2167b2d7dc 100644 --- a/Packages/H3/include/CGAL/PointH3.h +++ b/Packages/H3/include/CGAL/PointH3.h @@ -21,6 +21,4 @@ // coordinator : MPI, Saarbruecken () // ====================================================================== -#ifndef CGAL_PVDH3_H #include -#endif // CGAL_PVDH3_H