BWAPI
SPAR/AIModule/BWTA/vendors/CGAL/CGAL/IO/scan_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/scan_OFF.h $
00015 // $Id: scan_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_SCAN_OFF_H
00021 #define CGAL_IO_SCAN_OFF_H 1
00022 
00023 #include <CGAL/IO/Polyhedron_scan_OFF.h>
00024 #include <CGAL/Polyhedron_3.h>
00025 #include <iostream>
00026 
00027 CGAL_BEGIN_NAMESPACE
00028 
00029 template < class Traits,
00030            class Items,
00031 #ifndef CGAL_CFG_NO_TMPL_IN_TMPL_PARAM
00032            template < class T, class I, class A>
00033 #endif
00034            class HDS, class Alloc>
00035 void scan_OFF( std::istream& in,
00036                Polyhedron_3<Traits,Items,HDS,Alloc>& P,
00037                File_header_OFF& header) {
00038     // reads a polyhedron from `in' and appends it to P.
00039     // Returns also the File_header_OFF structure of the object.
00040     typedef Polyhedron_3<Traits,Items,HDS,Alloc> Polyhedron;
00041     typedef typename Polyhedron::HalfedgeDS HalfedgeDS;
00042     typedef Polyhedron_scan_OFF<HalfedgeDS> Scanner;
00043     Scanner scanner( in, header.verbose());
00044     P.delegate(scanner);
00045     header = scanner.header();
00046 }
00047 
00048 template < class Traits,
00049            class Items,
00050 #ifndef CGAL_CFG_NO_TMPL_IN_TMPL_PARAM
00051            template < class T, class I, class A>
00052 #endif
00053            class HDS, class Alloc>
00054 void scan_OFF( std::istream& in, Polyhedron_3<Traits,Items,HDS,Alloc>& P,
00055                bool verbose = false) {
00056     // reads a polyhedron from `in' and appends it to P.
00057     typedef Polyhedron_3<Traits,Items,HDS,Alloc> Polyhedron;
00058     typedef typename Polyhedron::HalfedgeDS HalfedgeDS;
00059     typedef Polyhedron_scan_OFF<HalfedgeDS> Scanner;
00060     Scanner scanner( in, verbose);
00061     P.delegate(scanner);
00062 }
00063 
00064 
00065 CGAL_END_NAMESPACE
00066 #endif // CGAL_IO_SCAN_OFF_H //
00067 // EOF //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines