BWAPI
|
00001 // Copyright (c) 2006 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_topology_traits/Arr_bounded_planar_overlay_helper.h $ 00015 // $Id: Arr_bounded_planar_overlay_helper.h 40377 2007-09-19 11:05:08Z ophirset $ 00016 // 00017 // 00018 // Author(s) : Baruch Zukerman <baruchzu@post.tau.ac.il> 00019 // Ron Wein <wein@post.tau.ac.il> 00020 00021 #ifndef CGAL_ARR_BOUNDED_PLANAR_OVERLAY_HELPER_H 00022 #define CGAL_ARR_BOUNDED_PLANAR_OVERLAY_HELPER_H 00023 00028 #include <CGAL/Arr_topology_traits/Arr_bounded_planar_construction_helper.h> 00029 00030 CGAL_BEGIN_NAMESPACE 00031 00037 template <class Traits_, 00038 class ArrangementRed_, 00039 class ArrangementBlue_, 00040 class Arrangement_, 00041 class Event_, 00042 class Subcurve_> 00043 class Arr_bounded_planar_overlay_helper 00044 { 00045 public: 00046 00047 typedef Traits_ Traits_2; 00048 typedef Arrangement_ Arrangement_2; 00049 typedef Event_ Event; 00050 typedef Subcurve_ Subcurve; 00051 00052 typedef typename Traits_2::X_monotone_curve_2 X_monotone_curve_2; 00053 typedef typename Traits_2::Point_2 Point_2; 00054 00055 // The input arrangements (the "red" and the "blue" one): 00056 typedef ArrangementRed_ Arrangement_red_2; 00057 typedef typename Arrangement_red_2::Face_const_handle Face_handle_red; 00058 00059 typedef ArrangementBlue_ Arrangement_blue_2; 00060 typedef typename Arrangement_blue_2::Face_const_handle Face_handle_blue; 00061 00062 // Define the helper class for the construction visitor. 00063 typedef Arr_bounded_planar_construction_helper<Traits_2, 00064 Arrangement_2, 00065 Event, 00066 Subcurve> Construction_helper; 00067 00068 protected: 00069 00070 // Data members: 00071 const typename Arrangement_red_2::Topology_traits *m_red_top_traits; 00072 const typename Arrangement_blue_2::Topology_traits *m_blue_top_traits; 00073 00074 Face_handle_red m_red_ubf; // Red unbounded face. 00075 Face_handle_blue m_blue_ubf; // Blue unbounded face. 00076 00077 public: 00078 00080 Arr_bounded_planar_overlay_helper (const Arrangement_red_2 *red_arr, 00081 const Arrangement_blue_2 *blue_arr) : 00082 m_red_top_traits (red_arr->topology_traits()), 00083 m_blue_top_traits (blue_arr->topology_traits()) 00084 {} 00085 00087 00088 00089 /* A notification issued before the sweep process starts. */ 00090 void before_sweep () 00091 { 00092 // Get the unbounded faces in both arrangements. 00093 m_red_ubf = Face_handle_red (m_red_top_traits->unbounded_face()); 00094 m_blue_ubf = Face_handle_blue (m_blue_top_traits->unbounded_face()); 00095 return; 00096 } 00097 00102 void before_handle_event (Event* /* e */) 00103 { 00104 return; 00105 } 00107 00109 Face_handle_red red_top_face () const 00110 { 00111 return (m_red_ubf); 00112 } 00113 00115 Face_handle_blue blue_top_face () const 00116 { 00117 return (m_blue_ubf); 00118 } 00119 }; 00120 00121 CGAL_END_NAMESPACE 00122 00123 #endif