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/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_do_intersect_functor.h $ 00015 // $Id: Gps_do_intersect_functor.h 37362 2007-03-21 17:04:28Z afabri $ 00016 // 00017 // 00018 // Author(s) : Baruch Zukerman <baruchzu@post.tau.ac.il> 00019 00020 #ifndef CGAL_GPS_DO_INTERSECT_FUNCTOR_H 00021 #define CGAL_GPS_DO_INTERSECT_FUNCTOR_H 00022 00023 CGAL_BEGIN_NAMESPACE 00024 00025 template <class Arrangement_> 00026 class Gps_do_intersect_functor 00027 { 00028 public: 00029 00030 typedef Arrangement_ Arrangement_2; 00031 00032 typedef typename Arrangement_2::Face_const_handle Face_const_handle; 00033 typedef typename Arrangement_2::Vertex_const_handle Vertex_const_handle; 00034 typedef typename Arrangement_2::Halfedge_const_handle Halfedge_const_handle; 00035 00036 typedef typename Arrangement_2::Face_handle Face_handle; 00037 typedef typename Arrangement_2::Halfedge_handle Halfedge_handle; 00038 typedef typename Arrangement_2::Vertex_handle Vertex_handle; 00039 00040 // default constructor 00041 Gps_do_intersect_functor() : m_found_reg_intersection(false), 00042 m_found_boudary_intersection(false) 00043 00044 {} 00045 00046 void create_face (Face_const_handle f1, 00047 Face_const_handle f2, 00048 Face_handle ) 00049 { 00050 if(f1->contained() && f2->contained()) 00051 // found intersection 00052 m_found_reg_intersection = true; 00053 } 00054 00055 00056 void create_vertex(Vertex_const_handle , 00057 Vertex_const_handle , 00058 Vertex_handle ) 00059 { 00060 m_found_boudary_intersection = true; 00061 } 00062 00063 void create_vertex(Vertex_const_handle , 00064 Halfedge_const_handle , 00065 Vertex_handle ) 00066 { 00067 m_found_boudary_intersection = true; 00068 } 00069 00070 void create_vertex(Halfedge_const_handle , 00071 Vertex_const_handle , 00072 Vertex_handle ) 00073 { 00074 m_found_boudary_intersection = true; 00075 } 00076 00077 void create_vertex(Halfedge_const_handle , 00078 Halfedge_const_handle , 00079 Vertex_handle ) 00080 {} 00081 00082 00083 void create_vertex(Face_const_handle , 00084 Vertex_const_handle , 00085 Vertex_handle ) 00086 {} 00087 00088 void create_vertex(Vertex_const_handle , 00089 Face_const_handle , 00090 Vertex_handle ) 00091 {} 00092 00093 void create_edge(Halfedge_const_handle , 00094 Halfedge_const_handle , 00095 Halfedge_handle ) 00096 { 00097 m_found_boudary_intersection = true; 00098 } 00099 00100 void create_edge(Halfedge_const_handle , 00101 Face_const_handle , 00102 Halfedge_handle ) 00103 {} 00104 00105 void create_edge(Face_const_handle , 00106 Halfedge_const_handle , 00107 Halfedge_handle ) 00108 {} 00109 00110 00111 bool found_reg_intersection() const 00112 { 00113 return m_found_reg_intersection; 00114 } 00115 00116 bool found_boundary_intersection() const 00117 { 00118 return m_found_boudary_intersection; 00119 } 00120 00121 protected: 00122 00123 bool m_found_reg_intersection; 00124 bool m_found_boudary_intersection; 00125 }; 00126 00127 00128 CGAL_END_NAMESPACE 00129 00130 #endif