From cc7624fa5c0a680f22044dbab7d111bf486ea77f Mon Sep 17 00:00:00 2001 From: Sylvain Pion Date: Sun, 6 Aug 2006 16:37:35 +0000 Subject: [PATCH] Last bunch of I/O changes to alloz Lazy_kernel to pass the kernel-I/O test-suite. --- .../include/CGAL/Cartesian/Iso_rectangle_2.h | 2 +- .../include/CGAL/Cartesian/Ray_3.h | 9 --- .../include/CGAL/Homogeneous/CircleH2.h | 61 +------------------ .../CGAL/Homogeneous/Iso_rectangleH2.h | 27 -------- Kernel_23/include/CGAL/Bbox_2.h | 10 +-- Kernel_23/include/CGAL/Bbox_3.h | 15 ++--- Kernel_23/include/CGAL/Circle_2.h | 24 +++----- Kernel_23/include/CGAL/Direction_2.h | 33 +++++----- Kernel_23/include/CGAL/Iso_rectangle_2.h | 19 +++--- Kernel_23/include/CGAL/Line_2.h | 36 +++++------ Kernel_23/include/CGAL/Point_2.h | 22 +++---- Kernel_23/include/CGAL/Point_3.h | 21 +++---- Kernel_23/include/CGAL/Ray_3.h | 16 +++-- Kernel_23/include/CGAL/Sphere_3.h | 17 ++---- Kernel_23/test/Kernel_23/Lazy_kernel.C | 11 ++-- Kernel_23/test/Kernel_23/makefile | 2 +- 16 files changed, 103 insertions(+), 222 deletions(-) diff --git a/Cartesian_kernel/include/CGAL/Cartesian/Iso_rectangle_2.h b/Cartesian_kernel/include/CGAL/Cartesian/Iso_rectangle_2.h index 8788dd62706..8882e379a7e 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/Iso_rectangle_2.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/Iso_rectangle_2.h @@ -17,7 +17,7 @@ // // $URL$ // $Id$ -// +// // // Author(s) : Andreas Fabri, Herve Bronnimann diff --git a/Cartesian_kernel/include/CGAL/Cartesian/Ray_3.h b/Cartesian_kernel/include/CGAL/Cartesian/Ray_3.h index c4a632030db..f5a68c291a5 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/Ray_3.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/Ray_3.h @@ -64,7 +64,6 @@ public: bool operator==(const RayC3 &r) const; bool operator!=(const RayC3 &r) const; - const Point_3 & start() const; const Point_3 & source() const { return get(base).e0; @@ -103,14 +102,6 @@ RayC3::operator!=(const RayC3 &r) const return !(*this == r); } -template < class R > -inline -const typename RayC3::Point_3 & -RayC3::start() const -{ - return source(); -} - template < class R > CGAL_KERNEL_INLINE typename RayC3::Point_3 diff --git a/Homogeneous_kernel/include/CGAL/Homogeneous/CircleH2.h b/Homogeneous_kernel/include/CGAL/Homogeneous/CircleH2.h index 41d7f89f4ce..894813bd2b8 100644 --- a/Homogeneous_kernel/include/CGAL/Homogeneous/CircleH2.h +++ b/Homogeneous_kernel/include/CGAL/Homogeneous/CircleH2.h @@ -17,11 +17,11 @@ // // $URL$ // $Id$ -// +// // // Author(s) : Sven Schoenherr // Stefan Schirra - + #ifndef CGAL_CIRCLEH2_H #define CGAL_CIRCLEH2_H @@ -274,63 +274,6 @@ bool CircleH2::operator!=(const CircleH2& c) const { return !(*this == c); } -#ifndef CGAL_NO_OSTREAM_INSERT_CIRCLEH2 -template < class R > -std::ostream &operator<<(std::ostream &os, const CircleH2 &c) -{ - switch(os.iword(IO::mode)) - { - case IO::ASCII : - os << c.center() << ' ' << c.squared_radius() << ' ' - << static_cast(c.orientation()); - break; - case IO::BINARY : - os << c.center(); - write(os, c.squared_radius()); - write(os, static_cast(c.orientation())); - break; - default: - os << "CircleH2(" << c.center() << ", " << c.squared_radius() ; - if (c.orientation() == CLOCKWISE) { - os << ", clockwise)"; - } else if (c.orientation() == COUNTERCLOCKWISE) { - os << ", counterclockwise)"; - } else { - os << ", collinear)"; - } - break; - } - return os; -} -#endif // CGAL_NO_OSTREAM_INSERT_CIRCLEH2 - -#ifndef CGAL_NO_ISTREAM_EXTRACT_CIRCLEH2 -template < class R > -std::istream& operator>>(std::istream &is, CircleH2 &c) -{ - typename R::Point_2 center; - typename R::FT squared_radius; - int o; - switch(is.iword(IO::mode)) - { - case IO::ASCII : - is >> center >> squared_radius >> o; - break; - case IO::BINARY : - is >> center; - read(is, squared_radius); - is >> o; - break; - default: - std::cerr << "" << std::endl; - std::cerr << "Stream must be in ascii or binary mode" << std::endl; - break; - } - c = CircleH2(center, squared_radius, static_cast(o)); - return is; -} -#endif // CGAL_NO_ISTREAM_EXTRACT_CIRCLEH2 - CGAL_END_NAMESPACE #endif // CGAL_CIRCLEH2_H diff --git a/Homogeneous_kernel/include/CGAL/Homogeneous/Iso_rectangleH2.h b/Homogeneous_kernel/include/CGAL/Homogeneous/Iso_rectangleH2.h index 744dbda92fe..3e365f95929 100644 --- a/Homogeneous_kernel/include/CGAL/Homogeneous/Iso_rectangleH2.h +++ b/Homogeneous_kernel/include/CGAL/Homogeneous/Iso_rectangleH2.h @@ -96,33 +96,6 @@ bounded_side(const typename Iso_rectangleH2::Point_2& p) const return ON_BOUNDED_SIDE; } -#ifndef CGAL_NO_OSTREAM_INSERT_ISO_RECTANGLEH2 -template < class R > -std::ostream& operator<<(std::ostream& os, const Iso_rectangleH2& r) -{ - switch(os.iword(IO::mode)) - { - case IO::ASCII : - return os << r.min() << ' ' << r.max(); - case IO::BINARY : - return os << r.min() << r.max(); - default: - return os << "Iso_rectangleH2(" << r.min() << ", " << r.max() << ")"; - } -} -#endif // CGAL_NO_OSTREAM_INSERT_ISO_RECTANGLEH2 - -#ifndef CGAL_NO_ISTREAM_EXTRACT_ISO_RECTANGLEH2 -template < class R > -std::istream& operator>>(std::istream& is, Iso_rectangleH2& r) -{ - typename R::Point_2 p, q; - is >> p >> q; - r = Iso_rectangleH2(p, q); - return is; -} -#endif // CGAL_NO_ISTREAM_EXTRACT_ISO_RECTANGLEH2 - CGAL_END_NAMESPACE #endif // CGAL_ISO_RECTANGLEH2_H diff --git a/Kernel_23/include/CGAL/Bbox_2.h b/Kernel_23/include/CGAL/Bbox_2.h index e08fde9c87d..1d4dd10e8b3 100644 --- a/Kernel_23/include/CGAL/Bbox_2.h +++ b/Kernel_23/include/CGAL/Bbox_2.h @@ -17,10 +17,9 @@ // // $URL$ // $Id$ -// +// // // Author(s) : Andreas Fabri - #ifndef CGAL_BBOX_2_H #define CGAL_BBOX_2_H @@ -141,7 +140,6 @@ do_overlap(const Bbox_2 &bb1, const Bbox_2 &bb2) return true; } -#ifndef CGAL_NO_OSTREAM_INSERT_BBOX_2 inline std::ostream& operator<<(std::ostream &os, const Bbox_2 &b) @@ -164,9 +162,7 @@ operator<<(std::ostream &os, const Bbox_2 &b) } return os; } -#endif // CGAL_NO_OSTREAM_INSERT_BBOX_2 -#ifndef CGAL_NO_ISTREAM_EXTRACT_BBOX_2 inline std::istream& operator>>(std::istream &is, Bbox_2 &b) @@ -184,10 +180,10 @@ operator>>(std::istream &is, Bbox_2 &b) read(is, ymax); break; } - b = Bbox_2(xmin, ymin, xmax, ymax); + if (is) + b = Bbox_2(xmin, ymin, xmax, ymax); return is; } -#endif // CGAL_NO_ISTREAM_EXTRACT_BBOX_2 CGAL_END_NAMESPACE diff --git a/Kernel_23/include/CGAL/Bbox_3.h b/Kernel_23/include/CGAL/Bbox_3.h index 58d58d715cc..4b6e5c4c0fc 100644 --- a/Kernel_23/include/CGAL/Bbox_3.h +++ b/Kernel_23/include/CGAL/Bbox_3.h @@ -17,10 +17,10 @@ // // $URL$ // $Id$ -// +// // // Author(s) : Andreas Fabri - + #ifndef CGAL_BBOX_3_H #define CGAL_BBOX_3_H @@ -107,7 +107,7 @@ do_overlap(const Bbox_3& bb1, const Bbox_3& bb2) return true; } -#ifndef CGAL_NO_OSTREAM_INSERT_BBOX_3 + inline std::ostream& operator<<(std::ostream &os, const Bbox_3& b) @@ -115,7 +115,7 @@ operator<<(std::ostream &os, const Bbox_3& b) switch(os.iword(IO::mode)) { case IO::ASCII : - return os << b.xmin() << ' ' << b.ymin() << ' ' << b.zmin() + return os << b.xmin() << ' ' << b.ymin() << ' ' << b.zmin() << ' ' << b.xmax() << ' ' << b.ymax() << ' ' << b.zmax(); case IO::BINARY : write(os, b.xmin()); @@ -135,9 +135,7 @@ operator<<(std::ostream &os, const Bbox_3& b) return os; } } -#endif // CGAL_NO_OSTREAM_INSERT_BBOX_3 -#ifndef CGAL_NO_ISTREAM_EXTRACT_BBOX_3 inline std::istream& operator>>(std::istream &is, Bbox_3& b) @@ -158,12 +156,11 @@ operator>>(std::istream &is, Bbox_3& b) read(is, zmax); break; } - b = Bbox_3(xmin, ymin, zmin, xmax, ymax, zmax); + if (is) + b = Bbox_3(xmin, ymin, zmin, xmax, ymax, zmax); return is; } -#endif // CGAL_NO_ISTREAM_EXTRACT_BBOX_3 - CGAL_END_NAMESPACE #endif // CGAL_BBOX_3_H diff --git a/Kernel_23/include/CGAL/Circle_2.h b/Kernel_23/include/CGAL/Circle_2.h index 6580e6dda47..d29fdcc8150 100644 --- a/Kernel_23/include/CGAL/Circle_2.h +++ b/Kernel_23/include/CGAL/Circle_2.h @@ -17,7 +17,7 @@ // // $URL$ // $Id$ -// +// // // Author(s) : Andreas Fabri // Sven Schoenherr @@ -102,12 +102,12 @@ public: { return R().bounded_side_2_object()(*this, p); } - + Oriented_side oriented_side(const Point_2 &p) const { return R().oriented_side_2_object()(*this, p); - } + } bool has_on_boundary(const Point_2 &p) const @@ -166,7 +166,7 @@ public: bool operator==(const Circle_2 &c) const - { + { return R().equal_2_object()(*this, c); } @@ -205,7 +205,7 @@ orthogonal_transform(const typename R_::Aff_transformation_2& t) const : CGAL::opposite(orientation())); } -#ifndef CGAL_NO_OSTREAM_INSERT_CIRCLE_2 + template std::ostream& insert(std::ostream& os, const Circle_2& c) @@ -221,7 +221,7 @@ insert(std::ostream& os, const Circle_2& c) write(os, static_cast(c.orientation())); break; default: - os << "CircleC2(" << c.center() << ", " << c.squared_radius() ; + os << "Circle_2(" << c.center() << ", " << c.squared_radius() ; switch (c.orientation()) { case CLOCKWISE: os << ", clockwise)"; @@ -245,13 +245,10 @@ operator<<(std::ostream &os, const Circle_2 &c) return insert(os, c); } -#endif // CGAL_NO_OSTREAM_INSERT_CIRCLE_2 - -#ifndef CGAL_NO_ISTREAM_EXTRACT_CIRCLE_2 template std::istream& -extract(std::istream& is, Circle_2& c) +extract(std::istream& is, Circle_2& c) { typename R::Point_2 center; typename R::FT squared_radius; @@ -271,21 +268,16 @@ extract(std::istream& is, Circle_2& c) break; } if (is) - c = Circle_2(center, squared_radius, - static_cast(o)); + c = Circle_2(center, squared_radius, static_cast(o)); return is; } - - - template < class R > std::istream & operator>>(std::istream &is, Circle_2 &c) { return extract(is,c); } -#endif // CGAL_NO_ISTREAM_EXTRACT_CIRCLE_2 CGAL_END_NAMESPACE diff --git a/Kernel_23/include/CGAL/Direction_2.h b/Kernel_23/include/CGAL/Direction_2.h index 24246f14655..69ce1beee05 100644 --- a/Kernel_23/include/CGAL/Direction_2.h +++ b/Kernel_23/include/CGAL/Direction_2.h @@ -17,10 +17,10 @@ // // $URL$ // $Id$ -// +// // // Author(s) : Stefan Schirra - + #ifndef CGAL_DIRECTION_2_H #define CGAL_DIRECTION_2_H @@ -75,11 +75,11 @@ public: bool counterclockwise_in_between(const Direction_2 &d1, - const Direction_2 &d2) const + const Direction_2 &d2) const { return R().counterclockwise_in_between_2_object()(*this, d1, d2); } - + Direction_2 perpendicular(const Orientation &o) const { return R().construct_perpendicular_direction_2_object()(*this,o); @@ -103,7 +103,7 @@ public: CGAL_kernel_precondition( ( i == 0 ) || ( i == 1 ) ); return (i==0) ? dx() : dy(); } - + bool operator<(const Direction_2 &d) const { @@ -123,25 +123,30 @@ public: { return R().compare_angle_with_x_axis_2_object()(*this, d) != SMALLER; } - + bool operator<=(const Direction_2 &d) const { return R().compare_angle_with_x_axis_2_object()(*this, d) != LARGER; } - + Direction_2 operator-() const { return R().construct_opposite_direction_2_object()(*this); - } - + } + Vector_2 vector() const { - return R().construct_vector_2_object()(*this); + return R().construct_vector_2_object()(*this); } - + + Vector_2 to_vector() const + { + return this->vector(); + } + bool operator==(const Direction_2& d) const { @@ -165,7 +170,7 @@ public: template std::ostream& -insert(std::ostream& os, const Direction_2& d, const Cartesian_tag&) +insert(std::ostream& os, const Direction_2& d, const Cartesian_tag&) { typename R::Vector_2 v = d.to_vector(); switch(os.iword(IO::mode)) { @@ -208,7 +213,7 @@ operator<<(std::ostream& os, const Direction_2& d) template std::istream& -extract(std::istream& is, Direction_2& d, const Cartesian_tag&) +extract(std::istream& is, Direction_2& d, const Cartesian_tag&) { typename R::FT x, y; switch(is.iword(IO::mode)) { @@ -231,7 +236,7 @@ extract(std::istream& is, Direction_2& d, const Cartesian_tag&) template std::istream& -extract(std::istream& is, Direction_2& d, const Homogeneous_tag&) +extract(std::istream& is, Direction_2& d, const Homogeneous_tag&) { typename R::RT x, y; switch(is.iword(IO::mode)) diff --git a/Kernel_23/include/CGAL/Iso_rectangle_2.h b/Kernel_23/include/CGAL/Iso_rectangle_2.h index bb9cedbd726..2795dabedb1 100644 --- a/Kernel_23/include/CGAL/Iso_rectangle_2.h +++ b/Kernel_23/include/CGAL/Iso_rectangle_2.h @@ -17,7 +17,7 @@ // // $URL$ // $Id$ -// +// // // Author(s) : Andreas Fabri @@ -64,11 +64,11 @@ public: const Point_2 &bottom, const Point_2 &top) : Rep(typename R::Construct_iso_rectangle_2()(left, right, bottom, top).rep()) {} - Iso_rectangle_2(const RT& min_hx, const RT& min_hy, + Iso_rectangle_2(const RT& min_hx, const RT& min_hy, const RT& max_hx, const RT& max_hy) : Rep(typename R::Construct_iso_rectangle_2()(min_hx, min_hy, max_hx, max_hy).rep()) {} - Iso_rectangle_2(const RT& min_hx, const RT& min_hy, + Iso_rectangle_2(const RT& min_hx, const RT& min_hy, const RT& max_hx, const RT& max_hy, const RT& hw) : Rep(typename R::Construct_iso_rectangle_2()(min_hx, min_hy, max_hx, max_hy, hw).rep()) {} @@ -122,7 +122,7 @@ public: return R().compute_xmax_2_object()(*this); } - typename Qualified_result_of::type + typename Qualified_result_of::type ymin() const { return R().compute_ymin_2_object()(*this); @@ -196,7 +196,7 @@ public: Bbox_2 bbox() const - { + { return R().construct_bbox_2_object()(*this); } @@ -208,7 +208,7 @@ public: } }; -#ifndef CGAL_NO_OSTREAM_INSERT_ISO_RECTANGLE_2 + template < class R > std::ostream & operator<<(std::ostream &os, const Iso_rectangle_2 &r) @@ -222,22 +222,19 @@ operator<<(std::ostream &os, const Iso_rectangle_2 &r) return os << "Iso_rectangle_2(" << r.min() << ", " << r.max() << ")"; } } -#endif // CGAL_NO_OSTREAM_INSERT_ISO_RECTANGLE_2 -#ifndef CGAL_NO_ISTREAM_EXTRACT_ISO_RECTANGLE_2 template < class R > std::istream & operator>>(std::istream &is, Iso_rectangle_2 &r) { typename R::Point_2 p, q; - + is >> p >> q; - + if (is) r = Iso_rectangle_2(p, q); return is; } -#endif // CGAL_NO_ISTREAM_EXTRACT_ISO_RECTANGLE_2 CGAL_END_NAMESPACE diff --git a/Kernel_23/include/CGAL/Line_2.h b/Kernel_23/include/CGAL/Line_2.h index c3937141df8..92e47bdaabb 100644 --- a/Kernel_23/include/CGAL/Line_2.h +++ b/Kernel_23/include/CGAL/Line_2.h @@ -17,7 +17,7 @@ // // $URL$ // $Id$ -// +// // // Author(s) : Andreas Fabri @@ -93,7 +93,7 @@ public: return R().compute_c_2_object()(*this); } - Line_2 + Line_2 transform(const Aff_transformation_2 &t) const { return Line_2(t.transform(point(0)), @@ -123,19 +123,19 @@ public: { return R().construct_perpendicular_line_2_object()(*this,p); } - + Point_2 projection(const Point_2& p) const { return R().construct_projected_point_2_object()(*this,p); } - + bool is_horizontal() const { return R().is_horizontal_2_object()(*this); } - + bool is_vertical() const { @@ -150,7 +150,7 @@ public: oriented_side(const Point_2 &p) const { return R().oriented_side_2_object()(*this,p); - } + } bool has_on_boundary(const Point_2 &p) const @@ -170,10 +170,10 @@ public: return oriented_side(p) == ON_NEGATIVE_SIDE; } - bool - has_on(const Point_2 &p) const - { - return has_on_boundary(p); + bool + has_on(const Point_2 &p) const + { + return has_on_boundary(p); } FT @@ -190,13 +190,13 @@ public: Point_2 point() const - { + { return R().construct_point_2_object()(*this); } Point_2 point(int i) const - { + { return R().construct_point_2_object()(*this,i); } @@ -214,10 +214,10 @@ public: }; -#ifndef CGAL_NO_OSTREAM_INSERT_LINE_2 + template std::ostream& -insert(std::ostream& os, const Line_2& l) +insert(std::ostream& os, const Line_2& l) { switch(os.iword(IO::mode)) { case IO::ASCII : @@ -228,25 +228,22 @@ insert(std::ostream& os, const Line_2& l) write(os, l.c()); return os; default: - return os << "Line_2(" << l.a() + return os << "Line_2(" << l.a() << ", " << l.b() << ", " << l.c() <<')'; } } - template < class R > std::ostream & operator<<(std::ostream &os, const Line_2 &l) { return insert(os, l); } -#endif // CGAL_NO_OSTREAM_INSERT_LINE_2 -#ifndef CGAL_NO_ISTREAM_EXTRACT_LINE_2 template std::istream& -extract(std::istream& is, Line_2& l) +extract(std::istream& is, Line_2& l) { typename R::RT a, b, c; switch(is.iword(IO::mode)) { @@ -275,7 +272,6 @@ operator>>(std::istream &is, Line_2 &l) { return extract(is, l); } -#endif // CGAL_NO_ISTREAM_EXTRACT_LINE_2 CGAL_END_NAMESPACE diff --git a/Kernel_23/include/CGAL/Point_2.h b/Kernel_23/include/CGAL/Point_2.h index 2d6d1533b42..1f28805fb64 100644 --- a/Kernel_23/include/CGAL/Point_2.h +++ b/Kernel_23/include/CGAL/Point_2.h @@ -17,7 +17,7 @@ // // $URL$ // $Id$ -// +// // // Author(s) : Andreas Fabri, Stefan Schirra @@ -99,12 +99,12 @@ public: return cartesian(i); } - Cartesian_const_iterator cartesian_begin() const + Cartesian_const_iterator cartesian_begin() const { return typename R::Construct_cartesian_const_iterator_2()(*this); } - Cartesian_const_iterator cartesian_end() const + Cartesian_const_iterator cartesian_end() const { return typename R::Construct_cartesian_const_iterator_2()(*this,2); } @@ -154,12 +154,9 @@ public: }; - -#ifndef CGAL_NO_OSTREAM_INSERT_POINT_2 - template std::ostream& -insert(std::ostream& os, const Point_2& p,const Cartesian_tag&) +insert(std::ostream& os, const Point_2& p,const Cartesian_tag&) { switch(os.iword(IO::mode)) { case IO::ASCII : @@ -200,13 +197,10 @@ operator<<(std::ostream& os, const Point_2& p) return insert(os, p, typename R::Kernel_tag() ); } -#endif // CGAL_NO_OSTREAM_INSERT_POINT_2 - -#ifndef CGAL_NO_ISTREAM_EXTRACT_POINT_2 template std::istream& -extract(std::istream& is, Point_2& p, const Cartesian_tag&) +extract(std::istream& is, Point_2& p, const Cartesian_tag&) { typename R::FT x, y; switch(is.iword(IO::mode)) { @@ -230,7 +224,7 @@ extract(std::istream& is, Point_2& p, const Cartesian_tag&) template std::istream& -extract(std::istream& is, Point_2& p, const Homogeneous_tag&) +extract(std::istream& is, Point_2& p, const Homogeneous_tag&) { typename R::RT hx, hy, hw; switch(is.iword(IO::mode)) @@ -248,7 +242,8 @@ extract(std::istream& is, Point_2& p, const Homogeneous_tag&) std::cerr << "Stream must be in ascii or binary mode" << std::endl; break; } - p = Point_2(hx, hy, hw); + if (is) + p = Point_2(hx, hy, hw); return is; } @@ -258,7 +253,6 @@ operator>>(std::istream& is, Point_2& p) { return extract(is, p, typename R::Kernel_tag() ); } -#endif // CGAL_NO_ISTREAM_EXTRACT_POINT_2 CGAL_END_NAMESPACE diff --git a/Kernel_23/include/CGAL/Point_3.h b/Kernel_23/include/CGAL/Point_3.h index 6d6f1b616d6..8b3e102f66b 100644 --- a/Kernel_23/include/CGAL/Point_3.h +++ b/Kernel_23/include/CGAL/Point_3.h @@ -17,7 +17,7 @@ // // $URL$ // $Id$ -// +// // // Author(s) : Andreas Fabri, Stefan Schirra @@ -133,12 +133,12 @@ public: return hw(); } - Cartesian_const_iterator cartesian_begin() const + Cartesian_const_iterator cartesian_begin() const { return typename R::Construct_cartesian_const_iterator_3()(*this); } - Cartesian_const_iterator cartesian_end() const + Cartesian_const_iterator cartesian_end() const { return typename R::Construct_cartesian_const_iterator_3()(*this,3); } @@ -168,11 +168,9 @@ operator!=(const Origin& o, const Point_3& p) { return p != o; } -#ifndef CGAL_NO_OSTREAM_INSERT_POINT_3 - template std::ostream& -insert(std::ostream& os, const Point_3& p,const Cartesian_tag&) +insert(std::ostream& os, const Point_3& p,const Cartesian_tag&) { switch(os.iword(IO::mode)) { case IO::ASCII : @@ -217,13 +215,10 @@ operator<<(std::ostream& os, const Point_3& p) return insert(os, p, typename R::Kernel_tag() ); } -#endif // CGAL_NO_OSTREAM_INSERT_POINT_3 - -#ifndef CGAL_NO_ISTREAM_EXTRACT_POINT_3 template std::istream& -extract(std::istream& is, Point_3& p, const Cartesian_tag&) +extract(std::istream& is, Point_3& p, const Cartesian_tag&) { typename R::FT x, y, z; switch(is.iword(IO::mode)) { @@ -248,7 +243,7 @@ extract(std::istream& is, Point_3& p, const Cartesian_tag&) template std::istream& -extract(std::istream& is, Point_3& p, const Homogeneous_tag&) +extract(std::istream& is, Point_3& p, const Homogeneous_tag&) { typename R::RT hx, hy, hz, hw; switch(is.iword(IO::mode)) @@ -267,7 +262,8 @@ extract(std::istream& is, Point_3& p, const Homogeneous_tag&) std::cerr << "Stream must be in ascii or binary mode" << std::endl; break; } - p = Point_3(hx, hy, hz, hw); + if (is) + p = Point_3(hx, hy, hz, hw); return is; } @@ -277,7 +273,6 @@ operator>>(std::istream& is, Point_3& p) { return extract(is, p, typename R::Kernel_tag() ); } -#endif // CGAL_NO_ISTREAM_EXTRACT_POINT_3 CGAL_END_NAMESPACE diff --git a/Kernel_23/include/CGAL/Ray_3.h b/Kernel_23/include/CGAL/Ray_3.h index 7d9b345059d..2ae55da2001 100644 --- a/Kernel_23/include/CGAL/Ray_3.h +++ b/Kernel_23/include/CGAL/Ray_3.h @@ -17,10 +17,10 @@ // // $URL$ // $Id$ -// +// // // Author(s) : Andreas Fabri, Stefan Schirra - + #ifndef CGAL_RAY_3_H #define CGAL_RAY_3_H @@ -109,6 +109,12 @@ public: return R().construct_second_point_3_object()(*this); } + Point_3 // FIXME : Use Qrt + start() const + { + return source(); + } + bool has_on(const Point_3 &p) const { return R().has_on_3_object()(*this, p); @@ -151,7 +157,7 @@ public: template std::ostream& -insert(std::ostream& os, const Ray_3& r, const Cartesian_tag&) +insert(std::ostream& os, const Ray_3& r, const Cartesian_tag&) { switch(os.iword(IO::mode)) { case IO::ASCII : @@ -188,7 +194,7 @@ operator<<(std::ostream& os, const Ray_3& r) template std::istream& -extract(std::istream& is, Ray_3& r, const Cartesian_tag&) +extract(std::istream& is, Ray_3& r, const Cartesian_tag&) { typename R::Point_3 p; typename R::Direction_3 d; @@ -202,7 +208,7 @@ extract(std::istream& is, Ray_3& r, const Cartesian_tag&) template std::istream& -extract(std::istream& is, Ray_3& r, const Homogeneous_tag&) +extract(std::istream& is, Ray_3& r, const Homogeneous_tag&) { typename R::Point_3 p; typename R::Direction_3 d; diff --git a/Kernel_23/include/CGAL/Sphere_3.h b/Kernel_23/include/CGAL/Sphere_3.h index 559ee33b4c4..89b4985af9c 100644 --- a/Kernel_23/include/CGAL/Sphere_3.h +++ b/Kernel_23/include/CGAL/Sphere_3.h @@ -17,7 +17,7 @@ // // $URL$ // $Id$ -// +// // // Author(s) : Stefan Schirra @@ -109,7 +109,7 @@ public: oriented_side(const Point_3 &p) const { return R().oriented_side_3_object()(*this, p); - } + } bool has_on_boundary(const Point_3 &p) const @@ -176,11 +176,9 @@ orthogonal_transform(const typename Sphere_3::Aff_transformation_3& t) const } -#ifndef CGAL_NO_OSTREAM_INSERT_SPHERE_3 - template std::ostream& -insert(std::ostream& os, const Sphere_3& c,const Cartesian_tag&) +insert(std::ostream& os, const Sphere_3& c,const Cartesian_tag&) { switch(os.iword(IO::mode)) { case IO::ASCII : @@ -249,13 +247,10 @@ operator<<(std::ostream& os, const Sphere_3& c) return insert(os, c, typename R::Kernel_tag() ); } -#endif // CGAL_NO_OSTREAM_INSERT_SPHERE_3 - -#ifndef CGAL_NO_ISTREAM_EXTRACT_SPHERE_3 template std::istream& -extract(std::istream& is, Sphere_3& c, const Cartesian_tag&) +extract(std::istream& is, Sphere_3& c, const Cartesian_tag&) { typename R::Point_3 center; typename R::FT squared_radius; @@ -282,7 +277,7 @@ extract(std::istream& is, Sphere_3& c, const Cartesian_tag&) template std::istream& -extract(std::istream& is, Sphere_3& c, const Homogeneous_tag&) +extract(std::istream& is, Sphere_3& c, const Homogeneous_tag&) { typename R::Point_3 center; typename R::FT squared_radius; @@ -313,8 +308,6 @@ operator>>(std::istream& is, Sphere_3& c) return extract(is, c, typename R::Kernel_tag() ); } -#endif // CGAL_NO_ISTREAM_EXTRACT_SPHERE_3 - CGAL_END_NAMESPACE #endif // CGAL_SPHERE_3_H diff --git a/Kernel_23/test/Kernel_23/Lazy_kernel.C b/Kernel_23/test/Kernel_23/Lazy_kernel.C index c702c9a147c..78eafdaf895 100644 --- a/Kernel_23/test/Kernel_23/Lazy_kernel.C +++ b/Kernel_23/test/Kernel_23/Lazy_kernel.C @@ -14,10 +14,10 @@ // // $URL$ // $Id$ -// +// // // Author(s) : Sylvain Pion - + #include #include @@ -40,7 +40,7 @@ #include "CGAL/_test_fct_coplanar_3.h" #include "CGAL/_test_cls_iso_cuboid_3.h" #include "CGAL/_test_angle.h" - + #include "CGAL/_test_mf_plane_3_to_2d.h" int @@ -49,6 +49,9 @@ main() typedef CGAL::Cartesian > EK; typedef CGAL::Lazy_kernel Cls; + std::cout << "Testing IO with Lazy_kernel>> :" << std::endl; + _test_io( Cls() ); + std::cout << "Testing 2d with Lazy_kernel>> :"; std::cout << std::endl; _test_2( Cls() ); @@ -80,7 +83,7 @@ main() std::cout << "Testing 3d-2d with Lazy_kernel>> :"; std::cout << std::endl; _test_mf_plane_3_to_2d( Cls() ); - + std::cout << "All tests done" << std::endl; return 0; } diff --git a/Kernel_23/test/Kernel_23/makefile b/Kernel_23/test/Kernel_23/makefile index 138d974b8d8..2b019b938c7 100644 --- a/Kernel_23/test/Kernel_23/makefile +++ b/Kernel_23/test/Kernel_23/makefile @@ -23,7 +23,7 @@ CXXFLAGS = \ $(TESTSUITE_CXXFLAGS) \ $(EXTRA_FLAGS) \ $(CGAL_CXXFLAGS) \ - $(LONG_NAME_PROBLEM_CXXFLAGS) # -g # -DCGAL_CHECK_EXPENSIVE + $(LONG_NAME_PROBLEM_CXXFLAGS) -g #---------------------------------------------------------------------# # linker flags