mirror of https://github.com/CGAL/cgal
86 lines
1.9 KiB
C++
86 lines
1.9 KiB
C++
// ======================================================================
|
|
//
|
|
// Copyright (c) 1999 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 : Point_2.h
|
|
// package : _2
|
|
// revision : $Revision$
|
|
// revision_date : $Date$
|
|
// author(s) : Andreas Fabri, Stefan Schirra
|
|
//
|
|
// coordinator : MPI, Saarbruecken
|
|
// ======================================================================
|
|
|
|
#ifndef CGAL_POINT_2_H
|
|
#define CGAL_POINT_2_H
|
|
|
|
CGAL_BEGIN_NAMESPACE
|
|
|
|
class Origin;
|
|
|
|
template <class R_>
|
|
class Point_2 : public R_::Kernel_base::Point_2
|
|
{
|
|
typedef typename R_::RT RT;
|
|
typedef typename R_::Vector_2 Vector_2;
|
|
typedef typename R_::Kernel_base::Point_2 RPoint_2;
|
|
public:
|
|
typedef R_ R;
|
|
|
|
Point_2()
|
|
{}
|
|
|
|
Point_2(const Origin& o)
|
|
: RPoint_2(o)
|
|
{}
|
|
|
|
Point_2(const CGAL::Point_2<R>& p)
|
|
: RPoint_2(static_cast<const RPoint_2&>(p))
|
|
{}
|
|
|
|
Point_2(const RPoint_2& p)
|
|
: RPoint_2(p)
|
|
{}
|
|
|
|
Point_2(const RT& hx, const RT& hy)
|
|
: RPoint_2(hx, hy)
|
|
{}
|
|
|
|
Point_2(const RT& hx, const RT& hy, const RT& hw)
|
|
: RPoint_2(hx, hy, hw)
|
|
{}
|
|
};
|
|
|
|
#ifndef CGAL_NO_OSTREAM_INSERT_POINT_2
|
|
template < class R >
|
|
std::ostream&
|
|
operator<<(std::ostream& os, const Point_2<R>& p)
|
|
{
|
|
typedef typename R::Kernel_base::Point_2 RPoint_2;
|
|
return os << static_cast<const RPoint_2&>(p);
|
|
}
|
|
#endif // CGAL_NO_OSTREAM_INSERT_POINT_2
|
|
|
|
#ifndef CGAL_NO_ISTREAM_EXTRACT_POINT_2
|
|
template < class R >
|
|
std::istream&
|
|
operator>>(std::istream& is, Point_2<R>& p)
|
|
{
|
|
typedef typename R::Kernel_base::Point_2 RPoint_2;
|
|
return is >> static_cast<RPoint_2&>(p);
|
|
}
|
|
#endif // CGAL_NO_ISTREAM_EXTRACT_POINT_2
|
|
|
|
CGAL_END_NAMESPACE
|
|
|
|
#endif // CGAL_POINT_2_H
|