|
BWAPI
|
00001 // Copyright (c) 1997 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_geometry_traits/Segment_assertions.h $ 00015 // $Id: Segment_assertions.h 40377 2007-09-19 11:05:08Z ophirset $ 00016 // 00017 // 00018 // Author(s) : Baruch Zukerman <baruchzu@post.tau.ac.il> 00019 00020 #ifndef CGAL_SEGMENT_ASSERTIONS_H 00021 #define CGAL_SEGMENT_ASSERTIONS_H 00022 00023 CGAL_BEGIN_NAMESPACE 00024 00025 template <class Traits_> 00026 class Segment_assertions 00027 { 00028 typedef Traits_ Traits_2; 00029 00030 typedef typename Traits_2::Point_2 Point_2; 00031 typedef typename Traits_2::Kernel Kernel; 00032 typedef typename Kernel::Line_2 Line_2; 00033 typedef typename Traits_2::X_monotone_curve_2 X_monotone_curve_2; 00034 00035 public: 00036 00037 static bool _assert_is_point_on (const Point_2& pt, 00038 const X_monotone_curve_2& cv, 00039 Tag_true /* tag */) 00040 { 00041 Traits_2 traits; 00042 return (traits.compare_y_at_x_2_object() (pt, cv) == EQUAL); 00043 } 00044 00045 static bool _assert_is_point_on (const Point_2& /* pt */, 00046 const X_monotone_curve_2& /* cv */, 00047 Tag_false /* tag */) 00048 { 00049 return (true); 00050 } 00051 00052 static bool _assert_is_point_on (const Point_2& pt, 00053 const Line_2& l, 00054 Tag_true /* tag */) 00055 { 00056 Kernel kernel; 00057 return (kernel.has_on_2_object() (l, pt)); 00058 } 00059 00060 static bool _assert_is_point_on (const Point_2& /* pt */, 00061 const Line_2& /* l */, 00062 Tag_false /* tag */) 00063 { 00064 return (true); 00065 } 00066 }; 00067 00068 CGAL_END_NAMESPACE 00069 00070 #endif
1.7.6.1