From 36df09314beef5fc9d1a0ec8ec0503e554ee89c3 Mon Sep 17 00:00:00 2001 From: Sylvain Pion Date: Fri, 10 Nov 2000 16:16:25 +0000 Subject: [PATCH] - Merged Aff_transformation_[23].C in the corresponding .h . --- .../Cartesian_kernel/include/CGAL/Cartesian.h | 4 - .../CGAL/Cartesian/Aff_transformation_2.C | 169 ------------------ .../CGAL/Cartesian/Aff_transformation_2.h | 143 ++++++++++++++- .../CGAL/Cartesian/Aff_transformation_3.C | 144 --------------- .../CGAL/Cartesian/Aff_transformation_3.h | 120 ++++++++++++- 5 files changed, 256 insertions(+), 324 deletions(-) delete mode 100644 Packages/Cartesian_kernel/include/CGAL/Cartesian/Aff_transformation_2.C delete mode 100644 Packages/Cartesian_kernel/include/CGAL/Cartesian/Aff_transformation_3.C diff --git a/Packages/Cartesian_kernel/include/CGAL/Cartesian.h b/Packages/Cartesian_kernel/include/CGAL/Cartesian.h index 4be126d7b13..33765807990 100644 --- a/Packages/Cartesian_kernel/include/CGAL/Cartesian.h +++ b/Packages/Cartesian_kernel/include/CGAL/Cartesian.h @@ -54,8 +54,6 @@ #include -#include - // #include // #include #include @@ -81,8 +79,6 @@ #include -#include - // #include // #include diff --git a/Packages/Cartesian_kernel/include/CGAL/Cartesian/Aff_transformation_2.C b/Packages/Cartesian_kernel/include/CGAL/Cartesian/Aff_transformation_2.C deleted file mode 100644 index 8a1507ff651..00000000000 --- a/Packages/Cartesian_kernel/include/CGAL/Cartesian/Aff_transformation_2.C +++ /dev/null @@ -1,169 +0,0 @@ -// ====================================================================== -// -// Copyright (c) 2000 The CGAL Consortium -// -// This software and related documentation is part of an INTERNAL release -// of the Computational Geometry Algorithms Library (CGAL). It is not -// intended for general use. -// -// ---------------------------------------------------------------------- -// -// release : -// release_date : -// -// file : include/CGAL/Cartesian/Aff_transformation_2.C -// revision : $Revision$ -// revision_date : $Date$ -// author(s) : Andreas Fabri, Lutz Kettner -// coordinator : INRIA Sophia-Antipolis (Mariette.Yvinec@sophia.inria.fr) -// -// ====================================================================== - -#ifndef CGAL_CARTESIAN_AFF_TRANSFORMATION_2_C -#define CGAL_CARTESIAN_AFF_TRANSFORMATION_2_C - -#ifdef CGAL_CFG_TYPENAME_BUG -#define typename -#endif - -CGAL_BEGIN_NAMESPACE - -template < class R > -Aff_transformationC2:: -Aff_transformationC2() -{ - PTR = new Aff_transformation_repC2(FT(1), FT(0), FT(0), FT(1)); -} - -template < class R > -Aff_transformationC2:: -Aff_transformationC2(const Identity_transformation) -{ - PTR = new Aff_transformation_repC2(FT(1), FT(0), FT(0), FT(1)); -} - -template < class R > -Aff_transformationC2::Aff_transformationC2 - (const Aff_transformationC2 &t) - : Handle(t) -{} - -template < class R > -Aff_transformationC2:: -Aff_transformationC2( - const typename Aff_transformationC2::FT & m11, - const typename Aff_transformationC2::FT & m12, - const typename Aff_transformationC2::FT & m21, - const typename Aff_transformationC2::FT & m22, - const typename Aff_transformationC2::FT & w) -{ - PTR = new Aff_transformation_repC2(m11/w, m12/w, m21/w, m22/w); -} - -template < class R > -Aff_transformationC2:: -Aff_transformationC2( - const Translation, - const typename Aff_transformationC2::Vector_2 &v) -{ - PTR = new Translation_repC2(v); -} - -template < class R > -Aff_transformationC2:: -Aff_transformationC2( - const Rotation, - const typename Aff_transformationC2::Direction_2 &d, - const typename Aff_transformationC2::FT &num, - const typename Aff_transformationC2::FT &den) -{ - PTR = new Rotation_repC2(d, num, den); -} - -template < class R > -Aff_transformationC2:: -Aff_transformationC2( - const Rotation, - const typename Aff_transformationC2::FT &sine, - const typename Aff_transformationC2::FT &cosine, - const typename Aff_transformationC2::FT &w) -{ - if (w != FT(1)) // Idem... - PTR = new Rotation_repC2(sine/w, cosine/w); - else - PTR = new Rotation_repC2(sine, cosine); -} - -template < class R > -Aff_transformationC2:: -Aff_transformationC2(const Scaling, - const typename Aff_transformationC2::FT &s, - const typename Aff_transformationC2::FT &w) -{ - if (w != FT(1)) // .... - PTR = new Scaling_repC2(s/w); - else - PTR = new Scaling_repC2(s); -} - -// and a 3x2 matrix for the operations combining rotation, scaling, translation -template < class R > -Aff_transformationC2:: -Aff_transformationC2( - const typename Aff_transformationC2::FT &m11, - const typename Aff_transformationC2::FT &m12, - const typename Aff_transformationC2::FT &m13, - const typename Aff_transformationC2::FT &m21, - const typename Aff_transformationC2::FT &m22, - const typename Aff_transformationC2::FT &m23, - const typename Aff_transformationC2::FT &w) -{ - if (w != FT(1)) // ... - PTR = new Aff_transformation_repC2(m11/w, m12/w, m13/w, - m21/w, m22/w, m23/w); - else - PTR = new Aff_transformation_repC2(m11, m12, m13, - m21, m22, m23); -} - -template < class R > -Aff_transformationC2::~Aff_transformationC2() -{} - -template < class R > -Aff_transformationC2 & -Aff_transformationC2:: -operator=(const Aff_transformationC2 &t) -{ - Handle::operator=(t); - return *this; -} - -template < class R > -std::ostream& -Aff_transformationC2::print(std::ostream &os) const -{ - ptr()->print(os); - return os; -} - -#ifndef CGAL_NO_OSTREAM_INSERT_AFF_TRANSFORMATIONC2 -template < class R > -std::ostream& -operator<<(std::ostream& os, const Aff_transformationC2& t) -{ - t.print(os); - return os; -} -#endif // CGAL_NO_OSTREAM_INSERT_AFF_TRANSFORMATIONC2 - -#ifndef CGAL_NO_ISTREAM_EXTRACT_AFF_TRANSFORMATIONC2 -#endif // CGAL_NO_ISTREAM_EXTRACT_AFF_TRANSFORMATIONC2 - -CGAL_END_NAMESPACE - -#ifdef CGAL_CFG_TYPENAME_BUG -#undef typename -#endif - -#endif // CGAL_CARTESIAN_AFF_TRANSFORMATION_2_C 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 5ed1c60d8cd..828a2eeafa1 100644 --- a/Packages/Cartesian_kernel/include/CGAL/Cartesian/Aff_transformation_2.h +++ b/Packages/Cartesian_kernel/include/CGAL/Cartesian/Aff_transformation_2.h @@ -148,10 +148,147 @@ private: Aff_t_base* ptr() const { return (Aff_t_base*)PTR; } }; -CGAL_END_NAMESPACE -#ifndef CGAL_CARTESIAN_CLASS_DEFINED -#include +#ifdef CGAL_CFG_TYPENAME_BUG +#define typename #endif +template < class R > +Aff_transformationC2:: +Aff_transformationC2() +{ + PTR = new Aff_transformation_repC2(FT(1), FT(0), FT(0), FT(1)); +} + +template < class R > +Aff_transformationC2:: +Aff_transformationC2(const Identity_transformation) +{ + PTR = new Aff_transformation_repC2(FT(1), FT(0), FT(0), FT(1)); +} + +template < class R > +Aff_transformationC2::Aff_transformationC2 + (const Aff_transformationC2 &t) + : Handle(t) +{} + +template < class R > +Aff_transformationC2:: +Aff_transformationC2( + const typename Aff_transformationC2::FT & m11, + const typename Aff_transformationC2::FT & m12, + const typename Aff_transformationC2::FT & m21, + const typename Aff_transformationC2::FT & m22, + const typename Aff_transformationC2::FT & w) +{ + PTR = new Aff_transformation_repC2(m11/w, m12/w, m21/w, m22/w); +} + +template < class R > +Aff_transformationC2:: +Aff_transformationC2( + const Translation, + const typename Aff_transformationC2::Vector_2 &v) +{ + PTR = new Translation_repC2(v); +} + +template < class R > +Aff_transformationC2:: +Aff_transformationC2( + const Rotation, + const typename Aff_transformationC2::Direction_2 &d, + const typename Aff_transformationC2::FT &num, + const typename Aff_transformationC2::FT &den) +{ + PTR = new Rotation_repC2(d, num, den); +} + +template < class R > +Aff_transformationC2:: +Aff_transformationC2( + const Rotation, + const typename Aff_transformationC2::FT &sine, + const typename Aff_transformationC2::FT &cosine, + const typename Aff_transformationC2::FT &w) +{ + if (w != FT(1)) // Idem... + PTR = new Rotation_repC2(sine/w, cosine/w); + else + PTR = new Rotation_repC2(sine, cosine); +} + +template < class R > +Aff_transformationC2:: +Aff_transformationC2(const Scaling, + const typename Aff_transformationC2::FT &s, + const typename Aff_transformationC2::FT &w) +{ + if (w != FT(1)) // .... + PTR = new Scaling_repC2(s/w); + else + PTR = new Scaling_repC2(s); +} + +// and a 3x2 matrix for the operations combining rotation, scaling, translation +template < class R > +Aff_transformationC2:: +Aff_transformationC2( + const typename Aff_transformationC2::FT &m11, + const typename Aff_transformationC2::FT &m12, + const typename Aff_transformationC2::FT &m13, + const typename Aff_transformationC2::FT &m21, + const typename Aff_transformationC2::FT &m22, + const typename Aff_transformationC2::FT &m23, + const typename Aff_transformationC2::FT &w) +{ + if (w != FT(1)) // ... + PTR = new Aff_transformation_repC2(m11/w, m12/w, m13/w, + m21/w, m22/w, m23/w); + else + PTR = new Aff_transformation_repC2(m11, m12, m13, + m21, m22, m23); +} + +template < class R > +Aff_transformationC2::~Aff_transformationC2() +{} + +template < class R > +Aff_transformationC2 & +Aff_transformationC2:: +operator=(const Aff_transformationC2 &t) +{ + Handle::operator=(t); + return *this; +} + +template < class R > +std::ostream& +Aff_transformationC2::print(std::ostream &os) const +{ + ptr()->print(os); + return os; +} + +#ifndef CGAL_NO_OSTREAM_INSERT_AFF_TRANSFORMATIONC2 +template < class R > +std::ostream& +operator<<(std::ostream& os, const Aff_transformationC2& t) +{ + t.print(os); + return os; +} +#endif // CGAL_NO_OSTREAM_INSERT_AFF_TRANSFORMATIONC2 + +#ifndef CGAL_NO_ISTREAM_EXTRACT_AFF_TRANSFORMATIONC2 +#endif // CGAL_NO_ISTREAM_EXTRACT_AFF_TRANSFORMATIONC2 + +#ifdef CGAL_CFG_TYPENAME_BUG +#undef typename +#endif + +CGAL_END_NAMESPACE + #endif // CGAL_CARTESIAN_AFF_TRANSFORMATION_2_H diff --git a/Packages/Cartesian_kernel/include/CGAL/Cartesian/Aff_transformation_3.C b/Packages/Cartesian_kernel/include/CGAL/Cartesian/Aff_transformation_3.C deleted file mode 100644 index 8e28b734352..00000000000 --- a/Packages/Cartesian_kernel/include/CGAL/Cartesian/Aff_transformation_3.C +++ /dev/null @@ -1,144 +0,0 @@ -// ====================================================================== -// -// Copyright (c) 2000 The CGAL Consortium -// -// This software and related documentation is part of an INTERNAL release -// of the Computational Geometry Algorithms Library (CGAL). It is not -// intended for general use. -// -// ---------------------------------------------------------------------- -// -// release : -// release_date : -// -// file : include/CGAL/Cartesian/Aff_transformation_3.C -// revision : $Revision$ -// revision_date : $Date$ -// author(s) : Andreas Fabri -// coordinator : INRIA Sophia-Antipolis (Mariette.Yvinec@sophia.inria.fr) -// -// ====================================================================== - -#ifndef CGAL_CARTESIAN_AFF_TRANSFORMATION_3_C -#define CGAL_CARTESIAN_AFF_TRANSFORMATION_3_C - -#ifdef CGAL_CFG_TYPENAME_BUG -#define typename -#endif - -CGAL_BEGIN_NAMESPACE - -template < class R > -Aff_transformationC3:: -Aff_transformationC3() -{ - FT ft1(1), ft0(0); - PTR = new Aff_transformation_repC3(ft1, ft0, ft0, - ft0, ft1, ft0, - ft0, ft0, ft1); -} - -template < class R > -Aff_transformationC3:: -Aff_transformationC3(const Identity_transformation &) -{ - FT ft1(1), ft0(0); - PTR = new Aff_transformation_repC3(ft1, ft0, ft0, - ft0, ft1, ft0, - ft0, ft0, ft1); -} - -template < class R > -Aff_transformationC3:: -Aff_transformationC3( - const Translation, - const typename Aff_transformationC3::Vector_3 &v) -{ - PTR = new Translation_repC3(v); -} - -template < class R > -Aff_transformationC3:: -Aff_transformationC3(const Scaling, - const typename Aff_transformationC3::FT &s, - const typename Aff_transformationC3::FT &w) -{ - if (w != FT(1)) - PTR = new Scaling_repC3(s/w); - else - PTR = new Scaling_repC3(s); -} - -template < class R > -Aff_transformationC3:: -Aff_transformationC3(const typename Aff_transformationC3::FT& m11, - const typename Aff_transformationC3::FT& m12, - const typename Aff_transformationC3::FT& m13, - const typename Aff_transformationC3::FT& m14, - const typename Aff_transformationC3::FT& m21, - const typename Aff_transformationC3::FT& m22, - const typename Aff_transformationC3::FT& m23, - const typename Aff_transformationC3::FT& m24, - const typename Aff_transformationC3::FT& m31, - const typename Aff_transformationC3::FT& m32, - const typename Aff_transformationC3::FT& m33, - const typename Aff_transformationC3::FT& m34, - const typename Aff_transformationC3::FT &w) -{ - if (w != FT(1)) - PTR = new Aff_transformation_repC3(m11/w, m12/w, m13/w, m14/w, - m21/w, m22/w, m23/w, m24/w, - m31/w, m32/w, m33/w, m34/w); - else - PTR = new Aff_transformation_repC3(m11, m12, m13, m14, - m21, m22, m23, m24, - m31, m32, m33, m34); -} - -template < class R > -Aff_transformationC3:: -Aff_transformationC3(const typename Aff_transformationC3::FT& m11, - const typename Aff_transformationC3::FT& m12, - const typename Aff_transformationC3::FT& m13, - const typename Aff_transformationC3::FT& m21, - const typename Aff_transformationC3::FT& m22, - const typename Aff_transformationC3::FT& m23, - const typename Aff_transformationC3::FT& m31, - const typename Aff_transformationC3::FT& m32, - const typename Aff_transformationC3::FT& m33, - const typename Aff_transformationC3::FT &w) -{ - if (w != FT(1)) - PTR = new Aff_transformation_repC3(m11/w, m12/w, m13/w, - m21/w, m22/w, m23/w, - m31/w, m32/w, m33/w); - else - PTR = new Aff_transformation_repC3(m11, m12, m13, - m21, m22, m23, - m31, m32, m33); -} - -template < class R > -Aff_transformationC3::~Aff_transformationC3() -{} - -#ifndef CGAL_NO_OSTREAM_INSERT_AFF_TRANSFORMATIONC3 -template < class R > -std::ostream &operator<<(std::ostream &os, - const Aff_transformationC3 &t) -{ - t.print(os); - return os; -} -#endif // CGAL_NO_OSTREAM_INSERT_AFF_TRANSFORMATIONC3 - -#ifndef CGAL_NO_ISTREAM_EXTRACT_AFF_TRANSFORMATIONC3 -#endif // CGAL_NO_ISTREAM_EXTRACT_AFF_TRANSFORMATIONC3 - -CGAL_END_NAMESPACE - -#ifdef CGAL_CFG_TYPENAME_BUG -#undef typename -#endif - -#endif // CGAL_CARTESIAN_AFF_TRANSFORMATION_3_C 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 638a26ce848..c262173f706 100644 --- a/Packages/Cartesian_kernel/include/CGAL/Cartesian/Aff_transformation_3.h +++ b/Packages/Cartesian_kernel/include/CGAL/Cartesian/Aff_transformation_3.h @@ -133,10 +133,122 @@ private: Aff_t_base* ptr() const { return (Aff_t_base*)PTR; } }; + +#ifdef CGAL_CFG_TYPENAME_BUG +#define typename +#endif + +template < class R > +Aff_transformationC3:: +Aff_transformationC3() +{ + FT ft1(1), ft0(0); + PTR = new Aff_transformation_repC3(ft1, ft0, ft0, + ft0, ft1, ft0, + ft0, ft0, ft1); +} + +template < class R > +Aff_transformationC3:: +Aff_transformationC3(const Identity_transformation &) +{ + FT ft1(1), ft0(0); + PTR = new Aff_transformation_repC3(ft1, ft0, ft0, + ft0, ft1, ft0, + ft0, ft0, ft1); +} + +template < class R > +Aff_transformationC3:: +Aff_transformationC3( + const Translation, + const typename Aff_transformationC3::Vector_3 &v) +{ + PTR = new Translation_repC3(v); +} + +template < class R > +Aff_transformationC3:: +Aff_transformationC3(const Scaling, + const typename Aff_transformationC3::FT &s, + const typename Aff_transformationC3::FT &w) +{ + if (w != FT(1)) + PTR = new Scaling_repC3(s/w); + else + PTR = new Scaling_repC3(s); +} + +template < class R > +Aff_transformationC3:: +Aff_transformationC3(const typename Aff_transformationC3::FT& m11, + const typename Aff_transformationC3::FT& m12, + const typename Aff_transformationC3::FT& m13, + const typename Aff_transformationC3::FT& m14, + const typename Aff_transformationC3::FT& m21, + const typename Aff_transformationC3::FT& m22, + const typename Aff_transformationC3::FT& m23, + const typename Aff_transformationC3::FT& m24, + const typename Aff_transformationC3::FT& m31, + const typename Aff_transformationC3::FT& m32, + const typename Aff_transformationC3::FT& m33, + const typename Aff_transformationC3::FT& m34, + const typename Aff_transformationC3::FT &w) +{ + if (w != FT(1)) + PTR = new Aff_transformation_repC3(m11/w, m12/w, m13/w, m14/w, + m21/w, m22/w, m23/w, m24/w, + m31/w, m32/w, m33/w, m34/w); + else + PTR = new Aff_transformation_repC3(m11, m12, m13, m14, + m21, m22, m23, m24, + m31, m32, m33, m34); +} + +template < class R > +Aff_transformationC3:: +Aff_transformationC3(const typename Aff_transformationC3::FT& m11, + const typename Aff_transformationC3::FT& m12, + const typename Aff_transformationC3::FT& m13, + const typename Aff_transformationC3::FT& m21, + const typename Aff_transformationC3::FT& m22, + const typename Aff_transformationC3::FT& m23, + const typename Aff_transformationC3::FT& m31, + const typename Aff_transformationC3::FT& m32, + const typename Aff_transformationC3::FT& m33, + const typename Aff_transformationC3::FT &w) +{ + if (w != FT(1)) + PTR = new Aff_transformation_repC3(m11/w, m12/w, m13/w, + m21/w, m22/w, m23/w, + m31/w, m32/w, m33/w); + else + PTR = new Aff_transformation_repC3(m11, m12, m13, + m21, m22, m23, + m31, m32, m33); +} + +template < class R > +Aff_transformationC3::~Aff_transformationC3() +{} + +#ifndef CGAL_NO_OSTREAM_INSERT_AFF_TRANSFORMATIONC3 +template < class R > +std::ostream &operator<<(std::ostream &os, + const Aff_transformationC3 &t) +{ + t.print(os); + return os; +} +#endif // CGAL_NO_OSTREAM_INSERT_AFF_TRANSFORMATIONC3 + +#ifndef CGAL_NO_ISTREAM_EXTRACT_AFF_TRANSFORMATIONC3 +#endif // CGAL_NO_ISTREAM_EXTRACT_AFF_TRANSFORMATIONC3 + +#ifdef CGAL_CFG_TYPENAME_BUG +#undef typename +#endif + CGAL_END_NAMESPACE -#ifndef CGAL_CARTESIAN_CLASS_DEFINED -#include -#endif - #endif // CGAL_CARTESIAN_AFF_TRANSFORMATION_3_H