⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 infinite_edge_interior_conflict_c2.h

📁 很多二维 三维几何计算算法 C++ 类库
💻 H
字号:
// Copyright (c) 2003,2004,2005,2006  INRIA Sophia-Antipolis (France) and// Notre Dame University (U.S.A.).  All rights reserved.//// This file is part of CGAL (www.cgal.org); you may redistribute it under// the terms of the Q Public License version 1.0.// See the file LICENSE.QPL distributed with CGAL.//// Licensees holding a valid commercial license may use this file in// accordance with the commercial license agreement provided with the software.//// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.//// $URL: svn+ssh://scm.gforge.inria.fr/svn/cgal/branches/CGAL-3.3-branch/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_2/Infinite_edge_interior_conflict_C2.h $// $Id: Infinite_edge_interior_conflict_C2.h 32872 2006-08-01 12:38:07Z mkaravel $// //// Author(s)     : Menelaos Karavelas <mkaravel@cse.nd.edu>#ifndef CGAL_SEGMENT_DELAUNAY_GRAPH_2_INFINITE_EDGE_INTERIOR_CONFLICT_C2_H#define CGAL_SEGMENT_DELAUNAY_GRAPH_2_INFINITE_EDGE_INTERIOR_CONFLICT_C2_H#include <CGAL/Segment_Delaunay_graph_2/Basic_predicates_C2.h>#include <CGAL/Segment_Delaunay_graph_2/Voronoi_vertex_C2.h>#include <CGAL/Segment_Delaunay_graph_2/Are_same_points_C2.h>#include <CGAL/Segment_Delaunay_graph_2/Are_same_segments_C2.h>CGAL_BEGIN_NAMESPACECGAL_SEGMENT_DELAUNAY_GRAPH_2_BEGIN_NAMESPACE//-----------------------------------------------------------------------------template<class K, class Method_tag>class Infinite_edge_interior_conflict_C2{public:  typedef typename K::Site_2           Site_2;  typedef typename K::RT               RT;  typedef Are_same_points_C2<K>        Are_same_points_2;  typedef Are_same_segments_C2<K>      Are_same_segments_2;  typedef bool                         result_type;  struct argument_type {};  typedef Arity_tag<5>                 Arity;private:  Are_same_points_2    same_points;  Are_same_segments_2  same_segments;public:  bool operator()(const Site_2& q, const Site_2& s, const Site_2& r,		  const Site_2& t, Sign sgn) const  {    if ( t.is_segment() ) {      return false;    }    if ( q.is_segment() ) {      // in this case r and s must be endpoints of q      return ( sgn == NEGATIVE );    }    if ( s.is_point() && r.is_point() && same_points(s, r) ) {      // MK::ERROR: write this code using the compare_x_2 and      //    compare_y_2 predicates instead of computing the inner      //    product...      RT dtsx = s.point().x() - t.point().x();      RT dtsy = s.point().y() - t.point().y();      RT dtqx = q.point().x() - t.point().x();      RT minus_dtqy = -q.point().y() + t.point().y();      Sign sgn1 = sign_of_determinant2x2(dtsx, dtsy, minus_dtqy, dtqx);      CGAL_assertion( sgn1 != ZERO );      return (sgn1 == POSITIVE);    }    if ( s.is_segment() && r.is_segment() && same_segments(s, r) ) {      CGAL_assertion( same_points(q, s.source_site()) ||		      same_points(q, s.target_site()) );      Site_2 ss;      if ( same_points(q, s.source_site()) ) {	ss = s.target_site();      } else {	ss = s.source_site();      }      // MK::ERROR: write this code using the compare_x_2 and      //    compare_y_2 predicates instead of computing the inner      //    product...      RT dtssx = ss.point().x() - t.point().x();      RT dtssy = ss.point().y() - t.point().y();      RT dtqx = q.point().x() - t.point().x();      RT minus_dtqy = -q.point().y() + t.point().y();      Sign sgn1 = sign_of_determinant2x2(dtssx, dtssy, minus_dtqy, dtqx);      CGAL_assertion( sgn1 != ZERO );      return (sgn1 == POSITIVE);    }    return ( sgn == NEGATIVE );  }};//-----------------------------------------------------------------------------CGAL_SEGMENT_DELAUNAY_GRAPH_2_END_NAMESPACECGAL_END_NAMESPACE#endif // CGAL_SEGMENT_DELAUNAY_GRAPH_2_INFINITE_EDGE_INTERIOR_CONFLICT_C2_H

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -