// revision : 2.8 // revision_date : 28 Oct 1999 // author(s) : Hervé Brönnimann #ifndef CGAL_SEGMENT_D_H #define CGAL_SEGMENT_D_H #ifndef CGAL_REP_CLASS_DEFINED #error no representation class defined #endif // CGAL_REP_CLASS_DEFINED #ifdef CGAL_HOMOGENEOUS_H #include #endif // CGAL_HOMOGENEOUS_H #ifdef CGAL_CARTESIAN_H #include #endif // CGAL_CARTESIAN_H #include CGAL_BEGIN_NAMESPACE template class Segment_d : public _R::Segment_d_base { public: typedef _R R; typedef typename R::RT RT; typedef typename R::FT FT; typedef typename R::Segment_d_base RSegment_d; Segment_d() : RSegment_d() {} Segment_d(const CGAL::Segment_d& s) : RSegment_d(s) {} Segment_d(const CGAL::Point_d& sp, const CGAL::Point_d& ep) : RSegment_d(sp,ep) {} Segment_d(const RSegment_d& s) : RSegment_d(s) {} CGAL::Segment_d& operator=(const CGAL::Segment_d& s) { RSegment_d::operator=(s); return *this; } bool has_on(const CGAL::Point_d& p) const { return RSegment_d::has_on(p); } bool operator==(const CGAL::Segment_d& s) const { return RSegment_d::operator==(s); } bool operator!=(const CGAL::Segment_d& s) const { return !(*this == s); } int id() const /* XXX */ { return (int) PTR ; } CGAL::Point_d start() const { return RSegment_d::start(); } CGAL::Point_d end() const { return RSegment_d::end(); } CGAL::Point_d source() const { return RSegment_d::source(); } CGAL::Point_d target() const { return RSegment_d::target(); } CGAL::Point_d min() const { return RSegment_d::min(); } CGAL::Point_d max() const { return RSegment_d::max(); } CGAL::Point_d vertex(int i) const { return RSegment_d::vertex(i); } CGAL::Point_d operator[](int i) const { return vertex(i); } FT squared_length() const { return RSegment_d::squared_length(); } CGAL::Direction_d direction() const { return RSegment_d::direction(); } CGAL::Segment_d opposite() const { return CGAL::Segment_d(target(),source()); } // CGAL::Segment_d transform(const CGAL::Aff_transformation_d& t) const // { return RSegment_d::transform(t); } CGAL::Line_d supporting_line() const { return RSegment_d::supporting_line(); } bool is_degenerate() const { return RSegment_d::is_degenerate(); } // Bbox_d bbox() const // { return source().bbox() + target().bbox(); } }; #ifndef NO_OSTREAM_INSERT_SEGMENT_D template < class R> std::ostream& operator<<(std::ostream& os, const Segment_d& s) { typedef typename R::Segment_d_base RSegment_d; return os << (const RSegment_d& )s; } #endif // NO_OSTREAM_INSERT_SEGMENT_D #ifndef NO_ISTREAM_EXTRACT_SEGMENT_D template < class R> std::istream& operator>>(std::istream& is, Segment_d& s) { typedef typename R::Segment_d_base RSegment_d; return is >> (RSegment_d& )s; } #endif // NO_ISTREAM_EXTRACT_SEGMENT_D CGAL_END_NAMESPACE #endif // CGAL_SEGMENT_D_H