当前位置: 首页>>代码示例>>C++>>正文


C++ PathIterator::simplify_threshold方法代码示例

本文整理汇总了C++中PathIterator::simplify_threshold方法的典型用法代码示例。如果您正苦于以下问题:C++ PathIterator::simplify_threshold方法的具体用法?C++ PathIterator::simplify_threshold怎么用?C++ PathIterator::simplify_threshold使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PathIterator的用法示例。


在下文中一共展示了PathIterator::simplify_threshold方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: tpath

void
_cleanup_path(PathIterator& path, const agg::trans_affine& trans,
              bool remove_nans, bool do_clip,
              const agg::rect_base<double>& rect,
              e_snap_mode snap_mode, double stroke_width,
              bool do_simplify, bool return_curves,
              std::vector<double>& vertices,
              std::vector<npy_uint8>& codes)
{
    typedef agg::conv_transform<PathIterator>  transformed_path_t;
    typedef PathNanRemover<transformed_path_t> nan_removal_t;
    typedef PathClipper<nan_removal_t>         clipped_t;
    typedef PathSnapper<clipped_t>             snapped_t;
    typedef PathSimplifier<snapped_t>          simplify_t;
    typedef agg::conv_curve<simplify_t>        curve_t;

    transformed_path_t tpath(path, trans);
    nan_removal_t      nan_removed(tpath, remove_nans, path.has_curves());
    clipped_t          clipped(nan_removed, do_clip, rect);
    snapped_t          snapped(clipped, snap_mode, path.total_vertices(), stroke_width);
    simplify_t         simplified(snapped, do_simplify, path.simplify_threshold());

    vertices.reserve(path.total_vertices() * 2);
    codes.reserve(path.total_vertices());

    if (return_curves)
    {
        __cleanup_path(simplified, vertices, codes);
    }
    else
    {
        curve_t curve(simplified);
        __cleanup_path(curve, vertices, codes);
    }
}
开发者ID:dhomeier,项目名称:matplotlib-py3,代码行数:35,代码来源:_path.cpp

示例2: PathCleanupIterator

 PathCleanupIterator(PyObject* path, agg::trans_affine trans,
                     bool remove_nans, bool do_clip,
                     const agg::rect_base<double>& rect,
                     e_snap_mode snap_mode, double stroke_width,
                     bool do_simplify) :
     m_path_obj(path, true),
     m_path_iter(m_path_obj),
     m_transform(trans),
     m_transformed(m_path_iter, m_transform),
     m_nan_removed(m_transformed, remove_nans, m_path_iter.has_curves()),
     m_clipped(m_nan_removed, do_clip, rect),
     m_snapped(m_clipped, snap_mode, m_path_iter.total_vertices(),
               stroke_width),
     m_simplify(m_snapped, do_simplify && m_path_iter.should_simplify(),
                m_path_iter.simplify_threshold())
 {
     Py_INCREF(path);
     m_path_iter.rewind(0);
 }
开发者ID:AlexSzatmary,项目名称:matplotlib,代码行数:19,代码来源:path_cleanup.cpp


注:本文中的PathIterator::simplify_threshold方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。