mirror of https://github.com/CGAL/cgal
104 lines
3.6 KiB
C++
104 lines
3.6 KiB
C++
// Copyright (c) 1999 Utrecht University (The Netherlands),
|
|
// ETH Zurich (Switzerland), Freie Universitaet Berlin (Germany),
|
|
// INRIA Sophia-Antipolis (France), Martin-Luther-University Halle-Wittenberg
|
|
// (Germany), Max-Planck-Institute Saarbruecken (Germany), RISC Linz (Austria),
|
|
// and Tel-Aviv University (Israel). All rights reserved.
|
|
//
|
|
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
|
|
// modify it under the terms of the GNU Lesser General Public License as
|
|
// published by the Free Software Foundation; version 2.1 of the License.
|
|
// See the file LICENSE.LGPL distributed with CGAL.
|
|
//
|
|
// Licensees holding a valid commercial license may use this file in
|
|
// accordance with the commercial license agreement provided with the software.
|
|
//
|
|
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
|
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
|
//
|
|
// $URL$
|
|
// $Id$
|
|
//
|
|
// Author(s) : Andreas Fabri, Stefan Schirra
|
|
|
|
#ifndef CGAL_AFF_TRANSFORMATION_3_H
|
|
#define CGAL_AFF_TRANSFORMATION_3_H
|
|
|
|
#include <CGAL/Dimension.h>
|
|
|
|
CGAL_BEGIN_NAMESPACE
|
|
|
|
template <class R_>
|
|
class Aff_transformation_3 : public R_::Kernel_base::Aff_transformation_3
|
|
{
|
|
typedef typename R_::RT RT;
|
|
typedef typename R_::Vector_3 Vector_3;
|
|
typedef typename R_::Kernel_base::Aff_transformation_3 RAff_transformation_3;
|
|
public:
|
|
|
|
typedef CGAL::Dimension_tag<3> Ambiant_dimension;
|
|
|
|
typedef R_ R;
|
|
|
|
Aff_transformation_3() {}
|
|
|
|
Aff_transformation_3(const RAff_transformation_3& t)
|
|
: RAff_transformation_3(t) {}
|
|
|
|
Aff_transformation_3(const Identity_transformation& tag)
|
|
: RAff_transformation_3(tag) {}
|
|
|
|
Aff_transformation_3(const Translation tag,
|
|
const Vector_3& v)
|
|
: RAff_transformation_3(tag, v) {}
|
|
|
|
Aff_transformation_3(const Scaling tag,
|
|
const RT& s,
|
|
const RT& w= RT(1) )
|
|
: RAff_transformation_3(tag, s, w) {}
|
|
|
|
// the general case:
|
|
Aff_transformation_3(
|
|
const RT& m11, const RT& m12, const RT& m13, const RT& m14,
|
|
const RT& m21, const RT& m22, const RT& m23, const RT& m24,
|
|
const RT& m31, const RT& m32, const RT& m33, const RT& m34,
|
|
const RT& w= RT(1) )
|
|
: RAff_transformation_3(m11, m12, m13, m14,
|
|
m21, m22, m23, m24,
|
|
m31, m32, m33, m34,
|
|
w) {}
|
|
|
|
Aff_transformation_3(
|
|
const RT& m11, const RT& m12, const RT& m13,
|
|
const RT& m21, const RT& m22, const RT& m23,
|
|
const RT& m31, const RT& m32, const RT& m33,
|
|
const RT& w = RT(1) )
|
|
: RAff_transformation_3(m11, m12, m13,
|
|
m21, m22, m23,
|
|
m31, m32, m33,
|
|
w) {}
|
|
};
|
|
|
|
#ifndef CGAL_NO_OSTREAM_INSERT_AFF_TRANSFORMATION_3
|
|
template < class R >
|
|
std::ostream&
|
|
operator<<(std::ostream& os, const CGAL::Aff_transformation_3<R>& t)
|
|
{
|
|
typedef typename R::Kernel_base::Aff_transformation_3 RAff_transformation_3;
|
|
return os << static_cast<const RAff_transformation_3&>(t);
|
|
}
|
|
#endif // CGAL_NO_OSTREAM_INSERT_AFF_TRANSFORMATION_3
|
|
|
|
#ifndef CGAL_NO_ISTREAM_EXTRACT_AFF_TRANSFORMATION_3
|
|
template < class R >
|
|
std::istream&
|
|
operator>>(std::istream& is, CGAL::Aff_transformation_3<R>& t)
|
|
{
|
|
typedef typename R::Kernel_base::Aff_transformation_3 RAff_transformation_3;
|
|
return is >> static_cast<const RAff_transformation_3&>(t);
|
|
}
|
|
#endif // CGAL_NO_ISTREAM_EXTRACT_AFF_TRANSFORMATION_3
|
|
|
|
CGAL_END_NAMESPACE
|
|
|
|
#endif // CGAL_AFF_TRANSFORMATION_3_H
|