BWAPI
SPAR/AIModule/BWTA/vendors/CGAL/CGAL/IO/Polyhedron_iostream.h
Go to the documentation of this file.
00001 // Copyright (c) 1997  ETH Zurich (Switzerland).
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/Polyhedron_IO/include/CGAL/IO/Polyhedron_iostream.h $
00015 // $Id: Polyhedron_iostream.h 28567 2006-02-16 14:30:13Z lsaboret $
00016 // 
00017 //
00018 // Author(s)     : Lutz Kettner  <kettner@mpi-sb.mpg.de>
00019 
00020 #ifndef CGAL_IO_POLYHEDRON_IOSTREAM_H
00021 #define CGAL_IO_POLYHEDRON_IOSTREAM_H 1
00022 
00023 #include <CGAL/Polyhedron_3.h>
00024 #include <CGAL/IO/print_OFF.h>
00025 #include <CGAL/IO/scan_OFF.h>
00026 #include <iostream>
00027 
00028 CGAL_BEGIN_NAMESPACE
00029 
00030 template < class Traits,
00031            class Items,
00032 #ifndef CGAL_CFG_NO_TMPL_IN_TMPL_PARAM
00033            template < class T, class I, class A>
00034 #endif
00035            class HDS, class Alloc>
00036 std::ostream&
00037 operator<<( std::ostream& out, const Polyhedron_3<Traits,Items,HDS,Alloc>& P) {
00038     // writes P to `out' in PRETTY, ASCII or BINARY format
00039     // as the stream indicates.
00040     File_header_OFF header( is_binary( out), ! is_pretty( out), false);
00041     CGAL::print_polyhedron_with_header_OFF( out, P, header);
00042     return out;
00043 }
00044 
00045 template < class Traits,
00046            class Items,
00047 #ifndef CGAL_CFG_NO_TMPL_IN_TMPL_PARAM
00048            template < class T, class I, class A>
00049 #endif
00050            class HDS, class Alloc>
00051 std::istream& operator>>(std::istream& in,
00052                          Polyhedron_3<Traits,Items,HDS,Alloc>& P) {
00053     // reads a polyhedron from `in' and appends it to P.
00054     CGAL::scan_OFF( in, P);
00055     return in;
00056 }
00057 
00058 CGAL_END_NAMESPACE
00059 #endif // CGAL_IO_POLYHEDRON_IOSTREAM_H //
00060 // EOF //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines