BWAPI
SPAR/AIModule/BWTA/vendors/CGAL/CGAL/Segment_Delaunay_graph_storage_traits_2.h
Go to the documentation of this file.
00001 // Copyright (c) 2006 Foundation for Research and Technology-Hellas (Greece).
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/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_storage_traits_2.h $
00015 // $Id: Segment_Delaunay_graph_storage_traits_2.h 32875 2006-08-01 13:13:36Z mkaravel $
00016 // 
00017 //
00018 // Author(s)     : Menelaos Karavelas <mkaravel@iacm.forth.gr>
00019 
00020 #ifndef CGAL_SEGMENT_DELAUNAY_GRAPH_STORAGE_TRAITS_2_H
00021 #define CGAL_SEGMENT_DELAUNAY_GRAPH_STORAGE_TRAITS_2_H 1
00022 
00023 #include <CGAL/Segment_Delaunay_graph_2/basic.h>
00024 #include <set>
00025 #include <CGAL/Segment_Delaunay_graph_storage_site_2.h>
00026 #include <CGAL/Segment_Delaunay_graph_simple_storage_site_2.h>
00027 #include <CGAL/Segment_Delaunay_graph_2/Construct_storage_site_2.h>
00028 
00029 
00030 CGAL_BEGIN_NAMESPACE
00031 
00032 //----------------------------------------------------------------------
00033 //----------------------------------------------------------------------
00034 
00035 CGAL_SEGMENT_DELAUNAY_GRAPH_2_BEGIN_NAMESPACE
00036 
00037 namespace Internal {
00038 
00039   template<class Gt, class USE_SIMPLE_STORAGE_SITE_Tag>
00040   struct Which_storage_site;
00041 
00042   // use the simple storage site
00043   template<class Gt>
00044   struct Which_storage_site<Gt,Tag_false>
00045   {
00046     typedef Gt         Geom_traits;
00047     typedef Tag_false  Storage_site_tag;
00048 
00049     typedef Segment_Delaunay_graph_simple_storage_site_2<Geom_traits>
00050     Storage_site_2;
00051   };
00052 
00053   // use the full storage site
00054   template<class Gt>
00055   struct Which_storage_site<Gt,Tag_true>
00056   {
00057     typedef Gt         Geom_traits;
00058     typedef Tag_true   Storage_site_tag;
00059 
00060     typedef Segment_Delaunay_graph_storage_site_2<Geom_traits>
00061     Storage_site_2;
00062   };
00063 
00064 
00065 } // namespace Internal
00066 
00067 CGAL_SEGMENT_DELAUNAY_GRAPH_2_END_NAMESPACE
00068 
00069 //----------------------------------------------------------------------
00070 
00071 template<class Gt>
00072 class Segment_Delaunay_graph_storage_traits_2
00073 {
00074 public:
00075   typedef Gt                                       Geom_traits;
00076   typedef typename Geom_traits::Point_2            Point_2;
00077   typedef typename Geom_traits::Site_2             Site_2;
00078   typedef std::set<Point_2>                        Point_container;
00079   typedef typename Point_container::iterator       Point_handle;
00080   typedef typename Point_container::const_iterator const_Point_handle;
00081 
00082 private:
00083   typedef Segment_Delaunay_graph_storage_traits_2<Geom_traits>   Self;
00084   typedef typename Geom_traits::Intersections_tag                ITag;
00085 
00086 public:
00087   typedef typename
00088   CGAL_SEGMENT_DELAUNAY_GRAPH_2_NS::Internal::
00089   Which_storage_site<Self,ITag>::Storage_site_2
00090   Storage_site_2;
00091 
00092   typedef
00093   CGAL_SEGMENT_DELAUNAY_GRAPH_2_NS::Construct_storage_site_2<Self>
00094   Construct_storage_site_2;
00095 
00096   // MK::FIGURE OUT HOW TO PASS A REFERENCE TO GEOM_TRAITS AND HAVE
00097   // DEFAULT CONSTRUCTOR AS WELL IF POSSIBLE
00098   Segment_Delaunay_graph_storage_traits_2
00099   (const Geom_traits& gt = Geom_traits()) : gt_(gt) {}
00100 
00101   inline const Geom_traits& geom_traits() const { return gt_; }
00102 
00103   inline Construct_storage_site_2
00104   construct_storage_site_2_object() const {
00105     return Construct_storage_site_2();
00106   }
00107 
00108 private:
00109   Geom_traits gt_;
00110 };
00111 
00112 
00113 //----------------------------------------------------------------------
00114 //----------------------------------------------------------------------
00115 
00116 CGAL_END_NAMESPACE
00117 
00118 #endif // CGAL_SEGMENT_DELAUNAY_GRAPH_STORAGE_TRAITS_2_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines