BWAPI
SPAR/AIModule/BWTA/vendors/CGAL/CGAL/IO/print_OFF.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/print_OFF.h $
00015 // $Id: print_OFF.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_PRINT_OFF_H
00021 #define CGAL_IO_PRINT_OFF_H 1
00022 
00023 #include <CGAL/basic.h>
00024 #include <CGAL/IO/File_writer_OFF.h>
00025 #include <CGAL/IO/generic_print_polyhedron.h>
00026 #include <CGAL/Polyhedron_3.h>
00027 #include <iostream>
00028 
00029 CGAL_BEGIN_NAMESPACE
00030 
00031 template <class Polyhedron>
00032 void print_polyhedron_with_header_OFF( std::ostream& out, 
00033                                        const Polyhedron& P,
00034                                        const File_header_OFF& header) {
00035     File_writer_OFF  writer( header);
00036     writer.header().set_polyhedral_surface( true);
00037     writer.header().set_halfedges( P.size_of_halfedges());
00038     generic_print_polyhedron( out, P, writer);
00039 }
00040 
00041 
00042 template <class Polyhedron>
00043 void print_polyhedron_OFF( std::ostream& out, 
00044                            const Polyhedron& P,
00045                            bool verbose = false) {
00046     File_header_OFF header( verbose);
00047     header.set_binary( is_binary( out));
00048     header.set_no_comments( ! is_pretty( out));
00049     print_polyhedron_with_header_OFF( out, P, header);
00050 }
00051 
00052 
00053 // Deprecated global functions, replaced with functions above
00054 
00055 template < class Traits,
00056            class Items,
00057 #ifndef CGAL_CFG_NO_TMPL_IN_TMPL_PARAM
00058            template < class T, class I, class A>
00059 #endif
00060            class HDS, class Alloc>
00061 void
00062 print_OFF( std::ostream& out,
00063            const Polyhedron_3<Traits,Items,HDS,Alloc>& P,
00064            bool verbose = false) {
00065     File_writer_OFF  writer( verbose);
00066     writer.header().set_binary( is_binary( out));
00067     writer.header().set_no_comments( ! is_pretty( out));
00068     writer.header().set_polyhedral_surface( true);
00069     writer.header().set_halfedges( P.size_of_halfedges());
00070     generic_print_polyhedron( out, P, writer);
00071 }
00072 
00073 template < class Traits,
00074            class Items,
00075 #ifndef CGAL_CFG_NO_TMPL_IN_TMPL_PARAM
00076            template < class T, class I, class A>
00077 #endif
00078            class HDS, class Alloc>
00079 void
00080 print_OFF( std::ostream& out,
00081            const Polyhedron_3<Traits,Items,HDS,Alloc>& P,
00082            const File_header_OFF& header) {
00083     File_writer_OFF  writer( header);
00084     writer.header().set_polyhedral_surface( true);
00085     writer.header().set_halfedges( P.size_of_halfedges());
00086     generic_print_polyhedron( out, P, writer);
00087 }
00088 
00089 CGAL_END_NAMESPACE
00090 #endif // CGAL_IO_PRINT_OFF_H //
00091 // EOF //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines