BWAPI
SPAR/AIModule/BWTA/vendors/CGAL/CGAL/Segment_Delaunay_graph_2/Is_degenerate_edge_C2.h
Go to the documentation of this file.
00001 // Copyright (c) 2003,2004,2005,2006  INRIA Sophia-Antipolis (France) and
00002 // Notre Dame University (U.S.A.).  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_2/Is_degenerate_edge_C2.h $
00015 // $Id: Is_degenerate_edge_C2.h 45156 2008-08-26 13:40:26Z spion $
00016 // 
00017 //
00018 // Author(s)     : Menelaos Karavelas <mkaravel@cse.nd.edu>
00019 
00020 #ifndef CGAL_SEGMENT_DELAUNAY_GRAPH_2_IS_DEGENERATE_EDGE_C2_H
00021 #define CGAL_SEGMENT_DELAUNAY_GRAPH_2_IS_DEGENERATE_EDGE_C2_H
00022 
00023 #include <CGAL/Segment_Delaunay_graph_2/Are_same_points_C2.h>
00024 #include <CGAL/Segment_Delaunay_graph_2/Voronoi_vertex_C2.h>
00025 
00026 CGAL_BEGIN_NAMESPACE
00027 
00028 CGAL_SEGMENT_DELAUNAY_GRAPH_2_BEGIN_NAMESPACE
00029 
00030 //-----------------------------------------------------------------------------
00031 
00032 template<class K, class Method_tag>
00033 class Is_degenerate_edge_C2
00034 {
00035 public:
00036   typedef typename K::Site_2      Site_2;
00037   typedef typename K::Boolean     Boolean;
00038 
00039 private:
00040   typedef Voronoi_vertex_C2<K,Method_tag>  Voronoi_vertex_2;
00041   typedef Are_same_points_C2<K>            Are_same_points_2;
00042 
00043   bool is_endpoint(const Site_2& p, const Site_2& s) const
00044   {
00045     CGAL_precondition( p.is_point() && s.is_segment() );
00046     Are_same_points_2 same_points;
00047 
00048     return
00049       same_points(p, s.source_site()) || same_points(p, s.target_site());
00050   }
00051 
00052 public:
00053   typedef Boolean       result_type;
00054   typedef Site_2        argument_type;
00055 
00056   Boolean   operator()(const Site_2& p, const Site_2& q,
00057                        const Site_2& r, const Site_2& s) const
00058   {
00059     Voronoi_vertex_2 vpqr(p, q, r);
00060     if ( vpqr.incircle_no_easy(s) == POSITIVE ) { return false; }
00061 
00062     Voronoi_vertex_2 vqps(q, p, s);
00063     if ( vqps.incircle_no_easy(r) == POSITIVE ) { return false; }
00064 
00065     return true;
00066   }
00067 
00068 };
00069 
00070 
00071 //-----------------------------------------------------------------------------
00072 
00073 CGAL_SEGMENT_DELAUNAY_GRAPH_2_END_NAMESPACE
00074 
00075 CGAL_END_NAMESPACE
00076 
00077 #endif // CGAL_SEGMENT_DELAUNAY_GRAPH_2_IS_DEGENERATE_EDGE_C2_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines