BWAPI
|
00001 // Copyright (c) 2005-2007 Tel-Aviv University (Israel). 00002 // All rights reserved. 00003 // 00004 // This file is part of CGAL (www.cgal.org); you may redistribute it under 00005 // the terms of the Q Public License version 1.0. 00006 // See the file LICENSE.QPL distributed with CGAL. 00007 // 00008 // Licensees holding a valid commercial license may use this file in 00009 // accordance with the commercial license agreement provided with the software. 00010 // 00011 // This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 00012 // WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 00013 // 00014 // $URL: svn+ssh://scm.gforge.inria.fr/svn/cgal/branches/CGAL-3.5-branch/Arrangement_on_surface_2/include/CGAL/IO/Arr_iostream.h $ 00015 // $Id: Arr_iostream.h 40195 2007-09-05 09:51:34Z ophirset $ 00016 // 00017 // 00018 // Author(s) : Ron Wein <wein@post.tau.ac.il> 00019 // (based on old version by Michal Meyerovitch and Ester Ezra) 00020 00021 #ifndef CGAL_ARR_IOSTREAM_H 00022 #define CGAL_ARR_IOSTREAM_H 00023 00029 #include <CGAL/Arrangement_on_surface_2.h> 00030 #include <CGAL/IO/Arr_text_formatter.h> 00031 #include <CGAL/IO/Arrangement_2_writer.h> 00032 #include <CGAL/IO/Arrangement_2_reader.h> 00033 #include <iostream> 00034 00035 CGAL_BEGIN_NAMESPACE 00036 00043 template <class GeomTraits, class TopTraits, class Formatter> 00044 std::ostream& 00045 write (const Arrangement_on_surface_2<GeomTraits,TopTraits>& arr, 00046 std::ostream& os, 00047 Formatter& format) 00048 { 00049 typedef Arrangement_on_surface_2<GeomTraits,TopTraits> Arrangement_2; 00050 typedef Arrangement_2_writer<Arrangement_2> Arr_writer; 00051 00052 Arr_writer writer (arr); 00053 00054 format.set_out (os); 00055 writer (format); 00056 return (os); 00057 } 00058 00064 template <class GeomTraits, class TopTraits> 00065 std::ostream& 00066 operator<< (std::ostream& os, 00067 const Arrangement_on_surface_2<GeomTraits,TopTraits>& arr) 00068 { 00069 typedef Arrangement_on_surface_2<GeomTraits,TopTraits> Arrangement_2; 00070 typedef Arrangement_2_writer<Arrangement_2> Arr_writer; 00071 typedef Arr_text_formatter<Arrangement_2> Text_formatter; 00072 00073 Text_formatter text_format (os); 00074 Arr_writer writer (arr); 00075 00076 writer (text_format); 00077 return (os); 00078 } 00079 00086 template <class GeomTraits, class TopTraits, class Formatter> 00087 std::istream& 00088 read (Arrangement_on_surface_2<GeomTraits,TopTraits>& arr, 00089 std::istream& is, 00090 Formatter& format) 00091 { 00092 typedef Arrangement_on_surface_2<GeomTraits,TopTraits> Arrangement_2; 00093 typedef Arrangement_2_reader<Arrangement_2> Arr_reader; 00094 00095 Arr_reader reader(arr); 00096 00097 format.set_in (is); 00098 reader (format); 00099 return (is); 00100 } 00101 00107 template <class GeomTraits, class TopTraits> 00108 std::istream& 00109 operator>> (std::istream& is, 00110 Arrangement_on_surface_2<GeomTraits,TopTraits>& arr) 00111 { 00112 typedef Arrangement_on_surface_2<GeomTraits,TopTraits> Arrangement_2; 00113 typedef Arrangement_2_reader<Arrangement_2> Arr_reader; 00114 typedef Arr_text_formatter<Arrangement_2> Text_formatter; 00115 00116 Text_formatter text_format (is); 00117 Arr_reader reader(arr); 00118 00119 reader (text_format); 00120 return (is); 00121 } 00122 00123 CGAL_END_NAMESPACE 00124 00125 #endif