BWAPI
|
00001 // Copyright (c) 2005 Tel-Aviv University (Israel). 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/Arrangement_on_surface_2/include/CGAL/Arr_naive_point_location.h $ 00015 // $Id: Arr_naive_point_location.h 38617 2007-05-11 07:33:48Z eric $ 00016 // 00017 // 00018 // Author(s) : Ron Wein <wein@post.tau.ac.il> 00019 // (based on old version by Eyal Flato) 00020 #ifndef CGAL_ARR_NAIVE_POINT_LOCATION_H 00021 #define CGAL_ARR_NAIVE_POINT_LOCATION_H 00022 00023 #include <CGAL/Arrangement_2/Arr_traits_adaptor_2.h> 00024 00029 CGAL_BEGIN_NAMESPACE 00030 00037 template <class Arrangement_> 00038 class Arr_naive_point_location 00039 { 00040 public: 00041 00042 typedef Arrangement_ Arrangement_2; 00043 typedef typename Arrangement_2::Geometry_traits_2 Geometry_traits_2; 00044 typedef typename Arrangement_2::Topology_traits Topology_traits; 00045 00046 typedef typename Arrangement_2::Vertex_const_handle Vertex_const_handle; 00047 typedef typename Arrangement_2::Halfedge_const_handle Halfedge_const_handle; 00048 typedef typename Arrangement_2::Face_const_handle Face_const_handle; 00049 00050 typedef typename Geometry_traits_2::Point_2 Point_2; 00051 typedef typename Geometry_traits_2::X_monotone_curve_2 X_monotone_curve_2; 00052 00053 protected: 00054 00055 typedef Arr_traits_basic_adaptor_2<Geometry_traits_2> Traits_adaptor_2; 00056 00057 // Data members: 00058 const Arrangement_2 *p_arr; // The associated arrangement. 00059 const Traits_adaptor_2 *geom_traits; // Its associated geometry traits. 00060 const Topology_traits *top_traits; // Its associated topology traits. 00061 00062 public: 00063 00065 Arr_naive_point_location () : 00066 p_arr (NULL), 00067 geom_traits (NULL), 00068 top_traits (NULL) 00069 {} 00070 00072 Arr_naive_point_location (const Arrangement_2& arr) : 00073 p_arr (&arr) 00074 { 00075 geom_traits = 00076 static_cast<const Traits_adaptor_2*> (p_arr->geometry_traits()); 00077 top_traits = p_arr->topology_traits(); 00078 } 00079 00081 void attach (const Arrangement_2& arr) 00082 { 00083 p_arr = &arr; 00084 geom_traits = 00085 static_cast<const Traits_adaptor_2*> (p_arr->geometry_traits()); 00086 top_traits = p_arr->topology_traits(); 00087 } 00088 00090 void detach () 00091 { 00092 p_arr = NULL; 00093 geom_traits = NULL; 00094 top_traits = NULL; 00095 } 00096 00104 Object locate (const Point_2& p) const; 00105 00106 }; 00107 00108 CGAL_END_NAMESPACE 00109 00110 // The member-function definitions can be found under: 00111 #include <CGAL/Arr_point_location/Arr_naive_point_location_impl.h> 00112 00113 #endif