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

📄 arr_basic_addition_traits.h

📁 很多二维 三维几何计算算法 C++ 类库
💻 H
📖 第 1 页 / 共 2 页
字号:
        return (Point_2(base_p, vh));      else        return (Point_2 (base_p, Vertex_handle()));    }  };  Construct_min_vertex_2 construct_min_vertex_2_object () const  {    return (Construct_min_vertex_2                (m_base_traits->construct_min_vertex_2_object(),                 m_base_traits->equal_2_object()));  }  /*! \class   * The Construct_max_vertex_2 functor.   */  class Construct_max_vertex_2  {  private:    Base_Construct_max_vertex_2 m_base_max_v;    Base_Equal_2                m_base_equal;  public:    Construct_max_vertex_2 (const Base_Construct_max_vertex_2& base_max_v,                            const Base_Equal_2& base_equal):      m_base_max_v (base_max_v),      m_base_equal (base_equal)    {}    Point_2 operator() (const X_monotone_curve_2 & cv)     {      // If there is not halfedge associated with the curve, just return      // a point with invalid halfedge handle.      const Base_point_2&  base_p = m_base_max_v(cv.base());      if (cv.get_halfedge_handle() == Halfedge_handle())        return (Point_2 (base_p, Vertex_handle()));      // We probably have to associate the point with the source vertex of      // the halfedge associated with the curve.      Vertex_handle        vh = cv.get_halfedge_handle()->source();      if (! cv.is_overlapping())        return (Point_2(base_p, vh));      // In case of an overlapping curve, make sure the curve endpoint equals      // the point associated with the vertex. If not, we attach an invalid      // vertex to the extended point.      if (! vh->is_at_infinity() && m_base_equal (base_p, vh->point()))        return (Point_2(base_p, vh));      else        return (Point_2 (base_p, Vertex_handle()));    }  };  Construct_max_vertex_2 construct_max_vertex_2_object () const  {    return (Construct_max_vertex_2                (m_base_traits->construct_max_vertex_2_object(),                 m_base_traits->equal_2_object()));  }  /*! \class   * The Comapre_xy_2 functor.   */  class Compare_xy_2  {  private:    Base_Compare_xy_2 m_base_cmp_xy;  public:    Compare_xy_2(const Base_Compare_xy_2& base):        m_base_cmp_xy(base)    {}    Comparison_result operator() (const Point_2& p1, const Point_2& p2) const    {      if(p1.get_vertex_handle() == p2.get_vertex_handle() &&         p1.get_vertex_handle() != Vertex_handle())        return EQUAL;      return (m_base_cmp_xy(p1.base(), p2.base()));    }  };  Compare_xy_2 compare_xy_2_object () const  {    return (Compare_xy_2 (m_base_traits->compare_xy_2_object()));  }  /*! \class   * The Comapre_y_at_x_2 functor.   */  class Compare_y_at_x_2  {  private:    Base_Compare_y_at_x_2 m_base_cmp_y_at_x;  public:    Compare_y_at_x_2(const Base_Compare_y_at_x_2& base):        m_base_cmp_y_at_x(base)    {}    Comparison_result operator() (const Point_2& p,                                  const X_monotone_curve_2& cv) const    {      return (m_base_cmp_y_at_x (p.base(), cv.base()));    }    Comparison_result operator() (const X_monotone_curve_2& cv1,                                  const X_monotone_curve_2& cv2,                                   Curve_end ind) const    {      // The function is implemented based on the Has_infinite category.      // If the traits class does not support unbounded curves, we just      // return EQUAL, as this comparison will not be invoked anyway.      return _comp_y_at_infinity_imp (cv1, cv2, ind,                                       Base_has_boundary_category());    }  private:    Comparison_result _comp_y_at_infinity_imp (const X_monotone_curve_2& cv1,                                               const X_monotone_curve_2& cv2,                                                Curve_end ind,                                               Tag_true) const    {      return (m_base_cmp_y_at_x (cv1.base(), cv2.base(), ind));    }    Comparison_result _comp_y_at_infinity_imp (const X_monotone_curve_2& ,                                               const X_monotone_curve_2& ,                                                Curve_end ,                                               Tag_false) const    {      return (EQUAL);    }  };  Compare_y_at_x_2 compare_y_at_x_2_object () const  {    return (Compare_y_at_x_2 (m_base_traits->compare_y_at_x_2_object()));  }  /*! \class   * The Comapre_y_at_x_right_2 functor.   */  class Compare_y_at_x_right_2  {  private:    Base_Compare_y_at_x_right_2 m_base_cmp_y_at_x_right;  public:    Compare_y_at_x_right_2(const Base_Compare_y_at_x_right_2& base):        m_base_cmp_y_at_x_right(base)    {}    Comparison_result operator() (const X_monotone_curve_2& cv1,                                  const X_monotone_curve_2& cv2,                                  const Point_2& p) const    {      return (m_base_cmp_y_at_x_right(cv1.base(),                                      cv2.base(),                                      p.base()));    }  };  Compare_y_at_x_right_2 compare_y_at_x_right_2_object () const  {    return (Compare_y_at_x_right_2	    (m_base_traits->compare_y_at_x_right_2_object()));  }  /*! \class   * The Equal_2 functor.   */  class Equal_2  {  private:    Base_Equal_2 m_base_eq;  public:        Equal_2(const Base_Equal_2& base):        m_base_eq(base)    {}    /*! Check if two curves are the same. */    bool operator() (const X_monotone_curve_2& cv1,		     const X_monotone_curve_2& cv2) const    {      return (m_base_eq(cv1.base(), cv2.base()));    }    /*! Check if the two points are the same. */    bool operator() (const Point_2& p1, const Point_2& p2) const    {      return (m_base_eq(p1.base(), p2.base()));    }  };  Equal_2 equal_2_object () const  {    return (Equal_2 (m_base_traits->equal_2_object()));  }  /*! \class   * The Comapre_x_2 functor.   */  class Compare_x_2  {  private:    Base_Compare_x_2 m_base_cmp_x;  public:    Compare_x_2(const Base_Compare_x_2& base):        m_base_cmp_x(base)    {}    Comparison_result operator() (const Point_2& p1, const Point_2& p2) const    {      return (m_base_cmp_x(p1.base(), p2.base()));    }    Comparison_result operator() (const Point_2& p,                                  const X_monotone_curve_2& cv,                                  Curve_end ind) const    {      return (_compare_point_curve_imp (p, cv, ind,                                        Base_has_boundary_category()));    }    Comparison_result operator() (const X_monotone_curve_2& cv1,                                  Curve_end ind1,                                  const X_monotone_curve_2& cv2,                                  Curve_end ind2) const    {      return (_compare_curves_imp (cv1, ind1, cv2, ind2,                                   Base_has_boundary_category()));    }  private:    Comparison_result _compare_point_curve_imp (const Point_2& p,                                                const X_monotone_curve_2& cv,                                                Curve_end ind,                                                Tag_true) const    {      return (m_base_cmp_x (p.base(), cv.base(), ind));    }    Comparison_result _compare_point_curve_imp (const Point_2& ,                                                const X_monotone_curve_2& ,                                                Curve_end ,                                                Tag_false) const    {      return (EQUAL);    }    Comparison_result _compare_curves_imp (const X_monotone_curve_2& cv1,                                            Curve_end ind1,                                           const X_monotone_curve_2& cv2,                                           Curve_end ind2,                                           Tag_true) const    {      return (m_base_cmp_x (cv1.base(), ind1, cv2.base(), ind2));    }    Comparison_result _compare_curves_imp (const X_monotone_curve_2& ,                                           Curve_end,                                           const X_monotone_curve_2& ,                                            Curve_end,                                           Tag_false) const    {      return (EQUAL);    }  };  Compare_x_2 compare_x_2_object () const  {    return (Compare_x_2 (m_base_traits->compare_x_2_object()));  }  /*! \class   * The Is_vertical_2 functor.   */  class Is_vertical_2  {  private:    Base_Is_vertical_2 m_base_is_vert;  public:    Is_vertical_2(const Base_Is_vertical_2& base):        m_base_is_vert(base)    {}     bool operator() (const X_monotone_curve_2& cv) const    {      return (m_base_is_vert(cv.base()));    }  };  Is_vertical_2 is_vertical_2_object() const  {    return (Is_vertical_2(m_base_traits->is_vertical_2_object()));  }};CGAL_END_NAMESPACE#endif

⌨️ 快捷键说明

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