BWAPI
SPAR/AIModule/BWTA/vendors/CGAL/CGAL/Triangulation_ds_vertex_base_2.h
Go to the documentation of this file.
00001 // Copyright (c) 1999,2000,2001,2002,2003  INRIA Sophia-Antipolis (France).
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/Triangulation_2/include/CGAL/Triangulation_ds_vertex_base_2.h $
00015 // $Id: Triangulation_ds_vertex_base_2.h 48844 2009-04-21 18:28:04Z spion $
00016 // 
00017 //
00018 // Author(s)     : Mariette Yvinec
00019 
00020 
00021 #ifndef CGAL_TRIANGULATION_DS_VERTEX_BASE_2_H
00022 #define CGAL_TRIANGULATION_DS_VERTEX_BASE_2_H
00023 
00024 #include <CGAL/basic.h>
00025 #include <CGAL/Dummy_tds_2.h>
00026 
00027 CGAL_BEGIN_NAMESPACE
00028 
00029 template < class TDS = void >
00030 class Triangulation_ds_vertex_base_2 
00031 {
00032 
00033 public:
00034   typedef TDS                          Triangulation_data_structure;
00035   typedef typename TDS::Face_handle    Face_handle;
00036   typedef typename TDS::Vertex_handle  Vertex_handle;
00037 
00038   template <typename TDS2>
00039   struct Rebind_TDS { typedef Triangulation_ds_vertex_base_2<TDS2> Other; };
00040 
00041   Triangulation_ds_vertex_base_2 ()    : _f()  {}
00042   Triangulation_ds_vertex_base_2(Face_handle f)    :  _f(f)    {}
00043 
00044   Face_handle face() const { return _f;}
00045   void set_face(Face_handle f) { _f = f ;}
00046 
00047   //the following trivial is_valid to allow
00048   // the user of derived face base classes 
00049   // to add their own purpose checking
00050   bool is_valid(bool /*verbose*/=false, int /*level*/= 0) const
00051     {return face() != Face_handle();}
00052 
00053     // For use by the Compact_container.
00054   void *   for_compact_container() const { return _f.for_compact_container(); }
00055   void * & for_compact_container()       { return _f.for_compact_container(); }
00056 
00057 private:
00058   Face_handle _f;
00059 };
00060 
00061 // Specialization for void.
00062 template <>
00063 class Triangulation_ds_vertex_base_2<void>
00064 {
00065 public:
00066   typedef Dummy_tds_2  Triangulation_data_structure;
00067   typedef Triangulation_data_structure::Vertex_handle   Vertex_handle;
00068   typedef Triangulation_data_structure::Face_handle     Face_handle;
00069   template <typename TDS2>
00070   struct Rebind_TDS { typedef Triangulation_ds_vertex_base_2<TDS2> Other; };
00071 };
00072 
00073 
00074 template < class TDS >
00075 inline
00076 std::istream&
00077 operator>>(std::istream &is, Triangulation_ds_vertex_base_2<TDS> &)
00078   // no combinatorial information.
00079 {
00080   return is;
00081 }
00082 
00083 template < class TDS >
00084 inline
00085 std::ostream&
00086 operator<<(std::ostream &os, const Triangulation_ds_vertex_base_2<TDS> &)
00087   // no combinatorial information.
00088 {
00089   return os;
00090 }
00091 CGAL_END_NAMESPACE
00092 
00093 #endif //CGAL_TRIANGULATION_DS_VERTEX_BASE_2_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines